/api/quotes/generatecurl -X POST https://api.miryo.ai/api/quotes/generate \
-H "Content-Type: application/json" \
-H "x-api-key: your_api_key_here" \
-d '{
"issuer": {
"company": "miryo.AI株式会社"
},
"customer": {
"company": "株式会社サンプル"
},
"quote": {
"subject": "システム開発見積",
"items": [
{
"name": "開発作業",
"quantity": 10,
"unitPrice": 50000,
"amount": 500000
}
]
}
}' \
--output quote.pdfcurl -X POST https://api.miryo.ai/api/quotes/generate \
-H "Content-Type: application/json" \
-H "x-api-key: your_api_key_here" \
-d '{
"issuer": {
"company": "miryo.AI株式会社",
"email": "info@miryo.ai",
"phone": "050-1725-6435",
"address": "東京都港区...",
"contactPerson": "山田太郎"
},
"customer": {
"company": "株式会社サンプル",
"name": "田中花子",
"email": "tanaka@example.com",
"phone": "03-9876-5432",
"department": "営業部",
"position": "部長",
"nameKana": "タナカ ハナコ",
"zipCode": "150-0001",
"address": "東京都渋谷区..."
},
"quote": {
"quoteNumber": "QT-2025-001",
"issueDate": "2025-01-15T09:00:00.000Z",
"validUntil": "2025-02-14T23:59:59.999Z",
"subject": "システム開発業務委託",
"items": [
{
"name": "要件定義",
"majorCategory": "上流工程",
"description": "システム要件の洗い出しと仕様策定",
"quantity": 5.0,
"unitPrice": 80000,
"amount": 400000
},
{
"name": "基本設計",
"majorCategory": "上流工程",
"quantity": 10.0,
"unitPrice": 70000,
"amount": 700000
}
],
"taxRate": 0.1,
"paymentTerms": "納品後30日以内に指定口座へお振込みください",
"notes": "見積有効期限: 発行日より30日間\n※金額は税抜価格です",
"showItemDescription": true,
"fontSize": {
"customerCompany": 20,
"customerName": 16
},
"tableColumns": {
"showNo": true,
"showMajorCategory": true
}
}
}' \
--output quote.pdf| パラメータ | 型 | 必須 | 説明 |
|---|---|---|---|
issuer.company | string | 必須 | 発行者の会社名 |
customer.company | string | 必須 | 顧客の会社名 |
customer.name | string | 任意 | 顧客の担当者名(デフォルト: 表示なし) |
customer.email | string | 任意 | 顧客のメールアドレス(email形式、デフォルト: 表示なし) |
customer.phone | string | 任意 | 顧客の電話番号(デフォルト: 表示なし) |
quote.subject | string | 必須 | 見積件名・タイトル |
quote.items | array | 必須 | 見積明細の配列(最低1件必要) |
quote.items[].name | string | 必須 | 明細項目名 |
quote.items[].quantity | number | 必須 | 数量(正の数値) |
quote.items[].unitPrice | number | 必須 | 単価(0以上の数値) |
quote.items[].amount | number | 必須 | 金額(0以上の数値)= quantity × unitPrice |
issuer.email | string | 任意 | 発行者のメールアドレス(デフォルト: 表示なし) |
issuer.phone | string | 任意 | 発行者の電話番号(デフォルト: 表示なし) |
issuer.address | string | 任意 | 発行者の住所(デフォルト: 表示なし) |
issuer.contactPerson | string | 任意 | 発行者の担当者名(デフォルト: 表示なし) |
customer.department | string | 任意 | 顧客の部署名(デフォルト: 表示なし) |
customer.position | string | 任意 | 顧客の役職(デフォルト: 表示なし) |
customer.nameKana | string | 任意 | 顧客名のカナ表記(デフォルト: 表示なし) |
customer.zipCode | string | 任意 | 顧客の郵便番号(デフォルト: 表示なし) |
customer.address | string | 任意 | 顧客の住所(デフォルト: 表示なし) |
quote.quoteNumber | string | 任意 | 見積書番号(未指定時は表示されません) |
quote.issueDate | string | 任意 | 発行日(ISO 8601形式、デフォルト: 現在日時) |
quote.validUntil | string | 任意 | 有効期限(ISO 8601形式、デフォルト: 発行日+30日) |
quote.items[].description | string | 任意 | 明細項目の詳細説明(デフォルト: 表示なし) |
quote.items[].majorCategory | string | 任意 | 大カテゴリ名(デフォルト: 表示なし、showMajorCategory: true で表示) |
quote.notes | string | 任意 | 備考欄(改行は\nで指定、デフォルト: 表示なし) |
quote.paymentTerms | string | 任意 | 支払条件(デフォルト: 表示なし) |
quote.showItemDescription | boolean | 任意 | 明細の詳細説明を表示するか(デフォルト: false) |
quote.taxRate | number | 任意 | 消費税率 0.0~1.0(デフォルト: 0.1 = 10%) |
quote.fontSize | object | 任意 | フォントサイズカスタマイズ設定(デフォルト: システム標準値) |
quote.fontSize.customerCompany | number | 任意 | 顧客会社名のフォントサイズ(デフォルト: 18) |
quote.fontSize.customerName | number | 任意 | 顧客担当者名のフォントサイズ(デフォルト: 14) |
quote.fontSize.customerOther | number | 任意 | 顧客その他情報のフォントサイズ(デフォルト: 10) |
quote.fontSize.issuerCompany | number | 任意 | 発行者会社名のフォントサイズ(デフォルト: 16) |
quote.fontSize.issuerName | number | 任意 | 発行者担当者名のフォントサイズ(デフォルト: 12) |
quote.fontSize.issuerOther | number | 任意 | 発行者その他情報のフォントサイズ(デフォルト: 9) |
quote.fontSize.itemDetail | number | 任意 | 明細詳細のフォントサイズ(デフォルト: 9) |
quote.tableColumns | object | 任意 | テーブル列の表示設定(デフォルト: 全てfalse) |
quote.tableColumns.showNo | boolean | 任意 | No列を表示するか(デフォルト: false) |
quote.tableColumns.showMajorCategory | boolean | 任意 | 大カテゴリ列を表示するか(デフォルト: false) |
PDF Binary Data (application/pdf) Response Headers: Content-Type: application/pdf Content-Disposition: attachment; filename="quote-QT-2025-001.pdf" X-Quote-Number: QT-2025-001
注: 見積書番号がリクエストで指定されていない場合、X-Quote-Numberヘッダーは含まれません。
{
"error": "Invalid request data",
"details": [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": ["customer", "email"],
"message": "Required"
}
]
}{
"error": "API key is required"
}const axios = require('axios');
const fs = require('fs');
async function generateQuote() {
const response = await axios.post(
'https://api.miryo.ai/api/quotes/generate',
{
issuer: { company: 'miryo.AI株式会社' },
customer: {
company: '株式会社サンプル'
},
quote: {
subject: 'システム開発見積',
items: [{
name: '開発作業',
quantity: 10,
unitPrice: 50000,
amount: 500000 // quantity × unitPrice
}]
}
},
{
headers: { 'x-api-key': 'your_api_key_here' },
responseType: 'arraybuffer'
}
);
fs.writeFileSync('quote.pdf', response.data);
if (response.headers['x-quote-number']) {
console.log('Quote Number:', response.headers['x-quote-number']);
}
}import requests
def generate_quote():
response = requests.post(
'https://api.miryo.ai/api/quotes/generate',
headers={'x-api-key': 'your_api_key_here'},
json={
'issuer': {'company': 'miryo.AI株式会社'},
'customer': {
'company': '株式会社サンプル'
},
'quote': {
'subject': 'システム開発見積',
'items': [{
'name': '開発作業',
'quantity': 10,
'unitPrice': 50000,
'amount': 500000 # quantity × unitPrice
}]
}
}
)
with open('quote.pdf', 'wb') as f:
f.write(response.content)
quote_number = response.headers.get('X-Quote-Number')
if quote_number:
print('Quote Number:', quote_number)