{"openapi":"3.0.3","info":{"title":"Tooon API","version":"v1","description":"Tooon の公式APIです。ワークスペースの管理者が発行したAPIキーで呼びます。\n呼び出し回数はAPIキーごとに1分あたり60回までです。\nv1 の中では項目を足す変更だけを行い、今ある項目の削除や意味の変更はしません。\n\n権限（scope）:\n- `connect:members:read`: このサービスに登録した外部会員だけを参照できます\n- `connect:members:write`: 外部会員を登録し、退会時に名刺の公開と事業アカウントの利用を停止できます\n- `connect:cards:read`: このサービスの会員名刺だけを参照できます\n- `connect:cards:write`: 会員名刺の下書きを編集できます。保存では公開内容は変わりません\n- `connect:cards:publish`: 本人が確認した名刺を公開し、公開を停止できます\n- `connect:evidence:read`: 会員自身の経費に付いた証憑の名前・種類・サイズ・日時を取得する\n- `connect:expenses:read`: 会員事業の経費の一覧・詳細を取得する\n- `connect:expenses:write`: 会員事業の経費を手動登録・編集する。支払いは行わない\n- `connect:expenses:delete`: 本人確認後に経費を削除する。証憑や支払いは変更しない\n- `connect:expenses:restore`: 本人確認後に経費を復元する。証憑や支払いは変更しない\n- `connect:settlements:read`: 外部会員自身の支払予定・支払記録と明細を取得する\n- `connect:invoice_requests:cancel`: 会員本人の確認後に提出前の依頼を取り消します。債務や支払いは変更しません\n- `connect:invoice_requests:present`: 会員本人が確認した依頼を連携先で提示するために確定します。メール送信・提出・承認・支払いは行いません\n- `connect:invoice_requests:read`: 会員自身の請求書作成依頼の状態と明細を参照できます\n- `connect:invoice_requests:write`: 依頼を下書きできます。送付・提出・承認・支払い・取消は行いません\n- `connect:agreements:present`: 会員本人が確認した条件を連携先で提示するために確定します。相手の同意・支払い・メール送信は行いません\n- `connect:agreements:cancel`: 本人が確認した未同意の合意を取消します。同意済み契約の解除・支払い・メール送信は行いません\n- `connect:agreements:revise`: 本人が確認した未同意の合意を修正戻しします。同意済み契約の解除・支払い・メール送信は行いません\n- `connect:agreements:read`: 保存された合意内容と状態を参照できます\n- `connect:agreements:write`: 合意内容を下書きできます。相手への提示・送信・同意・支払いは行いません\n- `connect:partners:read`: 会員事業の発注先・業務委託先を参照できます\n- `connect:partners:write`: 会員事業の発注先・業務委託先を登録・編集できます。招待・契約・送付は行いません\n- `connect:partner_orders:read`: 会員事業の発注条件を参照できます\n- `connect:partner_orders:write`: 会員事業の発注条件を下書きできます。実発注・契約締結・送信・支払いは行いません\n- `connect:invoices:read`: 会員事業の帳票・発行履歴・PDFを参照できます。発行・送付・支払いは行いません\n- `connect:invoices:write`: 会員事業の見積書・請求書を下書き作成・編集できます。発行・送付・支払いは行いません\n- `connect:invoices:issue`: 連携先で会員本人が確認した見積書・請求書を発行できます。メール送信や支払いは行いません\n- `connect:business_profile:read`: 会員事業の事業者情報を参照できます。本人確認や契約締結は行いません\n- `connect:business_profile:write`: 会員事業の事業者情報を保存できます。本人確認や契約締結は行いません\n- `connect:bank_account:read`: 会員事業の請求書用振込先を参照できます。口座確認や送金は行いません\n- `connect:bank_account:write`: 会員事業の請求書用振込先を保存できます。口座確認や送金は行いません\n- `connect:tasks:read`: このサービスの会員自身のタスクを参照できます\n- `connect:tasks:write`: 会員自身のタスクを作成し、内容・本人への担当・期日・状態を変更できます\n- `connect:projects:read`: このサービスの会員自身のプロジェクトを参照できます\n- `connect:projects:write`: 会員自身のプロジェクトの作成、内容・状態・親子関係を変更できます\n- `connect:clients:read`: このサービスの会員事業の取引先の連絡先・住所・振込先メモ・内部メモを参照できます\n- `connect:clients:write`: このサービスの会員事業の取引先を登録・更新できます。運営会社の取引先は対象に含みません\n- `connect:accounts:read`: このサービスの外部会員が持つ事業アカウントの状態を参照できます\n- `connect:accounts:write`: 外部会員の事業アカウントを作成・変更・停止できます。運営会社の業務とは分かれます\n- `work:read`: 参照できるページ・データベース・添付ファイルの情報と表示上の関係をMCPから取得する\n- `evidence:read`: 経費に付いた証憑の名前・種類・サイズ・日時を取得する\n- `expenses:read`: 運営会社の経費の一覧・詳細を取得する\n- `expenses:write`: 運営会社の経費を手動登録・編集する。支払いは行わない\n- `expenses:delete`: 本人確認後に経費を削除する。証憑や支払いは変更しない\n- `expenses:restore`: 本人確認後に経費を復元する。証憑や支払いは変更しない\n- `settlements:read`: 運営会社の支払予定・支払記録と明細を取得する\n- `invoice_requests:cancel`: 本人確認後に提出前の依頼を取り消します。債務や支払いは変更しません\n- `invoice_requests:present`: 本人が確認した依頼を連携先で提示するために確定します。メール送信・提出・承認・支払いは行いません\n- `agreements:present`: 本人が確認した条件を連携先で提示するために確定します。相手の同意・支払い・メール送信は行いません\n- `agreements:cancel`: 本人が確認した未同意の合意を取消します。同意済み契約の解除・支払い・メール送信は行いません\n- `agreements:revise`: 本人が確認した未同意の合意を修正戻しします。同意済み契約の解除・支払い・メール送信は行いません\n- `agreements:read`: 保存された合意内容と状態を参照できます\n- `agreements:write`: 合意内容を下書きできます。相手への提示・送信・同意・支払いは行いません\n- `invoices:read`: 運営会社の帳票・発行履歴・PDFを参照できます。発行・送付・支払いは行いません\n- `invoices:write`: 運営会社の見積書・請求書を下書き作成・編集できます。発行・送付・支払いは行いません\n- `invoices:issue`: 連携先で本人が確認した見積書・請求書を発行できます。メール送信や支払いは行いません\n- `business_profile:read`: 運営会社の事業者情報を参照できます。本人確認や契約締結は行いません\n- `business_profile:write`: 運営会社の事業者情報を保存できます。本人確認や契約締結は行いません\n- `bank_account:read`: 運営会社の請求書用振込先を参照できます。口座確認や送金は行いません\n- `bank_account:write`: 運営会社の請求書用振込先を保存できます。口座確認や送金は行いません\n- `tasks:read`: 運営会社のタスクと担当候補を参照できます\n- `tasks:write`: 運営会社のタスクの内容・担当・期日・状態を変更できます\n- `projects:read`: 運営会社のプロジェクトを参照できます。非公開ユニットの所属制限を引き継ぎます\n- `projects:write`: プロジェクトの作成、内容・状態・親子関係の変更ができます。公開や招待は行いません\n- `clients:read`: 運営会社の取引先の連絡先・住所・振込先メモ・内部メモを参照できます\n- `clients:write`: 運営会社の取引先を登録し、情報と状態を変更できます。招待やメールは送信しません\n- `partners:read`: パートナー（振込先などの事業者情報を含む）と業務委託契約を読み取れます\n- `partners:write`: パートナー（事業者情報を含む）と業務委託契約を登録・更新できます。案件や予算とのつなぎ込みは画面で行います\n- `invoice_requests:read`: 請求書作成依頼の状態と中身を読み取れます\n- `invoice_requests:write`: 下書きの作成、委託先への送付・取り消し、委託先が自分のアプリで承認した請求書の提出ができます。承認と支払いは画面で行います\n- `people:read`: 社員・役員・業務委託のスタッフなど、会社の人の登録内容を読み取れます。Tooonの利用者（ログインする人）は含みません\n- `people:write`: 会社の人を登録・更新し、パートナー（業務委託契約の相手）とつなげます。Tooonの利用者の招待や権限の変更は画面で行います\n- `business_cards:read`: 会社の人のデジタル名刺の中身・公開状態・公開URLを読み取れます\n- `business_cards:write`: 会社の人のデジタル名刺を作成・更新し、公開・非公開を切り替えられます。デザイン（テンプレート）は画面で決めます\n- `company_page:read`: 会社のページの紹介と、公開中の提供メニュー・実績を読み取れます。自社サイトに同じ中身を出すときに使います"},"servers":[{"url":"/api"}],"security":[{"bearerAuth":[]}],"paths":{"/v1/expenses/deleted":{"get":{"operationId":"listDeletedExpenses","tags":["Expenses"],"summary":"削除済みの経費を一覧で取得する","description":"復元権限で、この事業が現在参照できる削除済み経費だけを返します。証憑の秘密URL・内部所有者IDは返しません。取得だけでは復元しません。\n\n必要な権限（scope）: `expenses:restore`","x-required-scopes":["expenses:restore"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"state":{"const":"deleted"}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt","state"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/expenses/{id}/delete-preview":{"post":{"operationId":"previewExpenseDeletion","tags":["Expenses"],"summary":"経費を削除する前に内容を確認する","description":"15分有効な確認IDを作ります。連携先はreviewの経費本文・現在状態・削除後の影響を本人へ表示し、確認操作の記録を保持してください。この操作だけでは経費の状態を変えません。\n\n必要な権限（scope）: `expenses:delete`","x-required-scopes":["expenses:delete"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"comment":{"type":"string","maxLength":2000,"nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"action":{"type":"string","enum":["delete","restore"]},"expense":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"state":{"type":"string","enum":["active","deleted"]}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt","state"],"additionalProperties":false},"comment":{"type":"string","nullable":true},"effects":{"type":"object","properties":{"state":{"type":"string","enum":["active","deleted"]},"includedInSummary":{"type":"boolean"},"preservesEvidence":{"const":true},"changesPayment":{"const":false},"delivery":{"const":"none"}},"required":["state","includedInSummary","preservesEvidence","changesPayment","delivery"],"additionalProperties":false}},"required":["action","expense","comment","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/expenses/{id}/delete-confirmed":{"post":{"operationId":"deleteConfirmedExpense","tags":["Expenses"],"summary":"本人が確認した経費を削除する","description":"確認した経費を論理削除します。本人・所有者・キー・操作・内容hash・版・期限を検証し、状態変更と確認の消費を一度だけ保存します。証憑接続・外部参照・金額・通貨・支払いを変更せず、メールも送りません。同じ確認の再送はその操作時の結果を返し、後の別操作を巻き戻しません。現在の状態は一覧で確認してください。\n\n必要な権限（scope）: `expenses:delete`","x-required-scopes":["expenses:delete"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"expenseId":{"type":"string"},"confirmationId":{"type":"string"},"reviewHash":{"type":"string"},"action":{"type":"string","enum":["delete","restore"]},"appliedAt":{"type":"string","format":"date-time"},"delivery":{"const":"none"}},"required":["expenseId","confirmationId","reviewHash","action","appliedAt","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/expenses/{id}/restore-preview":{"post":{"operationId":"previewExpenseRestoration","tags":["Expenses"],"summary":"経費を復元する前に内容を確認する","description":"15分有効な確認IDを作ります。連携先はreviewの経費本文・現在状態・復元後の影響を本人へ表示し、確認操作の記録を保持してください。この操作だけでは経費の状態を変えません。\n\n必要な権限（scope）: `expenses:restore`","x-required-scopes":["expenses:restore"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"comment":{"type":"string","maxLength":2000,"nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"action":{"type":"string","enum":["delete","restore"]},"expense":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"state":{"type":"string","enum":["active","deleted"]}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt","state"],"additionalProperties":false},"comment":{"type":"string","nullable":true},"effects":{"type":"object","properties":{"state":{"type":"string","enum":["active","deleted"]},"includedInSummary":{"type":"boolean"},"preservesEvidence":{"const":true},"changesPayment":{"const":false},"delivery":{"const":"none"}},"required":["state","includedInSummary","preservesEvidence","changesPayment","delivery"],"additionalProperties":false}},"required":["action","expense","comment","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/expenses/{id}/restore-confirmed":{"post":{"operationId":"restoreConfirmedExpense","tags":["Expenses"],"summary":"本人が確認した経費を復元する","description":"確認した経費を論理復元します。本人・所有者・キー・操作・内容hash・版・期限を検証し、状態変更と確認の消費を一度だけ保存します。証憑接続・外部参照・金額・通貨・支払いを変更せず、メールも送りません。同じ確認の再送はその操作時の結果を返し、後の別操作を巻き戻しません。現在の状態は一覧で確認してください。\n\n必要な権限（scope）: `expenses:restore`","x-required-scopes":["expenses:restore"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"expenseId":{"type":"string"},"confirmationId":{"type":"string"},"reviewHash":{"type":"string"},"action":{"type":"string","enum":["delete","restore"]},"appliedAt":{"type":"string","format":"date-time"},"delivery":{"const":"none"}},"required":["expenseId","confirmationId","reviewHash","action","appliedAt","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/expenses/deleted":{"get":{"operationId":"listDeletedConnectExpenses","tags":["Connect expenses"],"summary":"削除済みの経費を一覧で取得する","description":"復元権限で、この事業が現在参照できる削除済み経費だけを返します。証憑の秘密URL・内部所有者IDは返しません。取得だけでは復元しません。\n\n必要な権限（scope）: `connect:expenses:restore`","x-required-scopes":["connect:expenses:restore"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"state":{"const":"deleted"}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt","state"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/expenses/{id}/delete-preview":{"post":{"operationId":"previewConnectExpenseDeletion","tags":["Connect expenses"],"summary":"経費を削除する前に内容を確認する","description":"15分有効な確認IDを作ります。連携先はreviewの経費本文・現在状態・削除後の影響を本人へ表示し、確認操作の記録を保持してください。この操作だけでは経費の状態を変えません。\n\n必要な権限（scope）: `connect:expenses:delete`","x-required-scopes":["connect:expenses:delete"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"comment":{"type":"string","maxLength":2000,"nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"action":{"type":"string","enum":["delete","restore"]},"expense":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"state":{"type":"string","enum":["active","deleted"]}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt","state"],"additionalProperties":false},"comment":{"type":"string","nullable":true},"effects":{"type":"object","properties":{"state":{"type":"string","enum":["active","deleted"]},"includedInSummary":{"type":"boolean"},"preservesEvidence":{"const":true},"changesPayment":{"const":false},"delivery":{"const":"none"}},"required":["state","includedInSummary","preservesEvidence","changesPayment","delivery"],"additionalProperties":false}},"required":["action","expense","comment","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/expenses/{id}/delete-confirmed":{"post":{"operationId":"deleteConfirmedConnectExpense","tags":["Connect expenses"],"summary":"本人が確認した経費を削除する","description":"確認した経費を論理削除します。本人・所有者・キー・操作・内容hash・版・期限を検証し、状態変更と確認の消費を一度だけ保存します。証憑接続・外部参照・金額・通貨・支払いを変更せず、メールも送りません。同じ確認の再送はその操作時の結果を返し、後の別操作を巻き戻しません。現在の状態は一覧で確認してください。\n\n必要な権限（scope）: `connect:expenses:delete`","x-required-scopes":["connect:expenses:delete"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"expenseId":{"type":"string"},"confirmationId":{"type":"string"},"reviewHash":{"type":"string"},"action":{"type":"string","enum":["delete","restore"]},"appliedAt":{"type":"string","format":"date-time"},"delivery":{"const":"none"}},"required":["expenseId","confirmationId","reviewHash","action","appliedAt","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/expenses/{id}/restore-preview":{"post":{"operationId":"previewConnectExpenseRestoration","tags":["Connect expenses"],"summary":"経費を復元する前に内容を確認する","description":"15分有効な確認IDを作ります。連携先はreviewの経費本文・現在状態・復元後の影響を本人へ表示し、確認操作の記録を保持してください。この操作だけでは経費の状態を変えません。\n\n必要な権限（scope）: `connect:expenses:restore`","x-required-scopes":["connect:expenses:restore"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"comment":{"type":"string","maxLength":2000,"nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"action":{"type":"string","enum":["delete","restore"]},"expense":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"state":{"type":"string","enum":["active","deleted"]}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt","state"],"additionalProperties":false},"comment":{"type":"string","nullable":true},"effects":{"type":"object","properties":{"state":{"type":"string","enum":["active","deleted"]},"includedInSummary":{"type":"boolean"},"preservesEvidence":{"const":true},"changesPayment":{"const":false},"delivery":{"const":"none"}},"required":["state","includedInSummary","preservesEvidence","changesPayment","delivery"],"additionalProperties":false}},"required":["action","expense","comment","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/expenses/{id}/restore-confirmed":{"post":{"operationId":"restoreConfirmedConnectExpense","tags":["Connect expenses"],"summary":"本人が確認した経費を復元する","description":"確認した経費を論理復元します。本人・所有者・キー・操作・内容hash・版・期限を検証し、状態変更と確認の消費を一度だけ保存します。証憑接続・外部参照・金額・通貨・支払いを変更せず、メールも送りません。同じ確認の再送はその操作時の結果を返し、後の別操作を巻き戻しません。現在の状態は一覧で確認してください。\n\n必要な権限（scope）: `connect:expenses:restore`","x-required-scopes":["connect:expenses:restore"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"expenseId":{"type":"string"},"confirmationId":{"type":"string"},"reviewHash":{"type":"string"},"action":{"type":"string","enum":["delete","restore"]},"appliedAt":{"type":"string","format":"date-time"},"delivery":{"const":"none"}},"required":["expenseId","confirmationId","reviewHash","action","appliedAt","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/expenses/{id}/evidence":{"get":{"operationId":"listExpenseEvidence","tags":["Expenses"],"summary":"経費に付いた証憑を一覧で確認する","description":"現在参照できる経費に付いた証憑の名前・種類・サイズ・日時だけを返します。証憑自身のユニット・関連案件の権限も確認します。ファイルの保存URL・内部所有者・登録者・メモは返さず、ファイル配信・変更・削除を行いません。\n\n必要な権限（scope）: `evidence:read`","x-required-scopes":["evidence:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"fileType":{"type":"string"},"fileSize":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","fileName","fileType","fileSize","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/expenses/{id}/evidence/{evidenceId}":{"get":{"operationId":"getExpenseEvidence","tags":["Expenses"],"summary":"経費に付いた証憑の情報を取得する","description":"指定した経費に付いた、現在参照可能な証憑のメタデータを返します。別の経費・事業の証憑や削除済み・参照不能な対象は返しません。ファイルのURL・本文・内部所有者・登録者・メモは含めません。\n\n必要な権限（scope）: `evidence:read`","x-required-scopes":["evidence:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"evidenceId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"fileType":{"type":"string"},"fileSize":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","fileName","fileType","fileSize","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/expenses/{id}/evidence":{"get":{"operationId":"listConnectExpenseEvidence","tags":["Connect expenses"],"summary":"経費に付いた証憑を一覧で確認する","description":"現在参照できる経費に付いた証憑の名前・種類・サイズ・日時だけを返します。証憑自身のユニット・関連案件の権限も確認します。ファイルの保存URL・内部所有者・登録者・メモは返さず、ファイル配信・変更・削除を行いません。\n\n必要な権限（scope）: `connect:evidence:read`","x-required-scopes":["connect:evidence:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"fileType":{"type":"string"},"fileSize":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","fileName","fileType","fileSize","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/expenses/{id}/evidence/{evidenceId}":{"get":{"operationId":"getConnectExpenseEvidence","tags":["Connect expenses"],"summary":"経費に付いた証憑の情報を取得する","description":"指定した経費に付いた、現在参照可能な証憑のメタデータを返します。別の経費・事業の証憑や削除済み・参照不能な対象は返しません。ファイルのURL・本文・内部所有者・登録者・メモは含めません。\n\n必要な権限（scope）: `connect:evidence:read`","x-required-scopes":["connect:evidence:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"evidenceId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"type":"string"},"fileType":{"type":"string"},"fileSize":{"type":"integer"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","fileName","fileType","fileSize","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/expenses":{"get":{"operationId":"listExpenses","tags":["Expenses"],"summary":"経費を一覧で取得する","description":"この事業が参照できる経費だけを返します。分類は保存記録であり税務上の判断を保証しません。証憑の秘密URLや内部所有者IDは返しません。\n\n必要な権限（scope）: `expenses:read`","x-required-scopes":["expenses:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"category","in":"query","required":false,"schema":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"]}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"orderId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createExpense","tags":["Expenses"],"summary":"経費を登録する","description":"名称・税込の円金額・発生日時で手動登録します。通貨はJPYです。externalRefは事業内で一意で、同じ内容なら既存記録、異なる内容は409です。新規経費は事業全体に置き、任意の案件・プロジェクトの参照制限も引き継ぎます。支払い・メール・公開は行いません。\n\n必要な権限（scope）: `expenses:write`","x-required-scopes":["expenses:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"amount":{"type":"integer","minimum":0,"maximum":2147483647},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","maxLength":200,"nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","maxLength":2000,"nullable":true},"orderId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"currency":{"const":"JPY"},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["title","amount","expenseDate"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/expenses/summary":{"get":{"operationId":"summarizeExpenses","tags":["Expenses"],"summary":"期間内の経費を分類別に集計する","description":"fromを含みuntilを含まないUTC期間（最大366日）で、現在参照できる非削除経費だけを集計します。currencyは既定JPYで、異なる通貨を合算・換算しません。金額は保存された整数値で、税額や控除額の計算ではありません。集計中に結果が変わった場合は409です。\n\n必要な権限（scope）: `expenses:read`","x-required-scopes":["expenses:read"],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"until":{"type":"string","format":"date-time"},"currency":{"type":"string"},"totalAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"byCategory":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["category","amount","count"],"additionalProperties":false},"maxItems":13}},"required":["from","until","currency","totalAmount","count","byCategory"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/expenses/{id}":{"get":{"operationId":"getExpense","tags":["Expenses"],"summary":"経費を取得する","description":"必要な権限（scope）: `expenses:read`","x-required-scopes":["expenses:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateExpense","tags":["Expenses"],"summary":"経費を編集する","description":"expectedUpdatedAtには直前のGETの値を指定します。古い版は409です。省略項目は保持し、任意項目はnullで解除できます。外部参照・所有者・通貨・ユニット・証憑は変更しません。JPY以外の既存記録は参照のみです。支払実行や銀行の記録は変更しません。\n\n必要な権限（scope）: `expenses:write`","x-required-scopes":["expenses:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"amount":{"type":"integer","minimum":0,"maximum":2147483647},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","maxLength":200,"nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","maxLength":2000,"nullable":true},"orderId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/expenses":{"get":{"operationId":"listConnectExpenses","tags":["Connect expenses"],"summary":"経費を一覧で取得する","description":"この事業が参照できる経費だけを返します。分類は保存記録であり税務上の判断を保証しません。証憑の秘密URLや内部所有者IDは返しません。\n\n必要な権限（scope）: `connect:expenses:read`","x-required-scopes":["connect:expenses:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"category","in":"query","required":false,"schema":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"]}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"orderId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","required":false,"schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createConnectExpense","tags":["Connect expenses"],"summary":"経費を登録する","description":"名称・税込の円金額・発生日時で手動登録します。通貨はJPYです。externalRefは事業内で一意で、同じ内容なら既存記録、異なる内容は409です。新規経費は事業全体に置き、任意の案件・プロジェクトの参照制限も引き継ぎます。支払い・メール・公開は行いません。\n\n必要な権限（scope）: `connect:expenses:write`","x-required-scopes":["connect:expenses:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"amount":{"type":"integer","minimum":0,"maximum":2147483647},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","maxLength":200,"nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","maxLength":2000,"nullable":true},"orderId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"currency":{"const":"JPY"},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["title","amount","expenseDate"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/expenses/summary":{"get":{"operationId":"summarizeConnectExpenses","tags":["Connect expenses"],"summary":"期間内の経費を分類別に集計する","description":"fromを含みuntilを含まないUTC期間（最大366日）で、現在参照できる非削除経費だけを集計します。currencyは既定JPYで、異なる通貨を合算・換算しません。金額は保存された整数値で、税額や控除額の計算ではありません。集計中に結果が変わった場合は409です。\n\n必要な権限（scope）: `connect:expenses:read`","x-required-scopes":["connect:expenses:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"until","in":"query","required":true,"schema":{"type":"string","format":"date-time"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"until":{"type":"string","format":"date-time"},"currency":{"type":"string"},"totalAmount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"count":{"type":"integer","minimum":0,"maximum":9007199254740991},"byCategory":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"amount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"count":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["category","amount","count"],"additionalProperties":false},"maxItems":13}},"required":["from","until","currency","totalAmount","count","byCategory"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/expenses/{id}":{"get":{"operationId":"getConnectExpense","tags":["Connect expenses"],"summary":"経費を取得する","description":"必要な権限（scope）: `connect:expenses:read`","x-required-scopes":["connect:expenses:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateConnectExpense","tags":["Connect expenses"],"summary":"経費を編集する","description":"expectedUpdatedAtには直前のGETの値を指定します。古い版は409です。省略項目は保持し、任意項目はnullで解除できます。外部参照・所有者・通貨・ユニット・証憑は変更しません。JPY以外の既存記録は参照のみです。支払実行や銀行の記録は変更しません。\n\n必要な権限（scope）: `connect:expenses:write`","x-required-scopes":["connect:expenses:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"amount":{"type":"integer","minimum":0,"maximum":2147483647},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","maxLength":200,"nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","maxLength":2000,"nullable":true},"orderId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"expenseDate":{"type":"string","format":"date-time"},"category":{"type":"string","enum":["TRAVEL_AND_TRANSPORTATION","COMMUNICATION","ENTERTAINMENT","CONSUMABLE","BOOKS_AND_EDUCATION","ADVERTISING","RENT","UTILITY","OUTSOURCING","TAX_AND_DUES","REPAIR","OTHER"],"nullable":true},"vendor":{"type":"string","nullable":true},"paymentMethod":{"type":"string","enum":["CASH","CREDIT_CARD","BANK_TRANSFER","DIRECT_DEBIT","E_MONEY","OTHER"],"nullable":true},"memo":{"type":"string","nullable":true},"orderId":{"type":"string","nullable":true},"projectId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","amount","currency","expenseDate","category","vendor","paymentMethod","memo","orderId","projectId","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/settlements":{"get":{"operationId":"listSettlements","tags":["Settlements"],"summary":"支払予定・支払記録を一覧で取得する","description":"この事業の保存記録を返します。amountは記録された金額、paymentDateは未払いの場合は予定日、支払済みの場合は記録された支払日です。状態だけで銀行や決済事業者の着金を保証するものではありません。APIの取得で支払い・承認・送信は行いません。\n\n必要な権限（scope）: `settlements:read`","x-required-scopes":["settlements:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["unpaid","paid","refunded"]}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string","enum":["unpaid","paid","refunded"]},"counterpartyName":{"type":"string","nullable":true},"paymentDate":{"type":"string","format":"date-time","nullable":true},"expensesOccurredDate":{"type":"string","format":"date-time","nullable":true},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"orderId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","amount","currency","status","counterpartyName","paymentDate","expensesOccurredDate","isIncludingTax","taxRoundingMethod","orderId","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/settlements/{id}":{"get":{"operationId":"getSettlement","tags":["Settlements"],"summary":"支払予定・支払記録を取得する","description":"この事業が閲覧できる保存記録だけを返します。明細はlinesで取得します。口座情報・決済事業者の識別子・添付書類の秘密URLは含めません。\n\n必要な権限（scope）: `settlements:read`","x-required-scopes":["settlements:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string","enum":["unpaid","paid","refunded"]},"counterpartyName":{"type":"string","nullable":true},"paymentDate":{"type":"string","format":"date-time","nullable":true},"expensesOccurredDate":{"type":"string","format":"date-time","nullable":true},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"orderId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","amount","currency","status","counterpartyName","paymentDate","expensesOccurredDate","isIncludingTax","taxRoundingMethod","orderId","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/settlements/{id}/lines":{"get":{"operationId":"listSettlementLines","tags":["Settlements"],"summary":"支払記録の明細を取得する","description":"保存された明細を最大100件ずつ返します。明細の並びはID順です。取得時に再計算・状態変更は行いません。\n\n必要な権限（scope）: `settlements:read`","x-required-scopes":["settlements:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"}},"required":["id","name","quantity","unit","unitPrice","taxRate","isWithholdingTax"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/settlements":{"get":{"operationId":"listConnectSettlements","tags":["Connect settlements"],"summary":"支払予定・支払記録を一覧で取得する","description":"この事業の保存記録を返します。amountは記録された金額、paymentDateは未払いの場合は予定日、支払済みの場合は記録された支払日です。状態だけで銀行や決済事業者の着金を保証するものではありません。APIの取得で支払い・承認・送信は行いません。\n\n必要な権限（scope）: `connect:settlements:read`","x-required-scopes":["connect:settlements:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["unpaid","paid","refunded"]}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string","enum":["unpaid","paid","refunded"]},"counterpartyName":{"type":"string","nullable":true},"paymentDate":{"type":"string","format":"date-time","nullable":true},"expensesOccurredDate":{"type":"string","format":"date-time","nullable":true},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"orderId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","amount","currency","status","counterpartyName","paymentDate","expensesOccurredDate","isIncludingTax","taxRoundingMethod","orderId","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/settlements/{id}":{"get":{"operationId":"getConnectSettlement","tags":["Connect settlements"],"summary":"支払予定・支払記録を取得する","description":"この事業が閲覧できる保存記録だけを返します。明細はlinesで取得します。口座情報・決済事業者の識別子・添付書類の秘密URLは含めません。\n\n必要な権限（scope）: `connect:settlements:read`","x-required-scopes":["connect:settlements:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string","enum":["unpaid","paid","refunded"]},"counterpartyName":{"type":"string","nullable":true},"paymentDate":{"type":"string","format":"date-time","nullable":true},"expensesOccurredDate":{"type":"string","format":"date-time","nullable":true},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"orderId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","amount","currency","status","counterpartyName","paymentDate","expensesOccurredDate","isIncludingTax","taxRoundingMethod","orderId","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/settlements/{id}/lines":{"get":{"operationId":"listConnectSettlementLines","tags":["Connect settlements"],"summary":"支払記録の明細を取得する","description":"保存された明細を最大100件ずつ返します。明細の並びはID順です。取得時に再計算・状態変更は行いません。\n\n必要な権限（scope）: `connect:settlements:read`","x-required-scopes":["connect:settlements:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"}},"required":["id","name","quantity","unit","unitPrice","taxRate","isWithholdingTax"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/members":{"post":{"operationId":"createConnectMember","tags":["Connect members"],"summary":"外部会員を登録する","description":"同じサービスのexternalIdに対して1件だけ作ります。既定ではnameを使って未公開の名刺も作ります。createBusinessCard=falseなら名刺を作らず会員だけを登録でき、nameは省略できます。再送で既存の名刺を書き換えたり、退会済み会員を復活させたりしません。メールアドレスを自動転記しません。任意のpublicHandleを指定すると会員作成と同時に公開IDを取得します。競合は409 public_handle_taken、取得後の変更は409 public_handle_already_claimedです。\n\n必要な権限（scope）: `connect:members:write`","x-required-scopes":["connect:members:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9._:-]*$"},"name":{"type":"string","minLength":1,"maxLength":80,"description":"名刺を作る場合に必要な表示名"},"createBusinessCard":{"type":"boolean","description":"falseなら名刺を作らず会員だけを登録します。既定true"},"publicHandle":{"type":"string","minLength":3,"maxLength":30,"pattern":"^[a-z0-9][a-z0-9-]{1,28}[a-z0-9]$","description":"英小文字・数字・ハイフン。先頭と末尾は英数字。大文字は小文字に変換します"}},"required":["externalId"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"publicHandle":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]}},"required":["id","externalId","publicHandle","status"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"listConnectMembers","tags":["Connect members"],"summary":"このサービスに登録した外部会員を参照する","description":"必要な権限（scope）: `connect:members:read`","x-required-scopes":["connect:members:read"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","inactive"]}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"publicHandle":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]}},"required":["id","externalId","publicHandle","status"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/members/{externalId}/business-card":{"get":{"operationId":"getConnectCard","tags":["Connect cards"],"summary":"会員の名刺の下書き・公開状態を参照する","description":"必要な権限（scope）: `connect:cards:read`","x-required-scopes":["connect:cards:read"],"parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9._:-]*$"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","published","unpublished","archived"]},"name":{"type":"string","nullable":true,"description":"表示する氏名"},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"bio":{"type":"string","nullable":true,"description":"自己紹介"},"image":{"type":"string","nullable":true,"description":"顔写真のURL"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"},"type":{"type":"string","enum":["website","social","email","phone","other"]}},"required":["label","url","type"],"additionalProperties":false},"description":"公開するリンク（並び順どおり）"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"description":"名刺に表示する項目。テンプレートが付いているときはテンプレートの設定が優先されます"},"pageId":{"type":"string","description":"公開URLの末尾"},"publicUrl":{"type":"string","nullable":true,"description":"公開ページのURL。status が published のときだけ開けます"},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"version":{"type":"integer"},"publicHandle":{"type":"string","nullable":true}},"required":["id","status","name","jobTitle","department","email","phone","bio","image","links","visibleFields","pageId","publicUrl","publishedAt","createdAt","updatedAt","version","publicHandle"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateConnectCard","tags":["Connect cards"],"summary":"会員名刺の下書きを保存する","description":"公開には別の明示操作が必要です。発行元の表示・URL・持ち主は会員側から変更できません。\n\n必要な権限（scope）: `connect:cards:write`","x-required-scopes":["connect:cards:write"],"parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9._:-]*$"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":80,"nullable":true,"description":"表示する氏名。null ならメンバーの名前を使います"},"jobTitle":{"type":"string","maxLength":80,"nullable":true},"email":{"type":"string","format":"email","maxLength":320,"nullable":true},"phone":{"type":"string","maxLength":64,"nullable":true},"bio":{"type":"string","maxLength":5000,"nullable":true,"description":"自己紹介"},"image":{"type":"string","maxLength":2048,"nullable":true,"description":"顔写真のURL（https）"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","maxLength":2048},"type":{"type":"string","enum":["website","social","email","phone","other"],"description":"既定 website"}},"required":["label","url"],"additionalProperties":false},"maxItems":20,"description":"公開するリンク。送ると、今のリンクをすべてこの並びに置き換えます"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"minItems":1,"description":"名刺に表示する項目。name を含めないと公開できません"},"expectedVersion":{"type":"integer","minimum":1}},"required":["expectedVersion"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","published","unpublished","archived"]},"name":{"type":"string","nullable":true,"description":"表示する氏名"},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"bio":{"type":"string","nullable":true,"description":"自己紹介"},"image":{"type":"string","nullable":true,"description":"顔写真のURL"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"},"type":{"type":"string","enum":["website","social","email","phone","other"]}},"required":["label","url","type"],"additionalProperties":false},"description":"公開するリンク（並び順どおり）"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"description":"名刺に表示する項目。テンプレートが付いているときはテンプレートの設定が優先されます"},"pageId":{"type":"string","description":"公開URLの末尾"},"publicUrl":{"type":"string","nullable":true,"description":"公開ページのURL。status が published のときだけ開けます"},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"version":{"type":"integer"},"publicHandle":{"type":"string","nullable":true}},"required":["id","status","name","jobTitle","department","email","phone","bio","image","links","visibleFields","pageId","publicUrl","publishedAt","createdAt","updatedAt","version","publicHandle"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/members/{externalId}/public-handle":{"post":{"operationId":"claimConnectPublicHandle","tags":["Connect members"],"summary":"会員の公開URL用IDを取得する","description":"サービスごとに先着で取得します。英小文字・数字・ハイフンの3〜30文字。1会員1IDで、取得後の変更や退会後の再割り当てはできません。同じIDの再送は成功します。他の会員が取得済みなら409 public_handle_taken、取得後に別IDを指定したら409 public_handle_already_claimedを返します。IDの取得だけでは名刺は公開されません。\n\n必要な権限（scope）: `connect:members:write`","x-required-scopes":["connect:members:write"],"parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9._:-]*$"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"publicHandle":{"type":"string","minLength":3,"maxLength":30,"pattern":"^[a-z0-9][a-z0-9-]{1,28}[a-z0-9]$","description":"英小文字・数字・ハイフン。先頭と末尾は英数字。大文字は小文字に変換します"}},"required":["publicHandle"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"publicHandle":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]}},"required":["id","externalId","publicHandle","status"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/cards/{publicHandle}/public":{"get":{"operationId":"resolveConnectPublicCard","tags":["Connect cards"],"summary":"公開IDから公開中の名刺URLを参照する","description":"このサービスの有効な会員が公開中の名刺だけを返します。下書きや内部の会員IDは返しません。公開URLを取得した後も、閲覧時には公開状態を確認してください。\n\n必要な権限（scope）: `connect:cards:read`","x-required-scopes":["connect:cards:read"],"parameters":[{"name":"publicHandle","in":"path","required":true,"description":"英小文字・数字・ハイフン。先頭と末尾は英数字。大文字は小文字に変換します","schema":{"type":"string","minLength":3,"maxLength":30,"pattern":"^[a-z0-9][a-z0-9-]{1,28}[a-z0-9]$"}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"publicHandle":{"type":"string"},"pageId":{"type":"string"},"publicUrl":{"type":"string"}},"required":["publicHandle","pageId","publicUrl"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/members/{externalId}/business-card/publish":{"post":{"operationId":"publishConnectCard","tags":["Connect cards"],"summary":"本人が確認した版の名刺を公開する","description":"必要な権限（scope）: `connect:cards:publish`","x-required-scopes":["connect:cards:publish"],"parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9._:-]*$"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":1}},"required":["expectedVersion"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","published","unpublished","archived"]},"name":{"type":"string","nullable":true,"description":"表示する氏名"},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"bio":{"type":"string","nullable":true,"description":"自己紹介"},"image":{"type":"string","nullable":true,"description":"顔写真のURL"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"},"type":{"type":"string","enum":["website","social","email","phone","other"]}},"required":["label","url","type"],"additionalProperties":false},"description":"公開するリンク（並び順どおり）"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"description":"名刺に表示する項目。テンプレートが付いているときはテンプレートの設定が優先されます"},"pageId":{"type":"string","description":"公開URLの末尾"},"publicUrl":{"type":"string","nullable":true,"description":"公開ページのURL。status が published のときだけ開けます"},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"version":{"type":"integer"},"publicHandle":{"type":"string","nullable":true}},"required":["id","status","name","jobTitle","department","email","phone","bio","image","links","visibleFields","pageId","publicUrl","publishedAt","createdAt","updatedAt","version","publicHandle"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/members/{externalId}/business-card/unpublish":{"post":{"operationId":"unpublishConnectCard","tags":["Connect cards"],"summary":"名刺の公開を停止する","description":"必要な権限（scope）: `connect:cards:publish`","x-required-scopes":["connect:cards:publish"],"parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9._:-]*$"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":1}},"required":["expectedVersion"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","published","unpublished","archived"]},"name":{"type":"string","nullable":true,"description":"表示する氏名"},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"bio":{"type":"string","nullable":true,"description":"自己紹介"},"image":{"type":"string","nullable":true,"description":"顔写真のURL"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"},"type":{"type":"string","enum":["website","social","email","phone","other"]}},"required":["label","url","type"],"additionalProperties":false},"description":"公開するリンク（並び順どおり）"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"description":"名刺に表示する項目。テンプレートが付いているときはテンプレートの設定が優先されます"},"pageId":{"type":"string","description":"公開URLの末尾"},"publicUrl":{"type":"string","nullable":true,"description":"公開ページのURL。status が published のときだけ開けます"},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"version":{"type":"integer"},"publicHandle":{"type":"string","nullable":true}},"required":["id","status","name","jobTitle","department","email","phone","bio","image","links","visibleFields","pageId","publicUrl","publishedAt","createdAt","updatedAt","version","publicHandle"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/members/{externalId}/deactivate":{"post":{"operationId":"deactivateConnectMember","tags":["Connect members"],"summary":"外部会員の利用を停止する","description":"名刺の公開と事業アカウントの利用を停止し、この会員に対する以降の編集・公開・再登録を拒否します。事業アカウントのデータは削除しません。同じ通知を再送できます。\n\n必要な権限（scope）: `connect:members:write`","x-required-scopes":["connect:members:write"],"parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9._:-]*$"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"publicHandle":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]}},"required":["id","externalId","publicHandle","status"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/members/{externalId}/accounts":{"post":{"operationId":"createConnectAccount","tags":["Connect accounts"],"summary":"外部会員の事業アカウントを作る","description":"運営会社と分離された所有先を作ります。Tooonの社員・ログインユーザー・公開プロフィールは作りません。規約同意、契約締結、決済接続、名刺の作成や公開は行いません。本文のexternalIdはサービス内で一意です。同じ会員・externalId・nameの再送は同じアカウントを返し、他の内容は409 external_ref_conflictです。停止済みアカウントは再送で復活しません。\n\n必要な権限（scope）: `connect:accounts:write`","x-required-scopes":["connect:accounts:write"],"parameters":[{"name":"externalId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9._:-]*$"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9._:-]*$"},"name":{"type":"string","minLength":1,"maxLength":160,"description":"事業アカウントの表示名。契約・請求の法的名義の設定ではありません"}},"required":["externalId","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"memberExternalId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","inactive"]},"version":{"type":"integer","minimum":1},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","memberExternalId","name","status","version","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts":{"get":{"operationId":"listConnectAccounts","tags":["Connect accounts"],"summary":"このサービスの事業アカウントを一覧する","description":"必要な権限（scope）: `connect:accounts:read`","x-required-scopes":["connect:accounts:read"],"parameters":[{"name":"memberExternalId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9._:-]*$"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"memberExternalId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","inactive"]},"version":{"type":"integer","minimum":1},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","memberExternalId","name","status","version","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{id}":{"get":{"operationId":"getConnectAccount","tags":["Connect accounts"],"summary":"事業アカウントの状態を取得する","description":"停止したアカウントの状態も確認できます。activeはこのアカウントの有効状態で、決済や契約の本人確認が完了したことを意味しません。内部の所有先IDや運営会社の事業者情報は返しません。\n\n必要な権限（scope）: `connect:accounts:read`","x-required-scopes":["connect:accounts:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"memberExternalId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","inactive"]},"version":{"type":"integer","minimum":1},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","memberExternalId","name","status","version","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateConnectAccount","tags":["Connect accounts"],"summary":"事業アカウントの表示名を変更する","description":"expectedVersionには取得したversionを指定します。古い版は409 version_conflictです。所有者・サービス・externalId・契約や請求の法的名義は変更しません。\n\n必要な権限（scope）: `connect:accounts:write`","x-required-scopes":["connect:accounts:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":1},"name":{"type":"string","minLength":1,"maxLength":160,"description":"事業アカウントの表示名。契約・請求の法的名義の設定ではありません"}},"required":["expectedVersion","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"memberExternalId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","inactive"]},"version":{"type":"integer","minimum":1},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","memberExternalId","name","status","version","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{id}/disable":{"post":{"operationId":"disableConnectAccount","tags":["Connect accounts"],"summary":"事業アカウントの利用を停止する","description":"expectedVersionを確認して停止します。古い版は409 version_conflictです。停止の再送は同じ状態を返します。データは削除せず、このAPIから再開・所有者変更はできません。\n\n必要な権限（scope）: `connect:accounts:write`","x-required-scopes":["connect:accounts:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedVersion":{"type":"integer","minimum":1}},"required":["expectedVersion"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"memberExternalId":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["active","inactive"]},"version":{"type":"integer","minimum":1},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalId","memberExternalId","name","status","version","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/partner-invoice-requests":{"get":{"operationId":"listConnectInvoiceRequests","tags":["Connect invoice requests"],"summary":"会員事業の請求書作成依頼を一覧する","description":"必要な権限（scope）: `connect:invoice_requests:read`","x-required-scopes":["connect:invoice_requests:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"partnerOrderId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"partnerId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"billingDate":{"type":"string","format":"date-time","nullable":true},"paymentDeadline":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"sentAt":{"type":"string","format":"date-time","nullable":true},"submittedAt":{"type":"string","format":"date-time","nullable":true},"approvedAt":{"type":"string","format":"date-time","nullable":true},"paidAt":{"type":"string","format":"date-time","nullable":true},"canceledAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","status","externalRef","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","taxRoundingMethod","billingDate","paymentDeadline","expiresAt","sentAt","submittedAt","approvedAt","paidAt","canceledAt","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createConnectInvoiceRequest","tags":["Connect invoice requests"],"summary":"会員事業の請求書作成依頼を下書きする","description":"同じ事業の発注に下書きを作ります。明細から請求額を計算します。externalRefは事業内で一意で、現在の下書きと同じ内容だけ再利用できます。送付・提出・承認・支払い・公開リンクの発行は行いません。\n\n必要な権限（scope）: `connect:invoice_requests:write`","x-required-scopes":["connect:invoice_requests:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"buyerMessage":{"type":"string","maxLength":4000,"nullable":true},"billingDate":{"type":"string","format":"date","nullable":true},"paymentDeadline":{"type":"string","format":"date","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"invoiceNumber":{"type":"string","maxLength":200,"nullable":true},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"quantity":{"type":"number","minimum":0,"maximum":1000000},"unit":{"type":"string","maxLength":20,"nullable":true},"unitPrice":{"type":"integer","minimum":1,"maximum":2147483647},"taxRate":{"type":"integer","minimum":0,"maximum":100},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer","minimum":0,"maximum":1000}},"required":["name","quantity","unitPrice","taxRate"],"additionalProperties":false},"minItems":1,"maxItems":100},"partnerOrderId":{"type":"string","minLength":1,"maxLength":100},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["lines","partnerOrderId"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"buyerMessage":{"type":"string","nullable":true},"billingDate":{"type":"string","format":"date-time","nullable":true},"paymentDeadline":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"invoiceNumber":{"type":"string","nullable":true},"sentAt":{"type":"string","format":"date-time","nullable":true},"submittedAt":{"type":"string","format":"date-time","nullable":true},"approvedAt":{"type":"string","format":"date-time","nullable":true},"paidAt":{"type":"string","format":"date-time","nullable":true},"canceledAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}}},"required":["id","status","externalRef","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","taxRoundingMethod","buyerMessage","billingDate","paymentDeadline","expiresAt","invoiceNumber","sentAt","submittedAt","approvedAt","paidAt","canceledAt","createdAt","updatedAt","lines"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/partner-invoice-requests/{id}":{"get":{"operationId":"getConnectInvoiceRequest","tags":["Connect invoice requests"],"summary":"会員事業の請求書作成依頼を取得する","description":"必要な権限（scope）: `connect:invoice_requests:read`","x-required-scopes":["connect:invoice_requests:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"buyerMessage":{"type":"string","nullable":true},"billingDate":{"type":"string","format":"date-time","nullable":true},"paymentDeadline":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"invoiceNumber":{"type":"string","nullable":true},"sentAt":{"type":"string","format":"date-time","nullable":true},"submittedAt":{"type":"string","format":"date-time","nullable":true},"approvedAt":{"type":"string","format":"date-time","nullable":true},"paidAt":{"type":"string","format":"date-time","nullable":true},"canceledAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}}},"required":["id","status","externalRef","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","taxRoundingMethod","buyerMessage","billingDate","paymentDeadline","expiresAt","invoiceNumber","sentAt","submittedAt","approvedAt","paidAt","canceledAt","createdAt","updatedAt","lines"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateConnectInvoiceRequest","tags":["Connect invoice requests"],"summary":"会員事業の請求書作成依頼の下書きを編集する","description":"DRAFTのみ編集できます。expectedUpdatedAtに直前のGETの値を指定します。省略した項目は保持し、任意項目はnullで消せます。linesを送ると全明細を置き換えます。送付・提出・承認・支払い・取消は行いません。\n\n必要な権限（scope）: `connect:invoice_requests:write`","x-required-scopes":["connect:invoice_requests:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"buyerMessage":{"type":"string","maxLength":4000,"nullable":true},"billingDate":{"type":"string","format":"date","nullable":true},"paymentDeadline":{"type":"string","format":"date","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"invoiceNumber":{"type":"string","maxLength":200,"nullable":true},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"quantity":{"type":"number","minimum":0,"maximum":1000000},"unit":{"type":"string","maxLength":20,"nullable":true},"unitPrice":{"type":"integer","minimum":1,"maximum":2147483647},"taxRate":{"type":"integer","minimum":0,"maximum":100},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer","minimum":0,"maximum":1000}},"required":["name","quantity","unitPrice","taxRate"],"additionalProperties":false},"minItems":1,"maxItems":100},"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"buyerMessage":{"type":"string","nullable":true},"billingDate":{"type":"string","format":"date-time","nullable":true},"paymentDeadline":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"invoiceNumber":{"type":"string","nullable":true},"sentAt":{"type":"string","format":"date-time","nullable":true},"submittedAt":{"type":"string","format":"date-time","nullable":true},"approvedAt":{"type":"string","format":"date-time","nullable":true},"paidAt":{"type":"string","format":"date-time","nullable":true},"canceledAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}}},"required":["id","status","externalRef","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","taxRoundingMethod","buyerMessage","billingDate","paymentDeadline","expiresAt","invoiceNumber","sentAt","submittedAt","approvedAt","paidAt","canceledAt","createdAt","updatedAt","lines"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/partners":{"get":{"operationId":"listConnectPartners","tags":["Connect partners"],"summary":"会員事業のパートナーを検索する","description":"会員自身の発注先・委託先を返します。銀行情報等を含む非公開の業務情報です。発注や契約の一覧はpartner-ordersで取得してください。\n\n必要な権限（scope）: `connect:partners:read`","x-required-scopes":["connect:partners:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"email","in":"query","required":false,"schema":{"type":"string","format":"email","maxLength":320}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","inactive"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"taxRegistrationNumber":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","name","companyName","contactName","email","phoneNumber","address","taxRegistrationNumber","bankAccount","status","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createConnectPartner","tags":["Connect partners"],"summary":"会員事業のパートナーを登録する","description":"名前だけで登録できます。externalRefはこの事業内で一意。同じ入力の再送は同じ相手を返し、異なる内容は409です。社員・ログイン・招待・通知・契約は作りません。\n\n必要な権限（scope）: `connect:partners:write`","x-required-scopes":["connect:partners:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"companyName":{"type":"string","maxLength":200,"nullable":true},"contactName":{"type":"string","maxLength":200,"nullable":true},"email":{"type":"string","format":"email","maxLength":320,"nullable":true},"phoneNumber":{"type":"string","maxLength":50,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true},"taxRegistrationNumber":{"type":"string","maxLength":50,"nullable":true},"bankAccount":{"type":"string","maxLength":500,"nullable":true},"status":{"type":"string","enum":["active","inactive"]},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"taxRegistrationNumber":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","name","companyName","contactName","email","phoneNumber","address","taxRegistrationNumber","bankAccount","status","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/partners/{id}":{"get":{"operationId":"getConnectPartner","tags":["Connect partners"],"summary":"会員事業のパートナーを取得する","description":"必要な権限（scope）: `connect:partners:read`","x-required-scopes":["connect:partners:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"taxRegistrationNumber":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","name","companyName","contactName","email","phoneNumber","address","taxRegistrationNumber","bankAccount","status","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateConnectPartner","tags":["Connect partners"],"summary":"会員事業のパートナーを変更する","description":"expectedUpdatedAtに直前のGETの値を指定します。省略項目は保持し、nullは任意項目を消します。externalRef・所属先・ログインとの対応は変更できません。停止しても履歴は消えません。\n\n必要な権限（scope）: `connect:partners:write`","x-required-scopes":["connect:partners:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"companyName":{"type":"string","maxLength":200,"nullable":true},"contactName":{"type":"string","maxLength":200,"nullable":true},"email":{"type":"string","format":"email","maxLength":320,"nullable":true},"phoneNumber":{"type":"string","maxLength":50,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true},"taxRegistrationNumber":{"type":"string","maxLength":50,"nullable":true},"bankAccount":{"type":"string","maxLength":500,"nullable":true},"status":{"type":"string","enum":["active","inactive"]},"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"taxRegistrationNumber":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","name","companyName","contactName","email","phoneNumber","address","taxRegistrationNumber","bankAccount","status","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/partner-orders":{"get":{"operationId":"listConnectPartnerOrders","tags":["Connect partner orders"],"summary":"会員事業の発注条件を検索する","description":"概要だけを最大100件返します。契約本文と条件は詳細で取得します。statusは発注条件レコードの状態で、相手の契約同意を表しません。\n\n必要な権限（scope）: `connect:partner_orders:read`","x-required-scopes":["connect:partner_orders:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"partnerId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","active","completed","canceled"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string","enum":["draft","active","completed","canceled"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","partnerId","title","amount","currency","status","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createConnectPartnerOrder","tags":["Connect partner orders"],"summary":"会員事業の発注条件を下書きする","description":"同じ事業の有効なpartnerId・title・amountで下書きを作成します。externalRefは事業内で一意、同じ入力だけ再利用できます。契約締結・外部送信・実発注・支払い・公開は行いません。\n\n必要な権限（scope）: `connect:partner_orders:write`","x-required-scopes":["connect:partner_orders:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"amount":{"type":"integer","minimum":1,"maximum":2147483647},"role":{"type":"string","maxLength":1000,"nullable":true},"scope":{"type":"string","maxLength":10000,"nullable":true},"contractTerms":{"type":"string","maxLength":10000,"nullable":true},"isIncludingTax":{"type":"boolean"},"startDate":{"type":"string","format":"date-time","nullable":true},"endDate":{"type":"string","format":"date-time","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"partnerId":{"type":"string","minLength":1,"maxLength":100},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["title","amount","partnerId"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string","enum":["draft","active","completed","canceled"]},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"contractTerms":{"type":"string","nullable":true},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","partnerId","title","amount","currency","status","role","scope","contractTerms","isIncludingTax","taxRoundingMethod","startDate","endDate","subcontractingPolicy","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/partner-orders/{id}":{"get":{"operationId":"getConnectPartnerOrder","tags":["Connect partner orders"],"summary":"会員事業の発注条件を取得する","description":"必要な権限（scope）: `connect:partner_orders:read`","x-required-scopes":["connect:partner_orders:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string","enum":["draft","active","completed","canceled"]},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"contractTerms":{"type":"string","nullable":true},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","partnerId","title","amount","currency","status","role","scope","contractTerms","isIncludingTax","taxRoundingMethod","startDate","endDate","subcontractingPolicy","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateConnectPartnerOrder","tags":["Connect partner orders"],"summary":"会員事業の発注条件の下書きを変更する","description":"expectedUpdatedAtが一致する未接続の下書きだけを変更します。案件・受注・予算・合意・請求依頼に接続した条件はこの操作で編集できません。partnerId、所有先、状態は変更できません。\n\n必要な権限（scope）: `connect:partner_orders:write`","x-required-scopes":["connect:partner_orders:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"amount":{"type":"integer","minimum":1,"maximum":2147483647},"role":{"type":"string","maxLength":1000,"nullable":true},"scope":{"type":"string","maxLength":10000,"nullable":true},"contractTerms":{"type":"string","maxLength":10000,"nullable":true},"isIncludingTax":{"type":"boolean"},"startDate":{"type":"string","format":"date-time","nullable":true},"endDate":{"type":"string","format":"date-time","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"title":{"type":"string"},"amount":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string","enum":["draft","active","completed","canceled"]},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"contractTerms":{"type":"string","nullable":true},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","partnerId","title","amount","currency","status","role","scope","contractTerms","isIncludingTax","taxRoundingMethod","startDate","endDate","subcontractingPolicy","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/clients":{"get":{"operationId":"listClients","tags":["Clients"],"summary":"取引先の一覧・検索","description":"この事業の取引先だけを返します。統合済みの記録は一覧から除きます。連絡先・住所・振込先メモ・内部メモを含むため、権限を持つサーバーで扱ってください。メール送信や招待は行いません。\n\n必要な権限（scope）: `clients:read`","x-required-scopes":["clients:read"],"parameters":[{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"email","in":"query","required":false,"schema":{"type":"string","format":"email","maxLength":320}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","inactive","pending"]}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":160}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true},"comment":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive","pending"]},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"mergedIntoClientId":{"type":"string","nullable":true},"mergedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["name","companyName","contactPerson","department","postalCode","address","buildingName","phoneNumber","email","bankAccount","comment","status","id","externalRef","mergedIntoClientId","mergedAt","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createClient","tags":["Clients"],"summary":"取引先を登録する","description":"名前だけで登録できます。externalRefを指定すると事業内で一意になり、同じ内容の再送は既存の取引先を返します。異なる内容や統合済みは409 external_ref_conflictです。externalRefを省略する場合も再試行には同じIdempotency-Keyを使ってください。ログインユーザー・招待・メール・決済顧客は作りません。\n\n必要な権限（scope）: `clients:write`","x-required-scopes":["clients:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"companyName":{"type":"string","maxLength":160,"nullable":true},"contactPerson":{"type":"string","maxLength":160,"nullable":true},"department":{"type":"string","maxLength":160,"nullable":true},"postalCode":{"type":"string","maxLength":30,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true},"buildingName":{"type":"string","maxLength":160,"nullable":true},"phoneNumber":{"type":"string","maxLength":80,"nullable":true},"email":{"type":"string","format":"email","maxLength":320,"nullable":true},"bankAccount":{"type":"string","maxLength":1000,"nullable":true},"comment":{"type":"string","maxLength":5000,"nullable":true},"status":{"type":"string","enum":["active","inactive","pending"]},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true},"comment":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive","pending"]},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"mergedIntoClientId":{"type":"string","nullable":true},"mergedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["name","companyName","contactPerson","department","postalCode","address","buildingName","phoneNumber","email","bankAccount","comment","status","id","externalRef","mergedIntoClientId","mergedAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/clients/{id}":{"get":{"operationId":"getClient","tags":["Clients"],"summary":"取引先の詳細を取得する","description":"必要な権限（scope）: `clients:read`","x-required-scopes":["clients:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true},"comment":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive","pending"]},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"mergedIntoClientId":{"type":"string","nullable":true},"mergedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["name","companyName","contactPerson","department","postalCode","address","buildingName","phoneNumber","email","bankAccount","comment","status","id","externalRef","mergedIntoClientId","mergedAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateClient","tags":["Clients"],"summary":"取引先の情報・状態を変更する","description":"expectedUpdatedAtに直前のupdatedAtを指定します。古い値は409 version_conflict、統合済みは409 invalid_statusです。省略した項目は保持し、nullで任意項目を消せます。externalRef・所有者・ログインユーザーは変更できません。inactiveへの変更はデータを削除しません。\n\n必要な権限（scope）: `clients:write`","x-required-scopes":["clients:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"companyName":{"type":"string","maxLength":160,"nullable":true},"contactPerson":{"type":"string","maxLength":160,"nullable":true},"department":{"type":"string","maxLength":160,"nullable":true},"postalCode":{"type":"string","maxLength":30,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true},"buildingName":{"type":"string","maxLength":160,"nullable":true},"phoneNumber":{"type":"string","maxLength":80,"nullable":true},"email":{"type":"string","format":"email","maxLength":320,"nullable":true},"bankAccount":{"type":"string","maxLength":1000,"nullable":true},"comment":{"type":"string","maxLength":5000,"nullable":true},"status":{"type":"string","enum":["active","inactive","pending"]},"expectedUpdatedAt":{"type":"string","format":"date-time","description":"直前のGETで取得したupdatedAt。Tooon画面からの変更も競合として検出します"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true},"comment":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive","pending"]},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"mergedIntoClientId":{"type":"string","nullable":true},"mergedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["name","companyName","contactPerson","department","postalCode","address","buildingName","phoneNumber","email","bankAccount","comment","status","id","externalRef","mergedIntoClientId","mergedAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/clients":{"get":{"operationId":"listConnectClients","tags":["Connect clients"],"summary":"取引先の一覧・検索","description":"この事業の取引先だけを返します。統合済みの記録は一覧から除きます。連絡先・住所・振込先メモ・内部メモを含むため、権限を持つサーバーで扱ってください。メール送信や招待は行いません。\n\n必要な権限（scope）: `connect:clients:read`","x-required-scopes":["connect:clients:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"email","in":"query","required":false,"schema":{"type":"string","format":"email","maxLength":320}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","inactive","pending"]}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":160}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true},"comment":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive","pending"]},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"mergedIntoClientId":{"type":"string","nullable":true},"mergedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["name","companyName","contactPerson","department","postalCode","address","buildingName","phoneNumber","email","bankAccount","comment","status","id","externalRef","mergedIntoClientId","mergedAt","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createConnectClient","tags":["Connect clients"],"summary":"取引先を登録する","description":"名前だけで登録できます。externalRefを指定すると事業内で一意になり、同じ内容の再送は既存の取引先を返します。異なる内容や統合済みは409 external_ref_conflictです。externalRefを省略する場合も再試行には同じIdempotency-Keyを使ってください。ログインユーザー・招待・メール・決済顧客は作りません。\n\n必要な権限（scope）: `connect:clients:write`","x-required-scopes":["connect:clients:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"companyName":{"type":"string","maxLength":160,"nullable":true},"contactPerson":{"type":"string","maxLength":160,"nullable":true},"department":{"type":"string","maxLength":160,"nullable":true},"postalCode":{"type":"string","maxLength":30,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true},"buildingName":{"type":"string","maxLength":160,"nullable":true},"phoneNumber":{"type":"string","maxLength":80,"nullable":true},"email":{"type":"string","format":"email","maxLength":320,"nullable":true},"bankAccount":{"type":"string","maxLength":1000,"nullable":true},"comment":{"type":"string","maxLength":5000,"nullable":true},"status":{"type":"string","enum":["active","inactive","pending"]},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true},"comment":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive","pending"]},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"mergedIntoClientId":{"type":"string","nullable":true},"mergedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["name","companyName","contactPerson","department","postalCode","address","buildingName","phoneNumber","email","bankAccount","comment","status","id","externalRef","mergedIntoClientId","mergedAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/clients/{id}":{"get":{"operationId":"getConnectClient","tags":["Connect clients"],"summary":"取引先の詳細を取得する","description":"必要な権限（scope）: `connect:clients:read`","x-required-scopes":["connect:clients:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true},"comment":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive","pending"]},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"mergedIntoClientId":{"type":"string","nullable":true},"mergedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["name","companyName","contactPerson","department","postalCode","address","buildingName","phoneNumber","email","bankAccount","comment","status","id","externalRef","mergedIntoClientId","mergedAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateConnectClient","tags":["Connect clients"],"summary":"取引先の情報・状態を変更する","description":"expectedUpdatedAtに直前のupdatedAtを指定します。古い値は409 version_conflict、統合済みは409 invalid_statusです。省略した項目は保持し、nullで任意項目を消せます。externalRef・所有者・ログインユーザーは変更できません。inactiveへの変更はデータを削除しません。\n\n必要な権限（scope）: `connect:clients:write`","x-required-scopes":["connect:clients:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"companyName":{"type":"string","maxLength":160,"nullable":true},"contactPerson":{"type":"string","maxLength":160,"nullable":true},"department":{"type":"string","maxLength":160,"nullable":true},"postalCode":{"type":"string","maxLength":30,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true},"buildingName":{"type":"string","maxLength":160,"nullable":true},"phoneNumber":{"type":"string","maxLength":80,"nullable":true},"email":{"type":"string","format":"email","maxLength":320,"nullable":true},"bankAccount":{"type":"string","maxLength":1000,"nullable":true},"comment":{"type":"string","maxLength":5000,"nullable":true},"status":{"type":"string","enum":["active","inactive","pending"]},"expectedUpdatedAt":{"type":"string","format":"date-time","description":"直前のGETで取得したupdatedAt。Tooon画面からの変更も競合として検出します"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactPerson":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true},"comment":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive","pending"]},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"mergedIntoClientId":{"type":"string","nullable":true},"mergedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["name","companyName","contactPerson","department","postalCode","address","buildingName","phoneNumber","email","bankAccount","comment","status","id","externalRef","mergedIntoClientId","mergedAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/projects":{"get":{"operationId":"listProjects","tags":["Projects"],"summary":"プロジェクトを一覧・検索する","description":"この事業の参照できるプロジェクトだけを返します。非公開ユニットはキー発行者の所属制限を保持します。削除済みは含みません。\n\n必要な権限（scope）: `projects:read`","x-required-scopes":["projects:read"],"parameters":[{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":50}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]}},{"name":"parentProjectId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string","nullable":true},"startDatetime":{"type":"string","format":"date-time","nullable":true},"endDatetime":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]},"parentProjectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"isArchived":{"type":"boolean"},"hierarchyDepth":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["title","summary","startDatetime","endDatetime","status","parentProjectId","id","externalRef","isArchived","hierarchyDepth","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createProject","tags":["Projects"],"summary":"プロジェクトを作る","description":"titleだけで作成できます。externalRefは事業内で一意。同じ入力の再送は同じ記録、異なる入力は409 external_ref_conflictです。親を指定すると既存の階層・ユニットを引き継ぎます。公開・招待・受発注は行いません。\n\n必要な権限（scope）: `projects:write`","x-required-scopes":["projects:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":50},"summary":{"type":"string","maxLength":200,"nullable":true},"startDatetime":{"type":"string","format":"date-time","nullable":true},"endDatetime":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]},"parentProjectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["title"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string","nullable":true},"startDatetime":{"type":"string","format":"date-time","nullable":true},"endDatetime":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]},"parentProjectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"isArchived":{"type":"boolean"},"hierarchyDepth":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["title","summary","startDatetime","endDatetime","status","parentProjectId","id","externalRef","isArchived","hierarchyDepth","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/projects/{id}":{"get":{"operationId":"getProject","tags":["Projects"],"summary":"プロジェクトを取得する","description":"必要な権限（scope）: `projects:read`","x-required-scopes":["projects:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string","nullable":true},"startDatetime":{"type":"string","format":"date-time","nullable":true},"endDatetime":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]},"parentProjectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"isArchived":{"type":"boolean"},"hierarchyDepth":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["title","summary","startDatetime","endDatetime","status","parentProjectId","id","externalRef","isArchived","hierarchyDepth","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateProject","tags":["Projects"],"summary":"プロジェクトの内容・状態・親を変更する","description":"expectedUpdatedAtに直前のupdatedAtを指定します。古い版は409 version_conflict。archivedで保留、not_started等で再開できます。有効な子がある親の保留・深さを超える親子関係は拒否します。公開・削除・担当者・予算は変更しません。\n\n必要な権限（scope）: `projects:write`","x-required-scopes":["projects:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":50},"summary":{"type":"string","maxLength":200,"nullable":true},"startDatetime":{"type":"string","format":"date-time","nullable":true},"endDatetime":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]},"parentProjectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string","nullable":true},"startDatetime":{"type":"string","format":"date-time","nullable":true},"endDatetime":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]},"parentProjectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"isArchived":{"type":"boolean"},"hierarchyDepth":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["title","summary","startDatetime","endDatetime","status","parentProjectId","id","externalRef","isArchived","hierarchyDepth","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/projects":{"get":{"operationId":"listConnectProjects","tags":["Connect projects"],"summary":"プロジェクトを一覧・検索する","description":"この事業の参照できるプロジェクトだけを返します。非公開ユニットはキー発行者の所属制限を保持します。削除済みは含みません。\n\n必要な権限（scope）: `connect:projects:read`","x-required-scopes":["connect:projects:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":50}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]}},{"name":"parentProjectId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string","nullable":true},"startDatetime":{"type":"string","format":"date-time","nullable":true},"endDatetime":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]},"parentProjectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"isArchived":{"type":"boolean"},"hierarchyDepth":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["title","summary","startDatetime","endDatetime","status","parentProjectId","id","externalRef","isArchived","hierarchyDepth","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createConnectProject","tags":["Connect projects"],"summary":"プロジェクトを作る","description":"titleだけで作成できます。externalRefは事業内で一意。同じ入力の再送は同じ記録、異なる入力は409 external_ref_conflictです。親を指定すると既存の階層・ユニットを引き継ぎます。公開・招待・受発注は行いません。\n\n必要な権限（scope）: `connect:projects:write`","x-required-scopes":["connect:projects:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":50},"summary":{"type":"string","maxLength":200,"nullable":true},"startDatetime":{"type":"string","format":"date-time","nullable":true},"endDatetime":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]},"parentProjectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["title"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string","nullable":true},"startDatetime":{"type":"string","format":"date-time","nullable":true},"endDatetime":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]},"parentProjectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"isArchived":{"type":"boolean"},"hierarchyDepth":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["title","summary","startDatetime","endDatetime","status","parentProjectId","id","externalRef","isArchived","hierarchyDepth","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/projects/{id}":{"get":{"operationId":"getConnectProject","tags":["Connect projects"],"summary":"プロジェクトを取得する","description":"必要な権限（scope）: `connect:projects:read`","x-required-scopes":["connect:projects:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string","nullable":true},"startDatetime":{"type":"string","format":"date-time","nullable":true},"endDatetime":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]},"parentProjectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"isArchived":{"type":"boolean"},"hierarchyDepth":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["title","summary","startDatetime","endDatetime","status","parentProjectId","id","externalRef","isArchived","hierarchyDepth","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateConnectProject","tags":["Connect projects"],"summary":"プロジェクトの内容・状態・親を変更する","description":"expectedUpdatedAtに直前のupdatedAtを指定します。古い版は409 version_conflict。archivedで保留、not_started等で再開できます。有効な子がある親の保留・深さを超える親子関係は拒否します。公開・削除・担当者・予算は変更しません。\n\n必要な権限（scope）: `connect:projects:write`","x-required-scopes":["connect:projects:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":50},"summary":{"type":"string","maxLength":200,"nullable":true},"startDatetime":{"type":"string","format":"date-time","nullable":true},"endDatetime":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]},"parentProjectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string","nullable":true},"startDatetime":{"type":"string","format":"date-time","nullable":true},"endDatetime":{"type":"string","format":"date-time","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","archived"]},"parentProjectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"isArchived":{"type":"boolean"},"hierarchyDepth":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["title","summary","startDatetime","endDatetime","status","parentProjectId","id","externalRef","isArchived","hierarchyDepth","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/tasks/assignees":{"get":{"operationId":"listTaskAssignees","tags":["Tasks"],"summary":"タスクの担当候補を取得する","description":"運営会社は有効な所属ユーザー、会員事業はその事業主本人を返します。メールアドレスは返しません。実際の割当時にはタスクのユニットへのアクセスも確認します。\n\n必要な権限（scope）: `tasks:read`","x-required-scopes":["tasks:read"],"parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["user","account_owner"]},"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"required":["kind","id","name"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/tasks":{"get":{"operationId":"listTasks","tags":["Tasks"],"summary":"タスクを一覧・検索する","description":"必要な権限（scope）: `tasks:read`","x-required-scopes":["tasks:read"],"parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"descriptionText":{"type":"string","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]},"priority":{"type":"string","enum":["low","middle","high"],"nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"assignee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"user"},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"account_owner"}},"required":["kind"],"additionalProperties":false}],"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"statusVersion":{"type":"integer","minimum":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time","nullable":true}},"required":["name","descriptionText","status","priority","dueDate","projectId","assignee","id","externalRef","statusVersion","createdAt","updatedAt","completedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createTask","tags":["Tasks"],"summary":"タスクを作る","description":"nameだけで作成できます。externalRefは事業内で一意。運営会社の担当はuser、会員事業の担当はaccount_ownerまたはnull。会員をTooonユーザーとして作りません。公開やメールは行いません。\n\n必要な権限（scope）: `tasks:write`","x-required-scopes":["tasks:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"descriptionText":{"type":"string","maxLength":10000,"nullable":true,"description":"説明のプレーンテキスト。指定すると書式付き説明全体を置き換えます"},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]},"priority":{"type":"string","enum":["low","middle","high"],"nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"assignee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"user"},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"account_owner"}},"required":["kind"],"additionalProperties":false}],"nullable":true},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"descriptionText":{"type":"string","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]},"priority":{"type":"string","enum":["low","middle","high"],"nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"assignee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"user"},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"account_owner"}},"required":["kind"],"additionalProperties":false}],"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"statusVersion":{"type":"integer","minimum":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time","nullable":true}},"required":["name","descriptionText","status","priority","dueDate","projectId","assignee","id","externalRef","statusVersion","createdAt","updatedAt","completedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/tasks/{id}":{"get":{"operationId":"getTask","tags":["Tasks"],"summary":"タスクを取得する","description":"必要な権限（scope）: `tasks:read`","x-required-scopes":["tasks:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"descriptionText":{"type":"string","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]},"priority":{"type":"string","enum":["low","middle","high"],"nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"assignee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"user"},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"account_owner"}},"required":["kind"],"additionalProperties":false}],"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"statusVersion":{"type":"integer","minimum":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time","nullable":true}},"required":["name","descriptionText","status","priority","dueDate","projectId","assignee","id","externalRef","statusVersion","createdAt","updatedAt","completedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateTask","tags":["Tasks"],"summary":"タスクの内容・担当・期日・状態を変更する","description":"expectedUpdatedAtは直前のGETの値。古い版は409。完了・再開・中止は既存の状態遷移と自動化の制限を守ります。projectIdは指定・nullで解除可能。請求・相談・前払いに接続したタスクの案件変更は拒否します。\n\n必要な権限（scope）: `tasks:write`","x-required-scopes":["tasks:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"descriptionText":{"type":"string","maxLength":10000,"nullable":true,"description":"説明のプレーンテキスト。指定すると書式付き説明全体を置き換えます"},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]},"priority":{"type":"string","enum":["low","middle","high"],"nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"assignee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"user"},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"account_owner"}},"required":["kind"],"additionalProperties":false}],"nullable":true},"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"descriptionText":{"type":"string","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]},"priority":{"type":"string","enum":["low","middle","high"],"nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"assignee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"user"},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"account_owner"}},"required":["kind"],"additionalProperties":false}],"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"statusVersion":{"type":"integer","minimum":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time","nullable":true}},"required":["name","descriptionText","status","priority","dueDate","projectId","assignee","id","externalRef","statusVersion","createdAt","updatedAt","completedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/tasks/assignees":{"get":{"operationId":"listConnectTaskAssignees","tags":["Connect tasks"],"summary":"タスクの担当候補を取得する","description":"運営会社は有効な所属ユーザー、会員事業はその事業主本人を返します。メールアドレスは返しません。実際の割当時にはタスクのユニットへのアクセスも確認します。\n\n必要な権限（scope）: `connect:tasks:read`","x-required-scopes":["connect:tasks:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["user","account_owner"]},"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"required":["kind","id","name"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/tasks":{"get":{"operationId":"listConnectTasks","tags":["Connect tasks"],"summary":"タスクを一覧・検索する","description":"必要な権限（scope）: `connect:tasks:read`","x-required-scopes":["connect:tasks:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"query","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"descriptionText":{"type":"string","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]},"priority":{"type":"string","enum":["low","middle","high"],"nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"assignee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"user"},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"account_owner"}},"required":["kind"],"additionalProperties":false}],"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"statusVersion":{"type":"integer","minimum":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time","nullable":true}},"required":["name","descriptionText","status","priority","dueDate","projectId","assignee","id","externalRef","statusVersion","createdAt","updatedAt","completedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createConnectTask","tags":["Connect tasks"],"summary":"タスクを作る","description":"nameだけで作成できます。externalRefは事業内で一意。運営会社の担当はuser、会員事業の担当はaccount_ownerまたはnull。会員をTooonユーザーとして作りません。公開やメールは行いません。\n\n必要な権限（scope）: `connect:tasks:write`","x-required-scopes":["connect:tasks:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"descriptionText":{"type":"string","maxLength":10000,"nullable":true,"description":"説明のプレーンテキスト。指定すると書式付き説明全体を置き換えます"},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]},"priority":{"type":"string","enum":["low","middle","high"],"nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"assignee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"user"},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"account_owner"}},"required":["kind"],"additionalProperties":false}],"nullable":true},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"descriptionText":{"type":"string","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]},"priority":{"type":"string","enum":["low","middle","high"],"nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"assignee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"user"},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"account_owner"}},"required":["kind"],"additionalProperties":false}],"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"statusVersion":{"type":"integer","minimum":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time","nullable":true}},"required":["name","descriptionText","status","priority","dueDate","projectId","assignee","id","externalRef","statusVersion","createdAt","updatedAt","completedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/tasks/{id}":{"get":{"operationId":"getConnectTask","tags":["Connect tasks"],"summary":"タスクを取得する","description":"必要な権限（scope）: `connect:tasks:read`","x-required-scopes":["connect:tasks:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"descriptionText":{"type":"string","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]},"priority":{"type":"string","enum":["low","middle","high"],"nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"assignee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"user"},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"account_owner"}},"required":["kind"],"additionalProperties":false}],"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"statusVersion":{"type":"integer","minimum":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time","nullable":true}},"required":["name","descriptionText","status","priority","dueDate","projectId","assignee","id","externalRef","statusVersion","createdAt","updatedAt","completedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateConnectTask","tags":["Connect tasks"],"summary":"タスクの内容・担当・期日・状態を変更する","description":"expectedUpdatedAtは直前のGETの値。古い版は409。完了・再開・中止は既存の状態遷移と自動化の制限を守ります。projectIdは指定・nullで解除可能。請求・相談・前払いに接続したタスクの案件変更は拒否します。\n\n必要な権限（scope）: `connect:tasks:write`","x-required-scopes":["connect:tasks:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"descriptionText":{"type":"string","maxLength":10000,"nullable":true,"description":"説明のプレーンテキスト。指定すると書式付き説明全体を置き換えます"},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]},"priority":{"type":"string","enum":["low","middle","high"],"nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"assignee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"user"},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"account_owner"}},"required":["kind"],"additionalProperties":false}],"nullable":true},"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"descriptionText":{"type":"string","nullable":true},"status":{"type":"string","enum":["backlog","not_started","in_progress","completed","canceled"]},"priority":{"type":"string","enum":["low","middle","high"],"nullable":true},"dueDate":{"type":"string","format":"date-time","nullable":true},"projectId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"assignee":{"anyOf":[{"type":"object","properties":{"kind":{"const":"user"},"id":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","id"],"additionalProperties":false},{"type":"object","properties":{"kind":{"const":"account_owner"}},"required":["kind"],"additionalProperties":false}],"nullable":true},"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"statusVersion":{"type":"integer","minimum":1},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time","nullable":true}},"required":["name","descriptionText","status","priority","dueDate","projectId","assignee","id","externalRef","statusVersion","createdAt","updatedAt","completedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/business-profile":{"get":{"operationId":"getBusinessProfile","tags":["Business settings"],"summary":"事業者情報を取得する","description":"未登録ならdataはnullです。事業アカウントの表示名と請求・契約の名義は別に管理します。運営会社の情報を会員へ流用しません。\n\n必要な権限（scope）: `business_profile:read`","x-required-scopes":["business_profile:read"],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber","updatedAt"],"additionalProperties":false,"nullable":true}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"saveBusinessProfile","tags":["Business settings"],"summary":"事業者情報を保存する","description":"GETしたupdatedAtをexpectedUpdatedAtへ指定し、未登録ならnullを指定します。古い版や同時登録は409 version_conflict。通信の再試行には同じ本文とIdempotency-Keyを使ってください。 全項目を置き換えます。省略・null・空文字の任意項目は消去します。氏名または会社名/屋号名が必要です。保存は本人確認・登録番号の確認・規約同意・契約締結ではありません。請求書や契約書の発行・再発行は行いません。\n\n必要な権限（scope）: `business_profile:write`","x-required-scopes":["business_profile:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"nullable":true},"company":{"type":"string","maxLength":200,"nullable":true},"postalCode":{"type":"string","maxLength":20,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true},"buildingName":{"type":"string","maxLength":200,"nullable":true},"phoneNumber":{"type":"string","maxLength":50,"nullable":true},"registrationNumber":{"type":"string","pattern":"^(T[0-9]{13})?$","nullable":true},"expectedUpdatedAt":{"type":"string","format":"date-time","nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber","updatedAt"],"additionalProperties":false,"nullable":true}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/bank-account":{"get":{"operationId":"getBankAccount","tags":["Business settings"],"summary":"請求書用の振込先を取得する","description":"未登録ならdataはnullです。通常APIはキー発行者の振込先管理権限も確認します。口座番号を含むため、公開ページや解析ログへ転記しないでください。\n\n必要な権限（scope）: `bank_account:read`","x-required-scopes":["bank_account:read"],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"bankName":{"type":"string"},"bankCode":{"type":"string"},"branchName":{"type":"string"},"branchCode":{"type":"string"},"accountNumber":{"type":"string"},"accountName":{"type":"string"},"accountType":{"type":"string","enum":["ORDINARY","CURRENT","SAVINGS"]},"updatedAt":{"type":"string","format":"date-time"}},"required":["bankName","bankCode","branchName","branchCode","accountNumber","accountName","accountType","updatedAt"],"additionalProperties":false,"nullable":true}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"saveBankAccount","tags":["Business settings"],"summary":"請求書用の振込先を保存する","description":"GETしたupdatedAtをexpectedUpdatedAtへ指定し、未登録ならnullを指定します。古い版や同時登録は409 version_conflict。通信の再試行には同じ本文とIdempotency-Keyを使ってください。 全項目を指定して置き換えます。通常APIはキー発行者の振込先管理権限も確認します。これは請求書に記載する口座の設定で、銀行口座の所有確認・Stripe接続・送金は実行しません。請求書や契約書の発行・再発行は行いません。\n\n必要な権限（scope）: `bank_account:write`","x-required-scopes":["bank_account:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankName":{"type":"string","minLength":1,"maxLength":200},"bankCode":{"type":"string","minLength":4,"maxLength":4,"pattern":"^[0-9]{4}$"},"branchName":{"type":"string","minLength":1,"maxLength":200},"branchCode":{"type":"string","minLength":3,"maxLength":3,"pattern":"^[0-9]{3}$"},"accountType":{"type":"string","enum":["ORDINARY","CURRENT","SAVINGS"]},"accountNumber":{"type":"string","minLength":7,"maxLength":7,"pattern":"^[0-9]{7}$"},"accountName":{"type":"string","minLength":1,"maxLength":200},"expectedUpdatedAt":{"type":"string","format":"date-time","nullable":true}},"required":["bankName","bankCode","branchName","branchCode","accountType","accountNumber","accountName","expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"bankName":{"type":"string"},"bankCode":{"type":"string"},"branchName":{"type":"string"},"branchCode":{"type":"string"},"accountNumber":{"type":"string"},"accountName":{"type":"string"},"accountType":{"type":"string","enum":["ORDINARY","CURRENT","SAVINGS"]},"updatedAt":{"type":"string","format":"date-time"}},"required":["bankName","bankCode","branchName","branchCode","accountNumber","accountName","accountType","updatedAt"],"additionalProperties":false,"nullable":true}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/business-profile":{"get":{"operationId":"getConnectBusinessProfile","tags":["Connect business settings"],"summary":"事業者情報を取得する","description":"未登録ならdataはnullです。事業アカウントの表示名と請求・契約の名義は別に管理します。運営会社の情報を会員へ流用しません。\n\n必要な権限（scope）: `connect:business_profile:read`","x-required-scopes":["connect:business_profile:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber","updatedAt"],"additionalProperties":false,"nullable":true}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"saveConnectBusinessProfile","tags":["Connect business settings"],"summary":"事業者情報を保存する","description":"GETしたupdatedAtをexpectedUpdatedAtへ指定し、未登録ならnullを指定します。古い版や同時登録は409 version_conflict。通信の再試行には同じ本文とIdempotency-Keyを使ってください。 全項目を置き換えます。省略・null・空文字の任意項目は消去します。氏名または会社名/屋号名が必要です。保存は本人確認・登録番号の確認・規約同意・契約締結ではありません。請求書や契約書の発行・再発行は行いません。\n\n必要な権限（scope）: `connect:business_profile:write`","x-required-scopes":["connect:business_profile:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"nullable":true},"company":{"type":"string","maxLength":200,"nullable":true},"postalCode":{"type":"string","maxLength":20,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true},"buildingName":{"type":"string","maxLength":200,"nullable":true},"phoneNumber":{"type":"string","maxLength":50,"nullable":true},"registrationNumber":{"type":"string","pattern":"^(T[0-9]{13})?$","nullable":true},"expectedUpdatedAt":{"type":"string","format":"date-time","nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"name":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber","updatedAt"],"additionalProperties":false,"nullable":true}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/bank-account":{"get":{"operationId":"getConnectBankAccount","tags":["Connect business settings"],"summary":"請求書用の振込先を取得する","description":"未登録ならdataはnullです。通常APIはキー発行者の振込先管理権限も確認します。口座番号を含むため、公開ページや解析ログへ転記しないでください。\n\n必要な権限（scope）: `connect:bank_account:read`","x-required-scopes":["connect:bank_account:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"bankName":{"type":"string"},"bankCode":{"type":"string"},"branchName":{"type":"string"},"branchCode":{"type":"string"},"accountNumber":{"type":"string"},"accountName":{"type":"string"},"accountType":{"type":"string","enum":["ORDINARY","CURRENT","SAVINGS"]},"updatedAt":{"type":"string","format":"date-time"}},"required":["bankName","bankCode","branchName","branchCode","accountNumber","accountName","accountType","updatedAt"],"additionalProperties":false,"nullable":true}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"saveConnectBankAccount","tags":["Connect business settings"],"summary":"請求書用の振込先を保存する","description":"GETしたupdatedAtをexpectedUpdatedAtへ指定し、未登録ならnullを指定します。古い版や同時登録は409 version_conflict。通信の再試行には同じ本文とIdempotency-Keyを使ってください。 全項目を指定して置き換えます。通常APIはキー発行者の振込先管理権限も確認します。これは請求書に記載する口座の設定で、銀行口座の所有確認・Stripe接続・送金は実行しません。請求書や契約書の発行・再発行は行いません。\n\n必要な権限（scope）: `connect:bank_account:write`","x-required-scopes":["connect:bank_account:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bankName":{"type":"string","minLength":1,"maxLength":200},"bankCode":{"type":"string","minLength":4,"maxLength":4,"pattern":"^[0-9]{4}$"},"branchName":{"type":"string","minLength":1,"maxLength":200},"branchCode":{"type":"string","minLength":3,"maxLength":3,"pattern":"^[0-9]{3}$"},"accountType":{"type":"string","enum":["ORDINARY","CURRENT","SAVINGS"]},"accountNumber":{"type":"string","minLength":7,"maxLength":7,"pattern":"^[0-9]{7}$"},"accountName":{"type":"string","minLength":1,"maxLength":200},"expectedUpdatedAt":{"type":"string","format":"date-time","nullable":true}},"required":["bankName","bankCode","branchName","branchCode","accountType","accountNumber","accountName","expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"bankName":{"type":"string"},"bankCode":{"type":"string"},"branchName":{"type":"string"},"branchCode":{"type":"string"},"accountNumber":{"type":"string"},"accountName":{"type":"string"},"accountType":{"type":"string","enum":["ORDINARY","CURRENT","SAVINGS"]},"updatedAt":{"type":"string","format":"date-time"}},"required":["bankName","bankCode","branchName","branchCode","accountNumber","accountName","accountType","updatedAt"],"additionalProperties":false,"nullable":true}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/invoices":{"get":{"operationId":"listInvoices","tags":["Invoices"],"summary":"見積書・請求書・領収書を参照する","description":"この事業の帳票の概要と金額を返します。内容は詳細APIで取得してください。削除済みは返しません。\n\n必要な権限（scope）: `invoices:read`","x-required-scopes":["invoices:read"],"parameters":[{"name":"documentType","in":"query","required":false,"schema":{"type":"string","enum":["invoice","estimate","receipt"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","sent","approved","rejected","paid","canceled"]}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"documentType":{"type":"string","enum":["invoice","estimate","receipt"]},"status":{"type":"string","enum":["draft","sent","approved","rejected","paid","canceled"]},"amount":{"type":"number"},"currency":{"type":"string"},"clientId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","documentType","status","amount","currency","clientId","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createInvoice","tags":["Invoices"],"summary":"見積書・請求書の下書きを作る","description":"題名だけで下書きを作れます。documentTypeはinvoiceまたはestimate、既定はinvoice。externalRefは事業内で一意、同じ題名・種類の再送は同じ帳票を返します。再試行にはIdempotency-Keyも使ってください。発行・送付・支払い・公開は行いません。\n\n必要な権限（scope）: `invoices:write`","x-required-scopes":["invoices:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":80},"documentType":{"type":"string","enum":["invoice","estimate"]},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["title"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"documentType":{"type":"string","enum":["invoice","estimate","receipt"]},"status":{"type":"string","enum":["draft","sent","approved","rejected","paid","canceled"]},"amount":{"type":"number"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"invoiceNumber":{"type":"string","nullable":true},"billingDate":{"type":"string","nullable":true},"paymentDeadline":{"type":"string","nullable":true},"clientId":{"type":"string","nullable":true},"recipient":{"type":"object","properties":{"name":{"type":"string","nullable":true},"honorific":{"type":"string","nullable":true}},"required":["name","honorific"],"additionalProperties":false},"issuer":{"type":"object","properties":{"name":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber"],"additionalProperties":false},"transferBankAccount":{"type":"string","nullable":true},"remarks":{"type":"string","nullable":true},"design":{"type":"string","enum":["simple","classic","modern"],"nullable":true},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"unitPrice":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"taxRate":{"type":"number"},"isWithholdingTax":{"type":"boolean"}},"required":["id","name","unitPrice","quantity","unit","taxRate","isWithholdingTax"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","documentType","status","amount","currency","isIncludingTax","taxRoundingMethod","invoiceNumber","billingDate","paymentDeadline","clientId","recipient","issuer","transferBankAccount","remarks","design","lines","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/invoices/{id}":{"get":{"operationId":"getInvoice","tags":["Invoices"],"summary":"帳票の内容と状態を取得する","description":"必要な権限（scope）: `invoices:read`","x-required-scopes":["invoices:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"documentType":{"type":"string","enum":["invoice","estimate","receipt"]},"status":{"type":"string","enum":["draft","sent","approved","rejected","paid","canceled"]},"amount":{"type":"number"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"invoiceNumber":{"type":"string","nullable":true},"billingDate":{"type":"string","nullable":true},"paymentDeadline":{"type":"string","nullable":true},"clientId":{"type":"string","nullable":true},"recipient":{"type":"object","properties":{"name":{"type":"string","nullable":true},"honorific":{"type":"string","nullable":true}},"required":["name","honorific"],"additionalProperties":false},"issuer":{"type":"object","properties":{"name":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber"],"additionalProperties":false},"transferBankAccount":{"type":"string","nullable":true},"remarks":{"type":"string","nullable":true},"design":{"type":"string","enum":["simple","classic","modern"],"nullable":true},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"unitPrice":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"taxRate":{"type":"number"},"isWithholdingTax":{"type":"boolean"}},"required":["id","name","unitPrice","quantity","unit","taxRate","isWithholdingTax"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","documentType","status","amount","currency","isIncludingTax","taxRoundingMethod","invoiceNumber","billingDate","paymentDeadline","clientId","recipient","issuer","transferBankAccount","remarks","design","lines","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateInvoice","tags":["Invoices"],"summary":"下書きの内容を変更する","description":"expectedUpdatedAtへGETした版を指定します。古い版は409。省略項目は保持、nullで任意項目を消せます。issuer/recipientは部分更新、linesは明細全体の置き換えです。金額はTooonの計算処理で求めます。発行済み・支払いに接続済みの帳票は編集できません。種類・所有者・決済設定は変更しません。\n\n必要な権限（scope）: `invoices:write`","x-required-scopes":["invoices:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":1,"maxLength":80},"clientId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"recipient":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"nullable":true},"honorific":{"type":"string","maxLength":30,"nullable":true}},"additionalProperties":false},"issuer":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"nullable":true},"company":{"type":"string","maxLength":200,"nullable":true},"postalCode":{"type":"string","maxLength":20,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true},"buildingName":{"type":"string","maxLength":200,"nullable":true},"phoneNumber":{"type":"string","maxLength":50,"nullable":true},"registrationNumber":{"type":"string","pattern":"^(T[0-9]{13})?$","nullable":true}},"additionalProperties":false},"invoiceNumber":{"type":"string","maxLength":100,"nullable":true},"billingDate":{"type":"string","format":"date-time","nullable":true},"paymentDeadline":{"type":"string","format":"date-time","nullable":true},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500},"unitPrice":{"type":"integer","minimum":0,"maximum":2147483647},"quantity":{"type":"number","minimum":0,"maximum":1000000},"unit":{"type":"string","maxLength":30,"nullable":true},"taxRate":{"type":"integer","minimum":0,"maximum":100},"isWithholdingTax":{"type":"boolean"}},"required":["name","unitPrice","quantity","taxRate"],"additionalProperties":false},"maxItems":100},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"transferBankAccount":{"type":"string","maxLength":1000,"nullable":true},"remarks":{"type":"string","maxLength":5000,"nullable":true},"design":{"type":"string","enum":["simple","classic","modern"],"nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"documentType":{"type":"string","enum":["invoice","estimate","receipt"]},"status":{"type":"string","enum":["draft","sent","approved","rejected","paid","canceled"]},"amount":{"type":"number"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"invoiceNumber":{"type":"string","nullable":true},"billingDate":{"type":"string","nullable":true},"paymentDeadline":{"type":"string","nullable":true},"clientId":{"type":"string","nullable":true},"recipient":{"type":"object","properties":{"name":{"type":"string","nullable":true},"honorific":{"type":"string","nullable":true}},"required":["name","honorific"],"additionalProperties":false},"issuer":{"type":"object","properties":{"name":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber"],"additionalProperties":false},"transferBankAccount":{"type":"string","nullable":true},"remarks":{"type":"string","nullable":true},"design":{"type":"string","enum":["simple","classic","modern"],"nullable":true},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"unitPrice":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"taxRate":{"type":"number"},"isWithholdingTax":{"type":"boolean"}},"required":["id","name","unitPrice","quantity","unit","taxRate","isWithholdingTax"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","documentType","status","amount","currency","isIncludingTax","taxRoundingMethod","invoiceNumber","billingDate","paymentDeadline","clientId","recipient","issuer","transferBankAccount","remarks","design","lines","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/invoices":{"get":{"operationId":"listConnectInvoices","tags":["Connect invoices"],"summary":"見積書・請求書・領収書を参照する","description":"この事業の帳票の概要と金額を返します。内容は詳細APIで取得してください。削除済みは返しません。\n\n必要な権限（scope）: `connect:invoices:read`","x-required-scopes":["connect:invoices:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"documentType","in":"query","required":false,"schema":{"type":"string","enum":["invoice","estimate","receipt"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","sent","approved","rejected","paid","canceled"]}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"documentType":{"type":"string","enum":["invoice","estimate","receipt"]},"status":{"type":"string","enum":["draft","sent","approved","rejected","paid","canceled"]},"amount":{"type":"number"},"currency":{"type":"string"},"clientId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","documentType","status","amount","currency","clientId","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createConnectInvoice","tags":["Connect invoices"],"summary":"見積書・請求書の下書きを作る","description":"題名だけで下書きを作れます。documentTypeはinvoiceまたはestimate、既定はinvoice。externalRefは事業内で一意、同じ題名・種類の再送は同じ帳票を返します。再試行にはIdempotency-Keyも使ってください。発行・送付・支払い・公開は行いません。\n\n必要な権限（scope）: `connect:invoices:write`","x-required-scopes":["connect:invoices:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":80},"documentType":{"type":"string","enum":["invoice","estimate"]},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["title"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"documentType":{"type":"string","enum":["invoice","estimate","receipt"]},"status":{"type":"string","enum":["draft","sent","approved","rejected","paid","canceled"]},"amount":{"type":"number"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"invoiceNumber":{"type":"string","nullable":true},"billingDate":{"type":"string","nullable":true},"paymentDeadline":{"type":"string","nullable":true},"clientId":{"type":"string","nullable":true},"recipient":{"type":"object","properties":{"name":{"type":"string","nullable":true},"honorific":{"type":"string","nullable":true}},"required":["name","honorific"],"additionalProperties":false},"issuer":{"type":"object","properties":{"name":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber"],"additionalProperties":false},"transferBankAccount":{"type":"string","nullable":true},"remarks":{"type":"string","nullable":true},"design":{"type":"string","enum":["simple","classic","modern"],"nullable":true},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"unitPrice":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"taxRate":{"type":"number"},"isWithholdingTax":{"type":"boolean"}},"required":["id","name","unitPrice","quantity","unit","taxRate","isWithholdingTax"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","documentType","status","amount","currency","isIncludingTax","taxRoundingMethod","invoiceNumber","billingDate","paymentDeadline","clientId","recipient","issuer","transferBankAccount","remarks","design","lines","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/invoices/{id}":{"get":{"operationId":"getConnectInvoice","tags":["Connect invoices"],"summary":"帳票の内容と状態を取得する","description":"必要な権限（scope）: `connect:invoices:read`","x-required-scopes":["connect:invoices:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"documentType":{"type":"string","enum":["invoice","estimate","receipt"]},"status":{"type":"string","enum":["draft","sent","approved","rejected","paid","canceled"]},"amount":{"type":"number"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"invoiceNumber":{"type":"string","nullable":true},"billingDate":{"type":"string","nullable":true},"paymentDeadline":{"type":"string","nullable":true},"clientId":{"type":"string","nullable":true},"recipient":{"type":"object","properties":{"name":{"type":"string","nullable":true},"honorific":{"type":"string","nullable":true}},"required":["name","honorific"],"additionalProperties":false},"issuer":{"type":"object","properties":{"name":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber"],"additionalProperties":false},"transferBankAccount":{"type":"string","nullable":true},"remarks":{"type":"string","nullable":true},"design":{"type":"string","enum":["simple","classic","modern"],"nullable":true},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"unitPrice":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"taxRate":{"type":"number"},"isWithholdingTax":{"type":"boolean"}},"required":["id","name","unitPrice","quantity","unit","taxRate","isWithholdingTax"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","documentType","status","amount","currency","isIncludingTax","taxRoundingMethod","invoiceNumber","billingDate","paymentDeadline","clientId","recipient","issuer","transferBankAccount","remarks","design","lines","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateConnectInvoice","tags":["Connect invoices"],"summary":"下書きの内容を変更する","description":"expectedUpdatedAtへGETした版を指定します。古い版は409。省略項目は保持、nullで任意項目を消せます。issuer/recipientは部分更新、linesは明細全体の置き換えです。金額はTooonの計算処理で求めます。発行済み・支払いに接続済みの帳票は編集できません。種類・所有者・決済設定は変更しません。\n\n必要な権限（scope）: `connect:invoices:write`","x-required-scopes":["connect:invoices:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"title":{"type":"string","minLength":1,"maxLength":80},"clientId":{"type":"string","minLength":1,"maxLength":100,"nullable":true},"recipient":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"nullable":true},"honorific":{"type":"string","maxLength":30,"nullable":true}},"additionalProperties":false},"issuer":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"nullable":true},"company":{"type":"string","maxLength":200,"nullable":true},"postalCode":{"type":"string","maxLength":20,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true},"buildingName":{"type":"string","maxLength":200,"nullable":true},"phoneNumber":{"type":"string","maxLength":50,"nullable":true},"registrationNumber":{"type":"string","pattern":"^(T[0-9]{13})?$","nullable":true}},"additionalProperties":false},"invoiceNumber":{"type":"string","maxLength":100,"nullable":true},"billingDate":{"type":"string","format":"date-time","nullable":true},"paymentDeadline":{"type":"string","format":"date-time","nullable":true},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":500},"unitPrice":{"type":"integer","minimum":0,"maximum":2147483647},"quantity":{"type":"number","minimum":0,"maximum":1000000},"unit":{"type":"string","maxLength":30,"nullable":true},"taxRate":{"type":"integer","minimum":0,"maximum":100},"isWithholdingTax":{"type":"boolean"}},"required":["name","unitPrice","quantity","taxRate"],"additionalProperties":false},"maxItems":100},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"transferBankAccount":{"type":"string","maxLength":1000,"nullable":true},"remarks":{"type":"string","maxLength":5000,"nullable":true},"design":{"type":"string","enum":["simple","classic","modern"],"nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"documentType":{"type":"string","enum":["invoice","estimate","receipt"]},"status":{"type":"string","enum":["draft","sent","approved","rejected","paid","canceled"]},"amount":{"type":"number"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"invoiceNumber":{"type":"string","nullable":true},"billingDate":{"type":"string","nullable":true},"paymentDeadline":{"type":"string","nullable":true},"clientId":{"type":"string","nullable":true},"recipient":{"type":"object","properties":{"name":{"type":"string","nullable":true},"honorific":{"type":"string","nullable":true}},"required":["name","honorific"],"additionalProperties":false},"issuer":{"type":"object","properties":{"name":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber"],"additionalProperties":false},"transferBankAccount":{"type":"string","nullable":true},"remarks":{"type":"string","nullable":true},"design":{"type":"string","enum":["simple","classic","modern"],"nullable":true},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"unitPrice":{"type":"number"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"taxRate":{"type":"number"},"isWithholdingTax":{"type":"boolean"}},"required":["id","name","unitPrice","quantity","unit","taxRate","isWithholdingTax"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","externalRef","title","documentType","status","amount","currency","isIncludingTax","taxRoundingMethod","invoiceNumber","billingDate","paymentDeadline","clientId","recipient","issuer","transferBankAccount","remarks","design","lines","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/invoices/{id}/pdf":{"get":{"operationId":"getInvoicePdf","tags":["Invoices"],"summary":"帳票のPDFを取得する","description":"Tooon画面と同じPDFを返します。発行済みは最新の発行版、下書きはプレビューです。版のない既存帳票は保存内容から描画します。PDF取得で発行・送付・支払い・公開は行いません。\n\n必要な権限（scope）: `invoices:read`","x-required-scopes":["invoices:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/invoices/{id}/revisions":{"get":{"operationId":"listInvoiceRevisions","tags":["Invoices"],"summary":"帳票の発行履歴を取得する","description":"発行版の番号・状態・発行日時・取消日時を返します。取消済み版も履歴として含みます。本文や送付先、内部の発行者IDは返しません。\n\n必要な権限（scope）: `invoices:read`","x-required-scopes":["invoices:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"revisionNumber":{"type":"integer"},"documentNumber":{"type":"string"},"status":{"type":"string","enum":["issued","voided"]},"issuedAt":{"type":"string","format":"date-time"},"voidedAt":{"type":"string","format":"date-time","nullable":true}},"required":["id","revisionNumber","documentNumber","status","issuedAt","voidedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/invoices/{id}/revisions/{revisionId}/pdf":{"get":{"operationId":"getInvoiceRevisionPdf","tags":["Invoices"],"summary":"指定した発行版のPDFを取得する","description":"保存済みの発行版の書面を返します。取消済み版も当時の書面として取得できるため、現在有効かどうかは発行履歴のstatusを確認してください。現在の下書きや名義で発行版を上書きしません。\n\n必要な権限（scope）: `invoices:read`","x-required-scopes":["invoices:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"revisionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/invoices/{id}/pdf":{"get":{"operationId":"getConnectInvoicePdf","tags":["Connect invoices"],"summary":"帳票のPDFを取得する","description":"Tooon画面と同じPDFを返します。発行済みは最新の発行版、下書きはプレビューです。版のない既存帳票は保存内容から描画します。PDF取得で発行・送付・支払い・公開は行いません。\n\n必要な権限（scope）: `connect:invoices:read`","x-required-scopes":["connect:invoices:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/invoices/{id}/revisions":{"get":{"operationId":"listConnectInvoiceRevisions","tags":["Connect invoices"],"summary":"帳票の発行履歴を取得する","description":"発行版の番号・状態・発行日時・取消日時を返します。取消済み版も履歴として含みます。本文や送付先、内部の発行者IDは返しません。\n\n必要な権限（scope）: `connect:invoices:read`","x-required-scopes":["connect:invoices:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"revisionNumber":{"type":"integer"},"documentNumber":{"type":"string"},"status":{"type":"string","enum":["issued","voided"]},"issuedAt":{"type":"string","format":"date-time"},"voidedAt":{"type":"string","format":"date-time","nullable":true}},"required":["id","revisionNumber","documentNumber","status","issuedAt","voidedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/invoices/{id}/revisions/{revisionId}/pdf":{"get":{"operationId":"getConnectInvoiceRevisionPdf","tags":["Connect invoices"],"summary":"指定した発行版のPDFを取得する","description":"保存済みの発行版の書面を返します。取消済み版も当時の書面として取得できるため、現在有効かどうかは発行履歴のstatusを確認してください。現在の下書きや名義で発行版を上書きしません。\n\n必要な権限（scope）: `connect:invoices:read`","x-required-scopes":["connect:invoices:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"revisionId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/invoices/{id}/issuance-preview":{"post":{"operationId":"previewInvoiceIssuance","tags":["Invoices"],"summary":"発行前の確認内容を作る","description":"15分間有効な確認IDと帳票・実行内容を返します。連携先はログイン本人に全内容を表示し、明示的な確認を得てください。自動採番の場合documentNumberはnullで、発行時に採番します。発行日時は実行時刻です。プレビューでは発行・送信・決済しません。\n\n必要な権限（scope）: `invoices:issue`","x-required-scopes":["invoices:issue"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"document":{"type":"object","properties":{"schemaVersion":{"const":1},"invoiceId":{"type":"string"},"documentType":{"type":"string","enum":["INVOICE","ESTIMATE"]},"documentNumber":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["FLOOR","CEIL","ROUND"]},"billingDate":{"type":"string","format":"date-time","nullable":true},"paymentDeadline":{"type":"string","format":"date-time","nullable":true},"salesDate":{"type":"string","format":"date-time","nullable":true},"recipient":{"type":"object","properties":{"clientId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"honorificTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["clientId","name","honorificTitle","department","postalCode","address","buildingName","phoneNumber","email"],"additionalProperties":false},"issuer":{"type":"object","properties":{"name":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber"],"additionalProperties":false},"payment":{"type":"object","properties":{"bankTransferAvailable":{"type":"boolean"},"creditCardAvailable":{"type":"boolean"},"virtualBank":{"type":"boolean"},"anonymous":{"type":"boolean"},"transferBankAccount":{"type":"string","nullable":true},"paymentUrl":{"type":"string","nullable":true},"virtualBankAccount":{"type":"object","properties":{"bankName":{"type":"string","minLength":1},"branchName":{"type":"string","minLength":1},"branchCode":{"type":"string","minLength":1},"accountType":{"type":"string","minLength":1},"accountNumber":{"type":"string","minLength":1},"accountHolderName":{"type":"string","minLength":1}},"required":["bankName","branchName","branchCode","accountType","accountNumber","accountHolderName"],"additionalProperties":false,"nullable":true},"virtualBankAmount":{"type":"integer","minimum":0,"nullable":true}},"required":["bankTransferAvailable","creditCardAvailable","virtualBank","anonymous","transferBankAccount"],"additionalProperties":false},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string"},"quantity":{"type":"number","minimum":0},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"number","minimum":0,"maximum":100},"isWithholdingTax":{"type":"boolean"},"amount":{"type":"integer"}},"required":["id","name","quantity","unit","unitPrice","taxRate","isWithholdingTax","amount"],"additionalProperties":false},"minItems":1},"totals":{"type":"object","properties":{"subtotal":{"type":"integer"},"taxByRate":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"number","minimum":0,"maximum":100},"taxableAmount":{"type":"integer"},"taxAmount":{"type":"integer"}},"required":["taxRate","taxableAmount","taxAmount"],"additionalProperties":false}},"consumptionTax":{"type":"integer"},"withholdingTax":{"type":"integer"},"total":{"type":"integer"}},"required":["subtotal","taxByRate","consumptionTax","withholdingTax","total"],"additionalProperties":false},"remarks":{"type":"string","nullable":true},"design":{"type":"string","enum":["SIMPLE","CLASSIC","MODERN"]}},"required":["schemaVersion","invoiceId","documentType","documentNumber","title","currency","isIncludingTax","taxRoundingMethod","billingDate","paymentDeadline","salesDate","recipient","issuer","payment","lines","totals","remarks"],"additionalProperties":false},"effects":{"type":"object","properties":{"createsTransaction":{"type":"boolean"},"completesTasks":{"const":false},"delivery":{"const":"none"},"createsPaymentRequest":{"const":false}},"required":["createsTransaction","completesTasks","delivery","createsPaymentRequest"],"additionalProperties":false}},"required":["document","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/invoices/{id}/issue":{"post":{"operationId":"issueInvoice","tags":["Invoices"],"summary":"本人が確認した帳票を発行する","description":"連携先で認証した本人の確認日時・確認記録IDとプレビューのID・hashを送ります。confirmedByはプレビューのexpectedActorIdと一致させてください。連携先が本人の確認を保証・記録し、Tooonが所有者・版・内容・期限・一回限りの発行を検証します。同じ確認記録の再送は同じ発行版を返します。送信・支払い・タスク完了は行いません。\n\n必要な権限（scope）: `invoices:issue`","x-required-scopes":["invoices:issue"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"invoiceId":{"type":"string"},"revisionId":{"type":"string"},"revisionNumber":{"type":"integer"},"documentNumber":{"type":"string"},"issuedAt":{"type":"string","format":"date-time"},"confirmationId":{"type":"string"},"delivery":{"const":"none"},"createsPaymentRequest":{"const":false}},"required":["invoiceId","revisionId","revisionNumber","documentNumber","issuedAt","confirmationId","delivery","createsPaymentRequest"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/invoices/{id}/issuance-preview":{"post":{"operationId":"previewConnectInvoiceIssuance","tags":["Connect invoices"],"summary":"発行前の確認内容を作る","description":"15分間有効な確認IDと帳票・実行内容を返します。連携先はログイン本人に全内容を表示し、明示的な確認を得てください。自動採番の場合documentNumberはnullで、発行時に採番します。発行日時は実行時刻です。プレビューでは発行・送信・決済しません。\n\n必要な権限（scope）: `connect:invoices:issue`","x-required-scopes":["connect:invoices:issue"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"document":{"type":"object","properties":{"schemaVersion":{"const":1},"invoiceId":{"type":"string"},"documentType":{"type":"string","enum":["INVOICE","ESTIMATE"]},"documentNumber":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"currency":{"type":"string","minLength":3,"maxLength":3},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["FLOOR","CEIL","ROUND"]},"billingDate":{"type":"string","format":"date-time","nullable":true},"paymentDeadline":{"type":"string","format":"date-time","nullable":true},"salesDate":{"type":"string","format":"date-time","nullable":true},"recipient":{"type":"object","properties":{"clientId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"honorificTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["clientId","name","honorificTitle","department","postalCode","address","buildingName","phoneNumber","email"],"additionalProperties":false},"issuer":{"type":"object","properties":{"name":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber"],"additionalProperties":false},"payment":{"type":"object","properties":{"bankTransferAvailable":{"type":"boolean"},"creditCardAvailable":{"type":"boolean"},"virtualBank":{"type":"boolean"},"anonymous":{"type":"boolean"},"transferBankAccount":{"type":"string","nullable":true},"paymentUrl":{"type":"string","nullable":true},"virtualBankAccount":{"type":"object","properties":{"bankName":{"type":"string","minLength":1},"branchName":{"type":"string","minLength":1},"branchCode":{"type":"string","minLength":1},"accountType":{"type":"string","minLength":1},"accountNumber":{"type":"string","minLength":1},"accountHolderName":{"type":"string","minLength":1}},"required":["bankName","branchName","branchCode","accountType","accountNumber","accountHolderName"],"additionalProperties":false,"nullable":true},"virtualBankAmount":{"type":"integer","minimum":0,"nullable":true}},"required":["bankTransferAvailable","creditCardAvailable","virtualBank","anonymous","transferBankAccount"],"additionalProperties":false},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string"},"quantity":{"type":"number","minimum":0},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"number","minimum":0,"maximum":100},"isWithholdingTax":{"type":"boolean"},"amount":{"type":"integer"}},"required":["id","name","quantity","unit","unitPrice","taxRate","isWithholdingTax","amount"],"additionalProperties":false},"minItems":1},"totals":{"type":"object","properties":{"subtotal":{"type":"integer"},"taxByRate":{"type":"array","items":{"type":"object","properties":{"taxRate":{"type":"number","minimum":0,"maximum":100},"taxableAmount":{"type":"integer"},"taxAmount":{"type":"integer"}},"required":["taxRate","taxableAmount","taxAmount"],"additionalProperties":false}},"consumptionTax":{"type":"integer"},"withholdingTax":{"type":"integer"},"total":{"type":"integer"}},"required":["subtotal","taxByRate","consumptionTax","withholdingTax","total"],"additionalProperties":false},"remarks":{"type":"string","nullable":true},"design":{"type":"string","enum":["SIMPLE","CLASSIC","MODERN"]}},"required":["schemaVersion","invoiceId","documentType","documentNumber","title","currency","isIncludingTax","taxRoundingMethod","billingDate","paymentDeadline","salesDate","recipient","issuer","payment","lines","totals","remarks"],"additionalProperties":false},"effects":{"type":"object","properties":{"createsTransaction":{"type":"boolean"},"completesTasks":{"const":false},"delivery":{"const":"none"},"createsPaymentRequest":{"const":false}},"required":["createsTransaction","completesTasks","delivery","createsPaymentRequest"],"additionalProperties":false}},"required":["document","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/invoices/{id}/issue":{"post":{"operationId":"issueConnectInvoice","tags":["Connect invoices"],"summary":"本人が確認した帳票を発行する","description":"連携先で認証した本人の確認日時・確認記録IDとプレビューのID・hashを送ります。confirmedByはプレビューのexpectedActorIdと一致させてください。連携先が本人の確認を保証・記録し、Tooonが所有者・版・内容・期限・一回限りの発行を検証します。同じ確認記録の再送は同じ発行版を返します。送信・支払い・タスク完了は行いません。\n\n必要な権限（scope）: `connect:invoices:issue`","x-required-scopes":["connect:invoices:issue"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"invoiceId":{"type":"string"},"revisionId":{"type":"string"},"revisionNumber":{"type":"integer"},"documentNumber":{"type":"string"},"issuedAt":{"type":"string","format":"date-time"},"confirmationId":{"type":"string"},"delivery":{"const":"none"},"createsPaymentRequest":{"const":false}},"required":["invoiceId","revisionId","revisionNumber","documentNumber","issuedAt","confirmationId","delivery","createsPaymentRequest"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partner-invoice-requests/{id}/presentation-preview":{"post":{"operationId":"previewInvoiceRequestPresentation","tags":["Partner invoice requests"],"summary":"相手への提示前に請求書作成依頼を確認する","description":"15分有効な確認IDと依頼条件・明細・名義・相手・期限を返します。連携先はログインした依頼元本人にreviewの全内容と副作用を表示し、確認操作の証拠を保持してください。明細の計算と依頼額が一致する必要があります。\n\n必要な権限（scope）: `invoice_requests:present`","x-required-scopes":["invoice_requests:present"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"request":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"buyerMessage":{"type":"string","nullable":true},"billingDate":{"type":"string","format":"date-time","nullable":true},"paymentDeadline":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"invoiceNumber":{"type":"string","nullable":true},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}}},"required":["id","status","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","taxRoundingMethod","buyerMessage","billingDate","paymentDeadline","expiresAt","invoiceNumber","lines"],"additionalProperties":false},"buyer":{"type":"object","properties":{"name":{"type":"string"},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber"],"additionalProperties":false},"supplier":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"taxRegistrationNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true}},"required":["name","companyName","contactName","email","taxRegistrationNumber","address"],"additionalProperties":false},"order":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string"},"contractTerms":{"type":"string","nullable":true},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","startDate","endDate"],"additionalProperties":false},"recipientDetails":{"type":"object","properties":{"recipientName":{"type":"string","nullable":true},"recipientHonorificTitle":{"type":"string","nullable":true},"recipientDepartment":{"type":"string","nullable":true},"recipientPostalCode":{"type":"string","nullable":true},"recipientAddress":{"type":"string","nullable":true},"recipientBuildingName":{"type":"string","nullable":true},"recipientPhoneNumber":{"type":"string","nullable":true}},"additionalProperties":false,"nullable":true},"senderDetails":{"type":"object","properties":{"senderName":{"type":"string","nullable":true},"senderCompany":{"type":"string","nullable":true},"senderRegistrationNumber":{"type":"string","nullable":true},"senderAddress":{"type":"string","nullable":true},"senderPhoneNumber":{"type":"string","nullable":true},"transferBankAccount":{"type":"string","nullable":true},"remarks":{"type":"string","nullable":true}},"additionalProperties":false,"nullable":true},"effects":{"type":"object","properties":{"status":{"const":"sent"},"presentation":{"const":"provider"},"delivery":{"const":"none"},"invalidatesPublicLink":{"const":true},"submitsInvoice":{"const":false},"createsSettlement":{"const":false},"approvesPayment":{"const":false}},"required":["status","presentation","delivery","invalidatesPublicLink","submitsInvoice","createsSettlement","approvesPayment"],"additionalProperties":false}},"required":["request","buyer","supplier","order","recipientDetails","senderDetails","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partner-invoice-requests/{id}/present":{"post":{"operationId":"presentInvoiceRequest","tags":["Partner invoice requests"],"summary":"本人が確認した請求書作成依頼を提示用に確定する","description":"連携先で本人が確認した版をSENTへ進め、保存したreviewを提示内容として確定します。delivery:none。連携先は確認済みreviewを相手に表示します。既存の公開リンクは失効し、新しいリンクは返しません。到達・閲覧・提出・請求書発行・承認・支払いは行いません。変更・期限切れ・別本人を拒否し、同じ確認記録の再送は同じ確定結果を返します。\n\n必要な権限（scope）: `invoice_requests:present`","x-required-scopes":["invoice_requests:present"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"requestId":{"type":"string"},"confirmationId":{"type":"string"},"reviewHash":{"type":"string"},"presentedAt":{"type":"string","format":"date-time"},"delivery":{"const":"none"}},"required":["requestId","confirmationId","reviewHash","presentedAt","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/partner-invoice-requests/{id}/presentation-preview":{"post":{"operationId":"previewConnectInvoiceRequestPresentation","tags":["Connect invoice requests"],"summary":"相手への提示前に請求書作成依頼を確認する","description":"15分有効な確認IDと依頼条件・明細・名義・相手・期限を返します。連携先はログインした依頼元本人にreviewの全内容と副作用を表示し、確認操作の証拠を保持してください。明細の計算と依頼額が一致する必要があります。\n\n必要な権限（scope）: `connect:invoice_requests:present`","x-required-scopes":["connect:invoice_requests:present"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"request":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"buyerMessage":{"type":"string","nullable":true},"billingDate":{"type":"string","format":"date-time","nullable":true},"paymentDeadline":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"invoiceNumber":{"type":"string","nullable":true},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}}},"required":["id","status","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","taxRoundingMethod","buyerMessage","billingDate","paymentDeadline","expiresAt","invoiceNumber","lines"],"additionalProperties":false},"buyer":{"type":"object","properties":{"name":{"type":"string"},"company":{"type":"string","nullable":true},"postalCode":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"buildingName":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"registrationNumber":{"type":"string","nullable":true}},"required":["name","company","postalCode","address","buildingName","phoneNumber","registrationNumber"],"additionalProperties":false},"supplier":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"taxRegistrationNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true}},"required":["name","companyName","contactName","email","taxRegistrationNumber","address"],"additionalProperties":false},"order":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string"},"contractTerms":{"type":"string","nullable":true},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","startDate","endDate"],"additionalProperties":false},"recipientDetails":{"type":"object","properties":{"recipientName":{"type":"string","nullable":true},"recipientHonorificTitle":{"type":"string","nullable":true},"recipientDepartment":{"type":"string","nullable":true},"recipientPostalCode":{"type":"string","nullable":true},"recipientAddress":{"type":"string","nullable":true},"recipientBuildingName":{"type":"string","nullable":true},"recipientPhoneNumber":{"type":"string","nullable":true}},"additionalProperties":false,"nullable":true},"senderDetails":{"type":"object","properties":{"senderName":{"type":"string","nullable":true},"senderCompany":{"type":"string","nullable":true},"senderRegistrationNumber":{"type":"string","nullable":true},"senderAddress":{"type":"string","nullable":true},"senderPhoneNumber":{"type":"string","nullable":true},"transferBankAccount":{"type":"string","nullable":true},"remarks":{"type":"string","nullable":true}},"additionalProperties":false,"nullable":true},"effects":{"type":"object","properties":{"status":{"const":"sent"},"presentation":{"const":"provider"},"delivery":{"const":"none"},"invalidatesPublicLink":{"const":true},"submitsInvoice":{"const":false},"createsSettlement":{"const":false},"approvesPayment":{"const":false}},"required":["status","presentation","delivery","invalidatesPublicLink","submitsInvoice","createsSettlement","approvesPayment"],"additionalProperties":false}},"required":["request","buyer","supplier","order","recipientDetails","senderDetails","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/partner-invoice-requests/{id}/present":{"post":{"operationId":"presentConnectInvoiceRequest","tags":["Connect invoice requests"],"summary":"本人が確認した請求書作成依頼を提示用に確定する","description":"連携先で本人が確認した版をSENTへ進め、保存したreviewを提示内容として確定します。delivery:none。連携先は確認済みreviewを相手に表示します。既存の公開リンクは失効し、新しいリンクは返しません。到達・閲覧・提出・請求書発行・承認・支払いは行いません。変更・期限切れ・別本人を拒否し、同じ確認記録の再送は同じ確定結果を返します。\n\n必要な権限（scope）: `connect:invoice_requests:present`","x-required-scopes":["connect:invoice_requests:present"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"requestId":{"type":"string"},"confirmationId":{"type":"string"},"reviewHash":{"type":"string"},"presentedAt":{"type":"string","format":"date-time"},"delivery":{"const":"none"}},"required":["requestId","confirmationId","reviewHash","presentedAt","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partner-invoice-requests/{id}/cancel-preview":{"post":{"operationId":"previewInvoiceRequestCancellation","tags":["Partner invoice requests"],"summary":"提出前の請求書作成依頼を取り消す前に確認する","description":"15分有効な確認IDと対象依頼・現在の相手/発注・理由・副作用を返します。連携先は依頼元本人へreviewの全内容を表示し、確認証拠を保持してください。提出以降や精算に接続した依頼は対象外です。\n\n必要な権限（scope）: `invoice_requests:cancel`","x-required-scopes":["invoice_requests:cancel"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"comment":{"type":"string","maxLength":2000,"nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"request":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"buyerMessage":{"type":"string","nullable":true},"billingDate":{"type":"string","format":"date-time","nullable":true},"paymentDeadline":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"invoiceNumber":{"type":"string","nullable":true},"sentAt":{"type":"string","format":"date-time","nullable":true},"submittedAt":{"type":"string","format":"date-time","nullable":true},"approvedAt":{"type":"string","format":"date-time","nullable":true},"paidAt":{"type":"string","format":"date-time","nullable":true},"canceledAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}}},"required":["id","status","externalRef","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","taxRoundingMethod","buyerMessage","billingDate","paymentDeadline","expiresAt","invoiceNumber","sentAt","submittedAt","approvedAt","paidAt","canceledAt","createdAt","updatedAt","lines"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"order":{"type":"object","properties":{"title":{"type":"string"},"status":{"type":"string"}},"required":["title","status"],"additionalProperties":false},"comment":{"type":"string","nullable":true},"effects":{"type":"object","properties":{"status":{"const":"canceled"},"delivery":{"const":"none"},"invalidatesPublicLink":{"const":true},"changesPartnerOrder":{"const":false},"changesAgreement":{"const":false},"changesSettlement":{"const":false},"changesPayment":{"const":false}},"required":["status","delivery","invalidatesPublicLink","changesPartnerOrder","changesAgreement","changesSettlement","changesPayment"],"additionalProperties":false}},"required":["request","partner","order","comment","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partner-invoice-requests/{id}/cancel-confirmed":{"post":{"operationId":"cancelConfirmedInvoiceRequest","tags":["Partner invoice requests"],"summary":"本人が確認した提出前の請求書作成依頼を取り消す","description":"確認した提出前の依頼をCANCELEDにし、旧公開リンクを無効にします。delivery:none。発注・契約・精算・支払・請求書を変更せず、メールも送りません。内容・版・本人・期限を検証し、同じ確認の再送は同じ結果を返します。\n\n必要な権限（scope）: `invoice_requests:cancel`","x-required-scopes":["invoice_requests:cancel"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"requestId":{"type":"string"},"confirmationId":{"type":"string"},"reviewHash":{"type":"string"},"canceledAt":{"type":"string","format":"date-time"},"delivery":{"const":"none"}},"required":["requestId","confirmationId","reviewHash","canceledAt","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/partner-invoice-requests/{id}/cancel-preview":{"post":{"operationId":"previewConnectInvoiceRequestCancellation","tags":["Connect invoice requests"],"summary":"提出前の請求書作成依頼を取り消す前に確認する","description":"15分有効な確認IDと対象依頼・現在の相手/発注・理由・副作用を返します。連携先は依頼元本人へreviewの全内容を表示し、確認証拠を保持してください。提出以降や精算に接続した依頼は対象外です。\n\n必要な権限（scope）: `connect:invoice_requests:cancel`","x-required-scopes":["connect:invoice_requests:cancel"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"comment":{"type":"string","maxLength":2000,"nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"request":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"buyerMessage":{"type":"string","nullable":true},"billingDate":{"type":"string","format":"date-time","nullable":true},"paymentDeadline":{"type":"string","format":"date-time","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"invoiceNumber":{"type":"string","nullable":true},"sentAt":{"type":"string","format":"date-time","nullable":true},"submittedAt":{"type":"string","format":"date-time","nullable":true},"approvedAt":{"type":"string","format":"date-time","nullable":true},"paidAt":{"type":"string","format":"date-time","nullable":true},"canceledAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}}},"required":["id","status","externalRef","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","taxRoundingMethod","buyerMessage","billingDate","paymentDeadline","expiresAt","invoiceNumber","sentAt","submittedAt","approvedAt","paidAt","canceledAt","createdAt","updatedAt","lines"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"order":{"type":"object","properties":{"title":{"type":"string"},"status":{"type":"string"}},"required":["title","status"],"additionalProperties":false},"comment":{"type":"string","nullable":true},"effects":{"type":"object","properties":{"status":{"const":"canceled"},"delivery":{"const":"none"},"invalidatesPublicLink":{"const":true},"changesPartnerOrder":{"const":false},"changesAgreement":{"const":false},"changesSettlement":{"const":false},"changesPayment":{"const":false}},"required":["status","delivery","invalidatesPublicLink","changesPartnerOrder","changesAgreement","changesSettlement","changesPayment"],"additionalProperties":false}},"required":["request","partner","order","comment","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/partner-invoice-requests/{id}/cancel-confirmed":{"post":{"operationId":"cancelConfirmedConnectInvoiceRequest","tags":["Connect invoice requests"],"summary":"本人が確認した提出前の請求書作成依頼を取り消す","description":"確認した提出前の依頼をCANCELEDにし、旧公開リンクを無効にします。delivery:none。発注・契約・精算・支払・請求書を変更せず、メールも送りません。内容・版・本人・期限を検証し、同じ確認の再送は同じ結果を返します。\n\n必要な権限（scope）: `connect:invoice_requests:cancel`","x-required-scopes":["connect:invoice_requests:cancel"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"requestId":{"type":"string"},"confirmationId":{"type":"string"},"reviewHash":{"type":"string"},"canceledAt":{"type":"string","format":"date-time"},"delivery":{"const":"none"}},"required":["requestId","confirmationId","reviewHash","canceledAt","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agreements":{"get":{"operationId":"listAgreements","tags":["Agreements"],"summary":"取引合意の状態を一覧で取得する","description":"この事業が依頼元の取引合意を返します。接続先の案件・取引の閲覧権限も確認します。合意本文は詳細APIで取得してください。相手側のTooonワークスペースの記録は含みません。\n\n必要な権限（scope）: `agreements:read`","x-required-scopes":["agreements:read"],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]}},{"name":"partnerId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"partnerOrderId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"expiresAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"viewedAt":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"declinedAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","revisionOfId","externalRef","partnerId","partnerOrderId","status","expiresAt","sentAt","viewedAt","acceptedAt","declinedAt","canceledAt","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createAgreement","tags":["Agreements"],"summary":"取引合意の下書きを作る","description":"同じ事業の有効な発注先の条件から作成します。未送信・送信中・同意済みの合意がある場合は重複作成できません。externalRefは事業内で一意、同じ条件ID・message・期限の再送は同じ記録を返します。Idempotency-Keyも使ってください。相手への提示・送信・同意・支払いは行いません。\n\n必要な権限（scope）: `agreements:write`","x-required-scopes":["agreements:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"buyerMessage":{"type":"string","maxLength":10000,"nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"partnerOrderId":{"type":"string","minLength":1,"maxLength":100},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["partnerOrderId"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"expiresAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"viewedAt":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"declinedAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"partnerOrderUpdatedAt":{"type":"string","format":"date-time"},"buyerMessage":{"type":"string","nullable":true},"initiatorSide":{"type":"string","enum":["buyer","seller"]},"receiverSide":{"type":"string","enum":["buyer","seller"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false}},"required":["id","revisionOfId","externalRef","partnerId","partnerOrderId","status","expiresAt","sentAt","viewedAt","acceptedAt","declinedAt","canceledAt","createdAt","updatedAt","partnerOrderUpdatedAt","buyerMessage","initiatorSide","receiverSide","terms"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agreements/{id}":{"get":{"operationId":"getAgreement","tags":["Agreements"],"summary":"保存された合意内容を取得する","description":"名義・条件は保存済みsnapshotから返します。秘密URL、内部メモ、相手のIP・端末情報は返しません。登録情報が変わっても過去の合意は変わりません。\n\n必要な権限（scope）: `agreements:read`","x-required-scopes":["agreements:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"expiresAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"viewedAt":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"declinedAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"partnerOrderUpdatedAt":{"type":"string","format":"date-time"},"buyerMessage":{"type":"string","nullable":true},"initiatorSide":{"type":"string","enum":["buyer","seller"]},"receiverSide":{"type":"string","enum":["buyer","seller"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false}},"required":["id","revisionOfId","externalRef","partnerId","partnerOrderId","status","expiresAt","sentAt","viewedAt","acceptedAt","declinedAt","canceledAt","createdAt","updatedAt","partnerOrderUpdatedAt","buyerMessage","initiatorSide","receiverSide","terms"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateAgreement","tags":["Agreements"],"summary":"取引合意の下書きを編集する","description":"最新の下書きのみ編集できます。expectedUpdatedAtが古い場合は409。省略項目は保持し、nullで任意項目を消せます。refreshTerms:trueで現在の発注条件とこの事業の名義を取り込み直します。通常のmessage・期限の変更では保存済み条件を変えません。相手への提示・送信・同意は行いません。\n\n必要な権限（scope）: `agreements:write`","x-required-scopes":["agreements:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"buyerMessage":{"type":"string","maxLength":10000,"nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"expectedUpdatedAt":{"type":"string","format":"date-time"},"refreshTerms":{"const":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"expiresAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"viewedAt":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"declinedAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"partnerOrderUpdatedAt":{"type":"string","format":"date-time"},"buyerMessage":{"type":"string","nullable":true},"initiatorSide":{"type":"string","enum":["buyer","seller"]},"receiverSide":{"type":"string","enum":["buyer","seller"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false}},"required":["id","revisionOfId","externalRef","partnerId","partnerOrderId","status","expiresAt","sentAt","viewedAt","acceptedAt","declinedAt","canceledAt","createdAt","updatedAt","partnerOrderUpdatedAt","buyerMessage","initiatorSide","receiverSide","terms"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/agreements":{"get":{"operationId":"listConnectAgreements","tags":["Connect agreements"],"summary":"取引合意の状態を一覧で取得する","description":"この事業が依頼元の取引合意を返します。接続先の案件・取引の閲覧権限も確認します。合意本文は詳細APIで取得してください。相手側のTooonワークスペースの記録は含みません。\n\n必要な権限（scope）: `connect:agreements:read`","x-required-scopes":["connect:agreements:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]}},{"name":"partnerId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"partnerOrderId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"expiresAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"viewedAt":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"declinedAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","revisionOfId","externalRef","partnerId","partnerOrderId","status","expiresAt","sentAt","viewedAt","acceptedAt","declinedAt","canceledAt","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createConnectAgreement","tags":["Connect agreements"],"summary":"取引合意の下書きを作る","description":"同じ事業の有効な発注先の条件から作成します。未送信・送信中・同意済みの合意がある場合は重複作成できません。externalRefは事業内で一意、同じ条件ID・message・期限の再送は同じ記録を返します。Idempotency-Keyも使ってください。相手への提示・送信・同意・支払いは行いません。\n\n必要な権限（scope）: `connect:agreements:write`","x-required-scopes":["connect:agreements:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"buyerMessage":{"type":"string","maxLength":10000,"nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"partnerOrderId":{"type":"string","minLength":1,"maxLength":100},"externalRef":{"type":"string","minLength":1,"maxLength":200}},"required":["partnerOrderId"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"expiresAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"viewedAt":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"declinedAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"partnerOrderUpdatedAt":{"type":"string","format":"date-time"},"buyerMessage":{"type":"string","nullable":true},"initiatorSide":{"type":"string","enum":["buyer","seller"]},"receiverSide":{"type":"string","enum":["buyer","seller"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false}},"required":["id","revisionOfId","externalRef","partnerId","partnerOrderId","status","expiresAt","sentAt","viewedAt","acceptedAt","declinedAt","canceledAt","createdAt","updatedAt","partnerOrderUpdatedAt","buyerMessage","initiatorSide","receiverSide","terms"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/agreements/{id}":{"get":{"operationId":"getConnectAgreement","tags":["Connect agreements"],"summary":"保存された合意内容を取得する","description":"名義・条件は保存済みsnapshotから返します。秘密URL、内部メモ、相手のIP・端末情報は返しません。登録情報が変わっても過去の合意は変わりません。\n\n必要な権限（scope）: `connect:agreements:read`","x-required-scopes":["connect:agreements:read"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"expiresAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"viewedAt":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"declinedAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"partnerOrderUpdatedAt":{"type":"string","format":"date-time"},"buyerMessage":{"type":"string","nullable":true},"initiatorSide":{"type":"string","enum":["buyer","seller"]},"receiverSide":{"type":"string","enum":["buyer","seller"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false}},"required":["id","revisionOfId","externalRef","partnerId","partnerOrderId","status","expiresAt","sentAt","viewedAt","acceptedAt","declinedAt","canceledAt","createdAt","updatedAt","partnerOrderUpdatedAt","buyerMessage","initiatorSide","receiverSide","terms"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateConnectAgreement","tags":["Connect agreements"],"summary":"取引合意の下書きを編集する","description":"最新の下書きのみ編集できます。expectedUpdatedAtが古い場合は409。省略項目は保持し、nullで任意項目を消せます。refreshTerms:trueで現在の発注条件とこの事業の名義を取り込み直します。通常のmessage・期限の変更では保存済み条件を変えません。相手への提示・送信・同意は行いません。\n\n必要な権限（scope）: `connect:agreements:write`","x-required-scopes":["connect:agreements:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"buyerMessage":{"type":"string","maxLength":10000,"nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"expectedUpdatedAt":{"type":"string","format":"date-time"},"refreshTerms":{"const":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"expiresAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"viewedAt":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"declinedAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"partnerOrderUpdatedAt":{"type":"string","format":"date-time"},"buyerMessage":{"type":"string","nullable":true},"initiatorSide":{"type":"string","enum":["buyer","seller"]},"receiverSide":{"type":"string","enum":["buyer","seller"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false}},"required":["id","revisionOfId","externalRef","partnerId","partnerOrderId","status","expiresAt","sentAt","viewedAt","acceptedAt","declinedAt","canceledAt","createdAt","updatedAt","partnerOrderUpdatedAt","buyerMessage","initiatorSide","receiverSide","terms"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agreements/{id}/presentation-preview":{"post":{"operationId":"previewAgreementPresentation","tags":["Agreements"],"summary":"相手への提示前に合意内容を確認する","description":"15分有効な確認IDと保存済みの条件・名義・相手・message・期限を返します。連携先は認証した依頼元本人に全内容を表示して確認を得てください。元の発注条件を取り込み直す場合は下書きでrefreshTermsを実行してから確認します。\n\n必要な権限（scope）: `agreements:present`","x-required-scopes":["agreements:present"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"agreement":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false},"buyerMessage":{"type":"string","nullable":true},"expiresAt":{"type":"string","nullable":true}},"required":["id","revisionOfId","partnerId","partnerOrderId","terms","buyerMessage","expiresAt"],"additionalProperties":false},"effects":{"type":"object","properties":{"presentation":{"const":"provider"},"delivery":{"const":"none"},"acceptsAgreement":{"const":false},"activatesPartnerOrder":{"const":false},"createsPaymentRequest":{"const":false}},"required":["presentation","delivery","acceptsAgreement","activatesPartnerOrder","createsPaymentRequest"],"additionalProperties":false}},"required":["agreement","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agreements/{id}/present":{"post":{"operationId":"presentAgreement","tags":["Agreements"],"summary":"本人が確認した合意内容を提示用に確定する","description":"連携先の本人確認記録を受け取り、確認した版をSENTへ進めます。delivery:none。Tooonからメール・公開リンクは作りません。連携先が相手に内容を表示します。提示の準備が整った記録であり、到達・閲覧・相手の同意は意味しません。同じ確認記録の再送は同じ確定結果を返します。相手の同意・発注有効化・支払いは行いません。\n\n必要な権限（scope）: `agreements:present`","x-required-scopes":["agreements:present"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"agreementId":{"type":"string"},"confirmationId":{"type":"string"},"reviewHash":{"type":"string"},"presentedAt":{"type":"string","format":"date-time"},"delivery":{"const":"none"}},"required":["agreementId","confirmationId","reviewHash","presentedAt","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/agreements/{id}/presentation-preview":{"post":{"operationId":"previewConnectAgreementPresentation","tags":["Connect agreements"],"summary":"相手への提示前に合意内容を確認する","description":"15分有効な確認IDと保存済みの条件・名義・相手・message・期限を返します。連携先は認証した依頼元本人に全内容を表示して確認を得てください。元の発注条件を取り込み直す場合は下書きでrefreshTermsを実行してから確認します。\n\n必要な権限（scope）: `connect:agreements:present`","x-required-scopes":["connect:agreements:present"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"agreement":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false},"buyerMessage":{"type":"string","nullable":true},"expiresAt":{"type":"string","nullable":true}},"required":["id","revisionOfId","partnerId","partnerOrderId","terms","buyerMessage","expiresAt"],"additionalProperties":false},"effects":{"type":"object","properties":{"presentation":{"const":"provider"},"delivery":{"const":"none"},"acceptsAgreement":{"const":false},"activatesPartnerOrder":{"const":false},"createsPaymentRequest":{"const":false}},"required":["presentation","delivery","acceptsAgreement","activatesPartnerOrder","createsPaymentRequest"],"additionalProperties":false}},"required":["agreement","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/agreements/{id}/present":{"post":{"operationId":"presentConnectAgreement","tags":["Connect agreements"],"summary":"本人が確認した合意内容を提示用に確定する","description":"連携先の本人確認記録を受け取り、確認した版をSENTへ進めます。delivery:none。Tooonからメール・公開リンクは作りません。連携先が相手に内容を表示します。提示の準備が整った記録であり、到達・閲覧・相手の同意は意味しません。同じ確認記録の再送は同じ確定結果を返します。相手の同意・発注有効化・支払いは行いません。\n\n必要な権限（scope）: `connect:agreements:present`","x-required-scopes":["connect:agreements:present"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"agreementId":{"type":"string"},"confirmationId":{"type":"string"},"reviewHash":{"type":"string"},"presentedAt":{"type":"string","format":"date-time"},"delivery":{"const":"none"}},"required":["agreementId","confirmationId","reviewHash","presentedAt","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agreements/{id}/cancel-preview":{"post":{"operationId":"cancelAgreementPreview","tags":["Agreements"],"summary":"取引合意の取消前に対象と効果を確認する","description":"15分有効な確認IDと、対象の保存内容・現在状態・変更後状態・理由を返します。連携先は認証した依頼元本人に全内容を表示して確認を得てください。同意済み契約の解除には使えません。\n\n必要な権限（scope）: `agreements:cancel`","x-required-scopes":["agreements:cancel"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"comment":{"type":"string","maxLength":2000,"nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"action":{"type":"string","enum":["cancel","revise"]},"agreement":{"type":"object","properties":{"id":{"type":"string"},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false},"buyerMessage":{"type":"string","nullable":true},"expiresAt":{"type":"string","nullable":true}},"required":["id","partnerId","partnerOrderId","status","terms","buyerMessage","expiresAt"],"additionalProperties":false},"comment":{"type":"string","nullable":true},"effects":{"type":"object","properties":{"status":{"type":"string","enum":["canceled","revised"]},"delivery":{"const":"none"},"invalidatesPublicLink":{"const":true},"acceptsAgreement":{"const":false},"changesPartnerOrder":{"const":false},"createsPaymentRequest":{"const":false},"nextStep":{"type":"string","enum":["none","create_draft"]}},"required":["status","delivery","invalidatesPublicLink","acceptsAgreement","changesPartnerOrder","createsPaymentRequest","nextStep"],"additionalProperties":false}},"required":["action","agreement","comment","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agreements/{id}/cancel":{"post":{"operationId":"cancelAgreement","tags":["Agreements"],"summary":"本人が確認した取引合意を取消する","description":"未同意の合意をCANCELEDにし、旧ゲストURLを無効にします。依頼元本人の確認記録が必要です。発注条件・支払いは変えず、相手へ送信しません。同じ確認の再送は一回の結果です。\n\n必要な権限（scope）: `agreements:cancel`","x-required-scopes":["agreements:cancel"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"agreementId":{"type":"string"},"confirmationId":{"type":"string"},"action":{"type":"string","enum":["cancel","revise"]},"status":{"type":"string","enum":["canceled","revised"]},"changedAt":{"type":"string","format":"date-time"},"reviewHash":{"type":"string"},"delivery":{"const":"none"}},"required":["agreementId","confirmationId","action","status","changedAt","reviewHash","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/agreements/{id}/cancel-preview":{"post":{"operationId":"cancelConnectAgreementPreview","tags":["Connect agreements"],"summary":"取引合意の取消前に対象と効果を確認する","description":"15分有効な確認IDと、対象の保存内容・現在状態・変更後状態・理由を返します。連携先は認証した依頼元本人に全内容を表示して確認を得てください。同意済み契約の解除には使えません。\n\n必要な権限（scope）: `connect:agreements:cancel`","x-required-scopes":["connect:agreements:cancel"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"comment":{"type":"string","maxLength":2000,"nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"action":{"type":"string","enum":["cancel","revise"]},"agreement":{"type":"object","properties":{"id":{"type":"string"},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false},"buyerMessage":{"type":"string","nullable":true},"expiresAt":{"type":"string","nullable":true}},"required":["id","partnerId","partnerOrderId","status","terms","buyerMessage","expiresAt"],"additionalProperties":false},"comment":{"type":"string","nullable":true},"effects":{"type":"object","properties":{"status":{"type":"string","enum":["canceled","revised"]},"delivery":{"const":"none"},"invalidatesPublicLink":{"const":true},"acceptsAgreement":{"const":false},"changesPartnerOrder":{"const":false},"createsPaymentRequest":{"const":false},"nextStep":{"type":"string","enum":["none","create_draft"]}},"required":["status","delivery","invalidatesPublicLink","acceptsAgreement","changesPartnerOrder","createsPaymentRequest","nextStep"],"additionalProperties":false}},"required":["action","agreement","comment","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/agreements/{id}/cancel":{"post":{"operationId":"cancelConnectAgreement","tags":["Connect agreements"],"summary":"本人が確認した取引合意を取消する","description":"未同意の合意をCANCELEDにし、旧ゲストURLを無効にします。依頼元本人の確認記録が必要です。発注条件・支払いは変えず、相手へ送信しません。同じ確認の再送は一回の結果です。\n\n必要な権限（scope）: `connect:agreements:cancel`","x-required-scopes":["connect:agreements:cancel"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"agreementId":{"type":"string"},"confirmationId":{"type":"string"},"action":{"type":"string","enum":["cancel","revise"]},"status":{"type":"string","enum":["canceled","revised"]},"changedAt":{"type":"string","format":"date-time"},"reviewHash":{"type":"string"},"delivery":{"const":"none"}},"required":["agreementId","confirmationId","action","status","changedAt","reviewHash","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agreements/{id}/revise-preview":{"post":{"operationId":"reviseAgreementPreview","tags":["Agreements"],"summary":"取引合意の修正戻し前に対象と効果を確認する","description":"15分有効な確認IDと、対象の保存内容・現在状態・変更後状態・理由を返します。連携先は認証した依頼元本人に全内容を表示して確認を得てください。同意済み契約の解除には使えません。\n\n必要な権限（scope）: `agreements:revise`","x-required-scopes":["agreements:revise"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"comment":{"type":"string","maxLength":2000,"nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"action":{"type":"string","enum":["cancel","revise"]},"agreement":{"type":"object","properties":{"id":{"type":"string"},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false},"buyerMessage":{"type":"string","nullable":true},"expiresAt":{"type":"string","nullable":true}},"required":["id","partnerId","partnerOrderId","status","terms","buyerMessage","expiresAt"],"additionalProperties":false},"comment":{"type":"string","nullable":true},"effects":{"type":"object","properties":{"status":{"type":"string","enum":["canceled","revised"]},"delivery":{"const":"none"},"invalidatesPublicLink":{"const":true},"acceptsAgreement":{"const":false},"changesPartnerOrder":{"const":false},"createsPaymentRequest":{"const":false},"nextStep":{"type":"string","enum":["none","create_draft"]}},"required":["status","delivery","invalidatesPublicLink","acceptsAgreement","changesPartnerOrder","createsPaymentRequest","nextStep"],"additionalProperties":false}},"required":["action","agreement","comment","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agreements/{id}/revise":{"post":{"operationId":"reviseAgreement","tags":["Agreements"],"summary":"本人が確認した取引合意を修正戻しする","description":"未同意の合意をREVISEDにし、旧ゲストURLを無効にします。修正後の条件は同じpartnerOrderIdで新しい下書きを作り、再確認して提示してください。発注条件・支払いは変えず、相手へ送信しません。\n\n必要な権限（scope）: `agreements:revise`","x-required-scopes":["agreements:revise"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"agreementId":{"type":"string"},"confirmationId":{"type":"string"},"action":{"type":"string","enum":["cancel","revise"]},"status":{"type":"string","enum":["canceled","revised"]},"changedAt":{"type":"string","format":"date-time"},"reviewHash":{"type":"string"},"delivery":{"const":"none"}},"required":["agreementId","confirmationId","action","status","changedAt","reviewHash","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/agreements/{id}/revise-preview":{"post":{"operationId":"reviseConnectAgreementPreview","tags":["Connect agreements"],"summary":"取引合意の修正戻し前に対象と効果を確認する","description":"15分有効な確認IDと、対象の保存内容・現在状態・変更後状態・理由を返します。連携先は認証した依頼元本人に全内容を表示して確認を得てください。同意済み契約の解除には使えません。\n\n必要な権限（scope）: `connect:agreements:revise`","x-required-scopes":["connect:agreements:revise"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"comment":{"type":"string","maxLength":2000,"nullable":true}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"confirmationId":{"type":"string"},"expectedActorId":{"type":"string"},"reviewHash":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"review":{"type":"object","properties":{"action":{"type":"string","enum":["cancel","revise"]},"agreement":{"type":"object","properties":{"id":{"type":"string"},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false},"buyerMessage":{"type":"string","nullable":true},"expiresAt":{"type":"string","nullable":true}},"required":["id","partnerId","partnerOrderId","status","terms","buyerMessage","expiresAt"],"additionalProperties":false},"comment":{"type":"string","nullable":true},"effects":{"type":"object","properties":{"status":{"type":"string","enum":["canceled","revised"]},"delivery":{"const":"none"},"invalidatesPublicLink":{"const":true},"acceptsAgreement":{"const":false},"changesPartnerOrder":{"const":false},"createsPaymentRequest":{"const":false},"nextStep":{"type":"string","enum":["none","create_draft"]}},"required":["status","delivery","invalidatesPublicLink","acceptsAgreement","changesPartnerOrder","createsPaymentRequest","nextStep"],"additionalProperties":false}},"required":["action","agreement","comment","effects"],"additionalProperties":false}},"required":["confirmationId","expectedActorId","reviewHash","expiresAt","review"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/agreements/{id}/revise":{"post":{"operationId":"reviseConnectAgreement","tags":["Connect agreements"],"summary":"本人が確認した取引合意を修正戻しする","description":"未同意の合意をREVISEDにし、旧ゲストURLを無効にします。修正後の条件は同じpartnerOrderIdで新しい下書きを作り、再確認して提示してください。発注条件・支払いは変えず、相手へ送信しません。\n\n必要な権限（scope）: `connect:agreements:revise`","x-required-scopes":["connect:agreements:revise"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmationId":{"type":"string","minLength":1,"maxLength":200},"reviewHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"confirmedBy":{"type":"string","minLength":1,"maxLength":200},"confirmedAt":{"type":"string","format":"date-time"},"confirmationReference":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmationId","reviewHash","confirmedBy","confirmedAt","confirmationReference"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"agreementId":{"type":"string"},"confirmationId":{"type":"string"},"action":{"type":"string","enum":["cancel","revise"]},"status":{"type":"string","enum":["canceled","revised"]},"changedAt":{"type":"string","format":"date-time"},"reviewHash":{"type":"string"},"delivery":{"const":"none"}},"required":["agreementId","confirmationId","action","status","changedAt","reviewHash","delivery"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agreements/{id}/revisions":{"post":{"operationId":"createAgreementRevision","tags":["Agreements"],"summary":"同意済みの記録を残して改訂下書きを作る","description":"元の合意はACCEPTEDのまま保持し、現在の発注条件とこの事業の名義で新しいDRAFTを作成します。元のbuyerMessageを引き継ぎ、期限は未設定にします。同じ元合意の改訂下書きがあればそのIDを返します。既に別の提示/改訂が進んでいる場合は409。相手への提示・再同意・発注有効化・支払い・メールは行いません。下書きを編集し、連携先で本人確認してから提示してください。\n\n必要な権限（scope）: `agreements:write`","x-required-scopes":["agreements:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"expiresAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"viewedAt":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"declinedAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"partnerOrderUpdatedAt":{"type":"string","format":"date-time"},"buyerMessage":{"type":"string","nullable":true},"initiatorSide":{"type":"string","enum":["buyer","seller"]},"receiverSide":{"type":"string","enum":["buyer","seller"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false}},"required":["id","revisionOfId","externalRef","partnerId","partnerOrderId","status","expiresAt","sentAt","viewedAt","acceptedAt","declinedAt","canceledAt","createdAt","updatedAt","partnerOrderUpdatedAt","buyerMessage","initiatorSide","receiverSide","terms"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/agreements/{id}/revisions":{"post":{"operationId":"createConnectAgreementRevision","tags":["Connect agreements"],"summary":"同意済みの記録を残して改訂下書きを作る","description":"元の合意はACCEPTEDのまま保持し、現在の発注条件とこの事業の名義で新しいDRAFTを作成します。元のbuyerMessageを引き継ぎ、期限は未設定にします。同じ元合意の改訂下書きがあればそのIDを返します。既に別の提示/改訂が進んでいる場合は409。相手への提示・再同意・発注有効化・支払い・メールは行いません。下書きを編集し、連携先で本人確認してから提示してください。\n\n必要な権限（scope）: `connect:agreements:write`","x-required-scopes":["connect:agreements:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"}},"required":["expectedUpdatedAt"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"expiresAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"viewedAt":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"declinedAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"partnerOrderUpdatedAt":{"type":"string","format":"date-time"},"buyerMessage":{"type":"string","nullable":true},"initiatorSide":{"type":"string","enum":["buyer","seller"]},"receiverSide":{"type":"string","enum":["buyer","seller"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false}},"required":["id","revisionOfId","externalRef","partnerId","partnerOrderId","status","expiresAt","sentAt","viewedAt","acceptedAt","declinedAt","canceledAt","createdAt","updatedAt","partnerOrderUpdatedAt","buyerMessage","initiatorSide","receiverSide","terms"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/agreements/{id}/terms":{"patch":{"operationId":"updateAgreementTerms","tags":["Agreements"],"summary":"取引合意の下書きの条件を編集する","description":"最新DRAFTの条件を全項目で置き換えます。GETのupdatedAtをexpectedUpdatedAt、partnerOrderUpdatedAtをexpectedPartnerOrderUpdatedAtに指定してください。通貨は既存の発注と同じ値を指定します。発注とこの下書きの条件を一緒に更新し、承諾済みの原本や過去の版は変えません。既に請求依頼がある発注、完了・中止した発注、予算や多段受発注と結び付いた発注は編集できません。変更前の確認記録は古い版になるため、変更後の内容を連携先で再確認してから提示します。提示・相手の承諾・送信・支払いは行いません。\n\n必要な権限（scope）: `agreements:write`","x-required-scopes":["agreements:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"expectedPartnerOrderUpdatedAt":{"type":"string","format":"date-time"},"terms":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"role":{"type":"string","maxLength":1000,"nullable":true},"scope":{"type":"string","maxLength":10000,"nullable":true},"amount":{"type":"integer","minimum":1,"maximum":2147483647},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","maxLength":10000,"nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","format":"date-time","nullable":true},"endDate":{"type":"string","format":"date-time","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["expectedUpdatedAt","expectedPartnerOrderUpdatedAt","terms"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"expiresAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"viewedAt":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"declinedAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"partnerOrderUpdatedAt":{"type":"string","format":"date-time"},"buyerMessage":{"type":"string","nullable":true},"initiatorSide":{"type":"string","enum":["buyer","seller"]},"receiverSide":{"type":"string","enum":["buyer","seller"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false}},"required":["id","revisionOfId","externalRef","partnerId","partnerOrderId","status","expiresAt","sentAt","viewedAt","acceptedAt","declinedAt","canceledAt","createdAt","updatedAt","partnerOrderUpdatedAt","buyerMessage","initiatorSide","receiverSide","terms"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/connect/accounts/{accountId}/agreements/{id}/terms":{"patch":{"operationId":"updateConnectAgreementTerms","tags":["Connect agreements"],"summary":"取引合意の下書きの条件を編集する","description":"最新DRAFTの条件を全項目で置き換えます。GETのupdatedAtをexpectedUpdatedAt、partnerOrderUpdatedAtをexpectedPartnerOrderUpdatedAtに指定してください。通貨は既存の発注と同じ値を指定します。発注とこの下書きの条件を一緒に更新し、承諾済みの原本や過去の版は変えません。既に請求依頼がある発注、完了・中止した発注、予算や多段受発注と結び付いた発注は編集できません。変更前の確認記録は古い版になるため、変更後の内容を連携先で再確認してから提示します。提示・相手の承諾・送信・支払いは行いません。\n\n必要な権限（scope）: `connect:agreements:write`","x-required-scopes":["connect:agreements:write"],"parameters":[{"name":"accountId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"expectedUpdatedAt":{"type":"string","format":"date-time"},"expectedPartnerOrderUpdatedAt":{"type":"string","format":"date-time"},"terms":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"role":{"type":"string","maxLength":1000,"nullable":true},"scope":{"type":"string","maxLength":10000,"nullable":true},"amount":{"type":"integer","minimum":1,"maximum":2147483647},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","maxLength":10000,"nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","format":"date-time","nullable":true},"endDate":{"type":"string","format":"date-time","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["expectedUpdatedAt","expectedPartnerOrderUpdatedAt","terms"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"revisionOfId":{"type":"string","nullable":true},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","revised","canceled"]},"expiresAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"viewedAt":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"declinedAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"partnerOrderUpdatedAt":{"type":"string","format":"date-time"},"buyerMessage":{"type":"string","nullable":true},"initiatorSide":{"type":"string","enum":["buyer","seller"]},"receiverSide":{"type":"string","enum":["buyer","seller"]},"terms":{"type":"object","properties":{"buyer":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"],"additionalProperties":false},"partner":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":"string","nullable":true}},"required":["name","companyName"],"additionalProperties":false},"partnerOrder":{"type":"object","properties":{"title":{"type":"string"},"role":{"type":"string","nullable":true},"scope":{"type":"string","nullable":true},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"taxRoundingMethod":{"type":"string","enum":["floor","ceil","round"]},"contractTerms":{"type":"string","nullable":true},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"]},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["title","role","scope","amount","currency","isIncludingTax","taxRoundingMethod","contractTerms","subcontractingPolicy","startDate","endDate"],"additionalProperties":false}},"required":["buyer","partner","partnerOrder"],"additionalProperties":false}},"required":["id","revisionOfId","externalRef","partnerId","partnerOrderId","status","expiresAt","sentAt","viewedAt","acceptedAt","declinedAt","canceledAt","createdAt","updatedAt","partnerOrderUpdatedAt","buyerMessage","initiatorSide","receiverSide","terms"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/me":{"get":{"operationId":"getMe","tags":["API key"],"summary":"APIキーの確認","description":"このAPIキーが有効か、どのワークスペースのキーで、どの権限（scope）を持つかを返します。接続確認に使えます。\n\n有効なAPIキーなら呼べます","x-required-scopes":[],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"apiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["connect:members:read","connect:members:write","connect:cards:read","connect:cards:write","connect:cards:publish","connect:evidence:read","connect:expenses:read","connect:expenses:write","connect:expenses:delete","connect:expenses:restore","connect:settlements:read","connect:invoice_requests:cancel","connect:invoice_requests:present","connect:invoice_requests:read","connect:invoice_requests:write","connect:agreements:present","connect:agreements:cancel","connect:agreements:revise","connect:agreements:read","connect:agreements:write","connect:partners:read","connect:partners:write","connect:partner_orders:read","connect:partner_orders:write","connect:invoices:read","connect:invoices:write","connect:invoices:issue","connect:business_profile:read","connect:business_profile:write","connect:bank_account:read","connect:bank_account:write","connect:tasks:read","connect:tasks:write","connect:projects:read","connect:projects:write","connect:clients:read","connect:clients:write","connect:accounts:read","connect:accounts:write","work:read","evidence:read","expenses:read","expenses:write","expenses:delete","expenses:restore","settlements:read","invoice_requests:cancel","invoice_requests:present","agreements:present","agreements:cancel","agreements:revise","agreements:read","agreements:write","invoices:read","invoices:write","invoices:issue","business_profile:read","business_profile:write","bank_account:read","bank_account:write","tasks:read","tasks:write","projects:read","projects:write","clients:read","clients:write","partners:read","partners:write","invoice_requests:read","invoice_requests:write","people:read","people:write","business_cards:read","business_cards:write","company_page:read"]}}},"required":["id","name","scopes"],"additionalProperties":false},"workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"required":["apiKey","workspace"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partners":{"get":{"operationId":"listPartners","tags":["Partners"],"summary":"パートナーの一覧・検索","description":"ワークスペースに登録されたパートナー（発注先）を返します。email を指定すると、大文字小文字を区別せずにメールアドレスが一致する人だけを返します。各パートナーには事業者情報（住所・登録番号・振込先など）と業務委託契約（partnerOrders）が付きます。内部メモは返しません。\n\n必要な権限（scope）: `partners:read`","x-required-scopes":["partners:read"],"parameters":[{"name":"email","in":"query","required":false,"description":"メールアドレスで絞り込み（完全一致）","schema":{"type":"string","maxLength":320}},{"name":"externalRef","in":"query","required":false,"description":"呼び出し元システムでの識別子で絞り込み","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"1回に返す件数（既定 50、最大 100）","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"前の応答の nextCursor","schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true,"description":"住所（請求書の請求元に載せる）"},"taxRegistrationNumber":{"type":"string","nullable":true,"description":"適格請求書発行事業者の登録番号"},"bankAccount":{"type":"string","nullable":true,"description":"振込先"},"status":{"type":"string","enum":["active","inactive"]},"partnerOrders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["draft","active","completed","canceled"]},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["id","title","status","amount","currency","isIncludingTax","startDate","endDate"],"additionalProperties":false},"description":"このパートナーとの業務委託契約（発注）。新しい順に最大50件"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalRef","name","companyName","contactName","email","phoneNumber","address","taxRegistrationNumber","bankAccount","status","partnerOrders","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createPartner","tags":["Partners"],"summary":"パートナーを登録する（externalRef で上書き）","description":"パートナー（発注先・業務委託先）を登録します。登録したパートナーはTooonの画面にも出て、画面から直せます。\n\nexternalRef を付けると、同じ値で何度呼んでもパートナーは1人です。2回目からは、本文に含めた項目だけを書き換えます。\n\nすでに画面で登録したパートナーを呼び出し元のシステムとつなぐときは、GET /v1/partners?email= で探してから PATCH /v1/partners/{id} で externalRef を付けてください。\n\n必要な権限（scope）: `partners:write`","x-required-scopes":["partners:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"companyName":{"type":"string","maxLength":200,"nullable":true,"description":"屋号・法人名"},"contactName":{"type":"string","maxLength":200,"nullable":true,"description":"担当者名"},"email":{"type":"string","format":"email","maxLength":320,"nullable":true,"description":"メールアドレス"},"phoneNumber":{"type":"string","maxLength":50,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true,"description":"住所（請求書の請求元に載せる）"},"taxRegistrationNumber":{"type":"string","maxLength":50,"nullable":true,"description":"適格請求書発行事業者の登録番号"},"bankAccount":{"type":"string","maxLength":500,"nullable":true,"description":"振込先"},"status":{"type":"string","enum":["active","inactive"],"description":"既定 active"},"externalRef":{"type":"string","minLength":1,"maxLength":200,"description":"呼び出し元システムでの識別子。同じ値なら同じパートナーとして扱います"},"name":{"type":"string","minLength":1,"maxLength":200,"description":"表示名"}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true,"description":"住所（請求書の請求元に載せる）"},"taxRegistrationNumber":{"type":"string","nullable":true,"description":"適格請求書発行事業者の登録番号"},"bankAccount":{"type":"string","nullable":true,"description":"振込先"},"status":{"type":"string","enum":["active","inactive"]},"partnerOrders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["draft","active","completed","canceled"]},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["id","title","status","amount","currency","isIncludingTax","startDate","endDate"],"additionalProperties":false},"description":"このパートナーとの業務委託契約（発注）。新しい順に最大50件"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalRef","name","companyName","contactName","email","phoneNumber","address","taxRegistrationNumber","bankAccount","status","partnerOrders","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partners/{id}":{"get":{"operationId":"getPartner","tags":["Partners"],"summary":"パートナーを取得する","description":"必要な権限（scope）: `partners:read`","x-required-scopes":["partners:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"パートナーのID","schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true,"description":"住所（請求書の請求元に載せる）"},"taxRegistrationNumber":{"type":"string","nullable":true,"description":"適格請求書発行事業者の登録番号"},"bankAccount":{"type":"string","nullable":true,"description":"振込先"},"status":{"type":"string","enum":["active","inactive"]},"partnerOrders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["draft","active","completed","canceled"]},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["id","title","status","amount","currency","isIncludingTax","startDate","endDate"],"additionalProperties":false},"description":"このパートナーとの業務委託契約（発注）。新しい順に最大50件"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalRef","name","companyName","contactName","email","phoneNumber","address","taxRegistrationNumber","bankAccount","status","partnerOrders","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updatePartner","tags":["Partners"],"summary":"パートナーを更新する","description":"本文に含めた項目だけを書き換えます。null を送るとその項目を空にします。externalRef を付けると、画面で登録したパートナーを呼び出し元のシステムとつなげられます。\n\n必要な権限（scope）: `partners:write`","x-required-scopes":["partners:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"パートナーのID","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"companyName":{"type":"string","maxLength":200,"nullable":true,"description":"屋号・法人名"},"contactName":{"type":"string","maxLength":200,"nullable":true,"description":"担当者名"},"email":{"type":"string","format":"email","maxLength":320,"nullable":true,"description":"メールアドレス"},"phoneNumber":{"type":"string","maxLength":50,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true,"description":"住所（請求書の請求元に載せる）"},"taxRegistrationNumber":{"type":"string","maxLength":50,"nullable":true,"description":"適格請求書発行事業者の登録番号"},"bankAccount":{"type":"string","maxLength":500,"nullable":true,"description":"振込先"},"status":{"type":"string","enum":["active","inactive"],"description":"既定 active"},"externalRef":{"type":"string","minLength":1,"maxLength":200,"nullable":true,"description":"呼び出し元システムでの識別子。null で外します"},"name":{"type":"string","minLength":1,"maxLength":200,"description":"表示名"}},"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"name":{"type":"string"},"companyName":{"type":"string","nullable":true},"contactName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"address":{"type":"string","nullable":true,"description":"住所（請求書の請求元に載せる）"},"taxRegistrationNumber":{"type":"string","nullable":true,"description":"適格請求書発行事業者の登録番号"},"bankAccount":{"type":"string","nullable":true,"description":"振込先"},"status":{"type":"string","enum":["active","inactive"]},"partnerOrders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["draft","active","completed","canceled"]},"amount":{"type":"integer"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true}},"required":["id","title","status","amount","currency","isIncludingTax","startDate","endDate"],"additionalProperties":false},"description":"このパートナーとの業務委託契約（発注）。新しい順に最大50件"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalRef","name","companyName","contactName","email","phoneNumber","address","taxRegistrationNumber","bankAccount","status","partnerOrders","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partner-orders":{"post":{"operationId":"createPartnerOrder","tags":["Partner orders"],"summary":"業務委託契約を登録する（externalRef で上書き）","description":"パートナーとの業務委託契約（Tooonの「発注」）を登録します。登録した契約はTooonの画面にも出て、画面から直せます。請求書作成依頼はこの契約に対して作ります。\n\nexternalRef を付けると、同じ値で何度呼んでも契約は1件です。2回目からは、本文に含めた項目だけを書き換えます。別のパートナーの契約だったときは 409 partner_mismatch、完了（completed）か取り消し（canceled）の契約なら 409 invalid_status を返します。\n\n通貨はワークスペースの通貨です。案件・受注・予算とのつなぎ込みは画面で行います。\n\n必要な権限（scope）: `partners:write`","x-required-scopes":["partners:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","maxLength":200,"nullable":true,"description":"担当役割"},"scope":{"type":"string","maxLength":4000,"nullable":true,"description":"依頼範囲"},"isIncludingTax":{"type":"boolean","description":"金額が税込か（既定 false）"},"startDate":{"type":"string","format":"date","nullable":true,"description":"契約の開始日"},"endDate":{"type":"string","format":"date","nullable":true,"description":"契約の終了日"},"contractTerms":{"type":"string","maxLength":10000,"nullable":true,"description":"契約条件"},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"],"description":"再委託（既定 not_set）"},"status":{"type":"string","enum":["draft","active","completed","canceled"],"description":"既定 draft。completed / canceled にした契約は、その後 API から書き換えられません"},"externalRef":{"type":"string","minLength":1,"maxLength":200,"description":"呼び出し元システムでの識別子。同じ値なら同じ契約として扱います"},"partnerId":{"type":"string","minLength":1,"maxLength":100,"description":"パートナーのID。POST /v1/partners の応答や GET /v1/partners で確認できます"},"title":{"type":"string","minLength":1,"maxLength":200,"description":"契約名"},"amount":{"type":"integer","minimum":1,"maximum":10000000000,"description":"契約金額（円）"}},"required":["partnerId","title","amount"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"title":{"type":"string"},"role":{"type":"string","nullable":true,"description":"担当役割"},"scope":{"type":"string","nullable":true,"description":"依頼範囲"},"status":{"type":"string","enum":["draft","active","completed","canceled"]},"amount":{"type":"integer","description":"契約金額（円）"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true},"contractTerms":{"type":"string","nullable":true,"description":"契約条件"},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"],"description":"再委託"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalRef","partnerId","title","role","scope","status","amount","currency","isIncludingTax","startDate","endDate","contractTerms","subcontractingPolicy","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partner-orders/{id}":{"get":{"operationId":"getPartnerOrder","tags":["Partner orders"],"summary":"業務委託契約を取得する","description":"必要な権限（scope）: `partners:read`","x-required-scopes":["partners:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"業務委託契約のID","schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"title":{"type":"string"},"role":{"type":"string","nullable":true,"description":"担当役割"},"scope":{"type":"string","nullable":true,"description":"依頼範囲"},"status":{"type":"string","enum":["draft","active","completed","canceled"]},"amount":{"type":"integer","description":"契約金額（円）"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true},"contractTerms":{"type":"string","nullable":true,"description":"契約条件"},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"],"description":"再委託"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalRef","partnerId","title","role","scope","status","amount","currency","isIncludingTax","startDate","endDate","contractTerms","subcontractingPolicy","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updatePartnerOrder","tags":["Partner orders"],"summary":"業務委託契約を更新する","description":"本文に含めた項目だけを書き換えます。null を送るとその項目を空にします。externalRef を付けると、画面で登録した契約を呼び出し元のシステムとつなげられます。完了（completed）か取り消し（canceled）の契約は 409 invalid_status を返します。パートナーは変えられません。契約・請求が紐づいた発注の取消は、この汎用更新では行えません。\n\n必要な権限（scope）: `partners:write`","x-required-scopes":["partners:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"業務委託契約のID","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","maxLength":200,"nullable":true,"description":"担当役割"},"scope":{"type":"string","maxLength":4000,"nullable":true,"description":"依頼範囲"},"isIncludingTax":{"type":"boolean","description":"金額が税込か（既定 false）"},"startDate":{"type":"string","format":"date","nullable":true,"description":"契約の開始日"},"endDate":{"type":"string","format":"date","nullable":true,"description":"契約の終了日"},"contractTerms":{"type":"string","maxLength":10000,"nullable":true,"description":"契約条件"},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"],"description":"再委託（既定 not_set）"},"status":{"type":"string","enum":["draft","active","completed","canceled"],"description":"既定 draft。completed / canceled にした契約は、その後 API から書き換えられません"},"externalRef":{"type":"string","minLength":1,"maxLength":200,"nullable":true,"description":"呼び出し元システムでの識別子。null で外します"},"title":{"type":"string","minLength":1,"maxLength":200,"description":"契約名"},"amount":{"type":"integer","minimum":1,"maximum":10000000000,"description":"契約金額（円）"}},"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"title":{"type":"string"},"role":{"type":"string","nullable":true,"description":"担当役割"},"scope":{"type":"string","nullable":true,"description":"依頼範囲"},"status":{"type":"string","enum":["draft","active","completed","canceled"]},"amount":{"type":"integer","description":"契約金額（円）"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"startDate":{"type":"string","nullable":true},"endDate":{"type":"string","nullable":true},"contractTerms":{"type":"string","nullable":true,"description":"契約条件"},"subcontractingPolicy":{"type":"string","enum":["not_set","not_allowed","requires_approval","allowed_without_disclosure","allowed_with_vendor_disclosure","allowed_with_budget_disclosure"],"description":"再委託"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalRef","partnerId","title","role","scope","status","amount","currency","isIncludingTax","startDate","endDate","contractTerms","subcontractingPolicy","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partner-invoice-requests":{"get":{"operationId":"listPartnerInvoiceRequests","tags":["Partner invoice requests"],"summary":"請求書作成依頼の一覧","description":"externalRef を指定すると、その識別子の依頼だけを返します。新しい順です。\n\n必要な権限（scope）: `invoice_requests:read`","x-required-scopes":["invoice_requests:read"],"parameters":[{"name":"externalRef","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]}},{"name":"limit","in":"query","required":false,"description":"1回に返す件数（既定 50、最大 100）","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"前の応答の nextCursor","schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer","description":"明細から計算した請求額（円）"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"billingDate":{"type":"string","nullable":true},"paymentDeadline":{"type":"string","nullable":true},"expiresAt":{"type":"string","nullable":true},"buyerMessage":{"type":"string","nullable":true},"revisionReason":{"type":"string","nullable":true},"sender":{"type":"object","properties":{"name":{"type":"string","nullable":true,"description":"請求元の名前"},"companyName":{"type":"string","nullable":true,"description":"屋号・法人名"},"registrationNumber":{"type":"string","nullable":true,"description":"適格請求書発行事業者の登録番号"},"address":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true,"description":"振込先"},"remarks":{"type":"string","nullable":true,"description":"備考"}},"required":["name","companyName","registrationNumber","address","phoneNumber","bankAccount","remarks"],"additionalProperties":false,"description":"請求書の請求元と振込先。提出前はパートナーの登録情報から作った見込み、提出後は提出された内容です"},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}},"createdByApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false,"nullable":true,"description":"APIで作られた依頼なら、作成に使ったキー"},"sentAt":{"type":"string","nullable":true},"submittedAt":{"type":"string","nullable":true},"approvedAt":{"type":"string","nullable":true},"paidAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","externalRef","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","billingDate","paymentDeadline","expiresAt","buyerMessage","revisionReason","sender","lines","createdByApiKey","sentAt","submittedAt","approvedAt","paidAt","canceledAt","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createPartnerInvoiceRequest","tags":["Partner invoice requests"],"summary":"請求書作成依頼の下書きを作る（externalRef で上書き）","description":"パートナーに送る前の下書きを作ります。送るには続けて send を呼びます。\n\nexternalRef を付けると、同じ値で何度呼んでも依頼は1件です。下書き（draft）か差し戻し（needs_revision）のあいだは、この本文の内容で置き換えます。送付済みなどで直せない状態なら 409 invalid_status を返します。取り消した（canceled）依頼と同じ externalRef なら、新しい依頼を作ります。\n\n請求額（requestedAmount）は明細から計算します。\n\n必要な権限（scope）: `invoice_requests:write`","x-required-scopes":["invoice_requests:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"externalRef":{"type":"string","minLength":1,"maxLength":200,"description":"呼び出し元システムでの識別子。同じ値なら同じ依頼として扱います"},"partnerOrderId":{"type":"string","minLength":1,"maxLength":100,"description":"業務委託契約（発注）のID。GET /v1/partners で確認できます"},"billingDate":{"type":"string","format":"date","nullable":true,"description":"請求日"},"paymentDeadline":{"type":"string","format":"date","nullable":true,"description":"支払い期限"},"expiresAt":{"type":"string","format":"date-time","nullable":true,"description":"パートナーが提出できる期限"},"buyerMessage":{"type":"string","maxLength":4000,"nullable":true,"description":"パートナーへのメッセージ"},"isIncludingTax":{"type":"boolean","description":"単価が税込か。省略時は契約の設定"},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"quantity":{"type":"number","minimum":0,"maximum":1000000},"unit":{"type":"string","maxLength":20,"nullable":true},"unitPrice":{"type":"integer","minimum":1,"maximum":10000000000},"taxRate":{"type":"integer","minimum":0,"maximum":100,"description":"消費税率（%）"},"isWithholdingTax":{"type":"boolean","description":"源泉徴収の対象か（既定 false）"},"sortOrder":{"type":"integer","minimum":0,"maximum":1000}},"required":["name","quantity","unitPrice","taxRate"],"additionalProperties":false},"minItems":1,"maxItems":100,"description":"明細"}},"required":["partnerOrderId","lines"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer","description":"明細から計算した請求額（円）"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"billingDate":{"type":"string","nullable":true},"paymentDeadline":{"type":"string","nullable":true},"expiresAt":{"type":"string","nullable":true},"buyerMessage":{"type":"string","nullable":true},"revisionReason":{"type":"string","nullable":true},"sender":{"type":"object","properties":{"name":{"type":"string","nullable":true,"description":"請求元の名前"},"companyName":{"type":"string","nullable":true,"description":"屋号・法人名"},"registrationNumber":{"type":"string","nullable":true,"description":"適格請求書発行事業者の登録番号"},"address":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true,"description":"振込先"},"remarks":{"type":"string","nullable":true,"description":"備考"}},"required":["name","companyName","registrationNumber","address","phoneNumber","bankAccount","remarks"],"additionalProperties":false,"description":"請求書の請求元と振込先。提出前はパートナーの登録情報から作った見込み、提出後は提出された内容です"},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}},"createdByApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false,"nullable":true,"description":"APIで作られた依頼なら、作成に使ったキー"},"sentAt":{"type":"string","nullable":true},"submittedAt":{"type":"string","nullable":true},"approvedAt":{"type":"string","nullable":true},"paidAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","externalRef","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","billingDate","paymentDeadline","expiresAt","buyerMessage","revisionReason","sender","lines","createdByApiKey","sentAt","submittedAt","approvedAt","paidAt","canceledAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partner-invoice-requests/{id}":{"get":{"operationId":"getPartnerInvoiceRequest","tags":["Partner invoice requests"],"summary":"請求書作成依頼を取得する","description":"依頼の状態と明細を返します。パートナーが提出した後は、提出された明細と金額になります。\n\n必要な権限（scope）: `invoice_requests:read`","x-required-scopes":["invoice_requests:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"請求書作成依頼のID","schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer","description":"明細から計算した請求額（円）"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"billingDate":{"type":"string","nullable":true},"paymentDeadline":{"type":"string","nullable":true},"expiresAt":{"type":"string","nullable":true},"buyerMessage":{"type":"string","nullable":true},"revisionReason":{"type":"string","nullable":true},"sender":{"type":"object","properties":{"name":{"type":"string","nullable":true,"description":"請求元の名前"},"companyName":{"type":"string","nullable":true,"description":"屋号・法人名"},"registrationNumber":{"type":"string","nullable":true,"description":"適格請求書発行事業者の登録番号"},"address":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true,"description":"振込先"},"remarks":{"type":"string","nullable":true,"description":"備考"}},"required":["name","companyName","registrationNumber","address","phoneNumber","bankAccount","remarks"],"additionalProperties":false,"description":"請求書の請求元と振込先。提出前はパートナーの登録情報から作った見込み、提出後は提出された内容です"},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}},"createdByApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false,"nullable":true,"description":"APIで作られた依頼なら、作成に使ったキー"},"sentAt":{"type":"string","nullable":true},"submittedAt":{"type":"string","nullable":true},"approvedAt":{"type":"string","nullable":true},"paidAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","externalRef","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","billingDate","paymentDeadline","expiresAt","buyerMessage","revisionReason","sender","lines","createdByApiKey","sentAt","submittedAt","approvedAt","paidAt","canceledAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partner-invoice-requests/{id}/pdf":{"get":{"operationId":"getPartnerInvoiceRequestPdf","tags":["Partner invoice requests"],"summary":"請求書作成依頼を請求書（PDF）で取得する","description":"依頼を、パートナー（請求元）からワークスペース（宛先）への請求書の書面にして PDF で返します。Tooon の画面で見る書面と同じものです。\n\n提出後は提出された明細・事業者情報、提出前は依頼の内容で作ります。請求書番号がないときは依頼ごとに決まった番号（R-から始まる）を載せます。\n\n必要な権限（scope）: `invoice_requests:read`","x-required-scopes":["invoice_requests:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"請求書作成依頼のID","schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partner-invoice-requests/{id}/send":{"post":{"operationId":"sendPartnerInvoiceRequest","tags":["Partner invoice requests"],"summary":"請求書作成依頼をパートナーに送る","description":"依頼を送付済み（sent）にして、パートナーが確認・提出できる状態にします。パートナーが中身を確認して提出するまで、提出済みにはなりません。\n\ndelivery が tooon_email（既定）のときは、パートナーの登録メールアドレスに、請求書を確認して提出するためのリンクをTooonからメールで送ります。送付済み（sent / viewed）の依頼にもう一度呼ぶと、新しいリンクでメールを送り直します（前のリンクは使えなくなります）。状態は送付済みになったがメールを送れなかったときは 502 email_delivery_failed を返します。もう一度呼ぶと送り直せます。\n\ndelivery が none のときは、Tooonからは何も送りません。呼び出し元のアプリが自分の画面でパートナーに中身を見せ、パートナーが承認したら submit を呼びます。\n\n必要な権限（scope）: `invoice_requests:write`","x-required-scopes":["invoice_requests:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"請求書作成依頼のID","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"delivery":{"type":"string","enum":["tooon_email","none"],"description":"tooon_email（既定）：Tooonからパートナーにメールで送る。none：Tooonからは送らず、呼び出し元のアプリで見せる"}},"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer","description":"明細から計算した請求額（円）"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"billingDate":{"type":"string","nullable":true},"paymentDeadline":{"type":"string","nullable":true},"expiresAt":{"type":"string","nullable":true},"buyerMessage":{"type":"string","nullable":true},"revisionReason":{"type":"string","nullable":true},"sender":{"type":"object","properties":{"name":{"type":"string","nullable":true,"description":"請求元の名前"},"companyName":{"type":"string","nullable":true,"description":"屋号・法人名"},"registrationNumber":{"type":"string","nullable":true,"description":"適格請求書発行事業者の登録番号"},"address":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true,"description":"振込先"},"remarks":{"type":"string","nullable":true,"description":"備考"}},"required":["name","companyName","registrationNumber","address","phoneNumber","bankAccount","remarks"],"additionalProperties":false,"description":"請求書の請求元と振込先。提出前はパートナーの登録情報から作った見込み、提出後は提出された内容です"},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}},"createdByApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false,"nullable":true,"description":"APIで作られた依頼なら、作成に使ったキー"},"sentAt":{"type":"string","nullable":true},"submittedAt":{"type":"string","nullable":true},"approvedAt":{"type":"string","nullable":true},"paidAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","externalRef","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","billingDate","paymentDeadline","expiresAt","buyerMessage","revisionReason","sender","lines","createdByApiKey","sentAt","submittedAt","approvedAt","paidAt","canceledAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partner-invoice-requests/{id}/submit":{"post":{"operationId":"submitPartnerInvoiceRequest","tags":["Partner invoice requests"],"summary":"パートナーに代わって請求書を提出する","description":"呼び出し元のアプリの画面でパートナー本人が中身を確認し、承認したときに呼びます。依頼は提出済み（submitted）になり、Tooonでは支払い予定（精算）が作られます。以降の承認と支払いはTooonの画面で行います。\n\n明細と金額は依頼の内容のまま提出します。直したいときは、提出前に依頼を取り消して作り直してください。\n\nsender（請求元と振込先）で省いた項目は、パートナーの登録情報から入れます。\n\n送付済み（sent / viewed / editing）か差し戻し（needs_revision）の依頼だけ提出できます。下書き（draft）は先に send を呼んでください。それ以外は 409 invalid_status を返します。\n\n必要な権限（scope）: `invoice_requests:write`","x-required-scopes":["invoice_requests:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"請求書作成依頼のID","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"submittedBy":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"nullable":true,"description":"承認した人の名前"},"email":{"type":"string","format":"email","maxLength":320,"nullable":true,"description":"承認した人のメールアドレス（既定はパートナーのメール）"}},"additionalProperties":false,"description":"呼び出し元のアプリで承認した人。Tooonの履歴に残ります"},"invoiceNumber":{"type":"string","maxLength":100,"nullable":true,"description":"請求書番号"},"sender":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"nullable":true},"companyName":{"type":"string","maxLength":200,"nullable":true},"registrationNumber":{"type":"string","maxLength":50,"nullable":true},"address":{"type":"string","maxLength":500,"nullable":true},"phoneNumber":{"type":"string","maxLength":50,"nullable":true},"bankAccount":{"type":"string","maxLength":500,"nullable":true},"remarks":{"type":"string","maxLength":2000,"nullable":true}},"additionalProperties":false,"description":"請求元と振込先。省いた項目はパートナーの登録情報から入れます"}},"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer","description":"明細から計算した請求額（円）"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"billingDate":{"type":"string","nullable":true},"paymentDeadline":{"type":"string","nullable":true},"expiresAt":{"type":"string","nullable":true},"buyerMessage":{"type":"string","nullable":true},"revisionReason":{"type":"string","nullable":true},"sender":{"type":"object","properties":{"name":{"type":"string","nullable":true,"description":"請求元の名前"},"companyName":{"type":"string","nullable":true,"description":"屋号・法人名"},"registrationNumber":{"type":"string","nullable":true,"description":"適格請求書発行事業者の登録番号"},"address":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true,"description":"振込先"},"remarks":{"type":"string","nullable":true,"description":"備考"}},"required":["name","companyName","registrationNumber","address","phoneNumber","bankAccount","remarks"],"additionalProperties":false,"description":"請求書の請求元と振込先。提出前はパートナーの登録情報から作った見込み、提出後は提出された内容です"},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}},"createdByApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false,"nullable":true,"description":"APIで作られた依頼なら、作成に使ったキー"},"sentAt":{"type":"string","nullable":true},"submittedAt":{"type":"string","nullable":true},"approvedAt":{"type":"string","nullable":true},"paidAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","externalRef","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","billingDate","paymentDeadline","expiresAt","buyerMessage","revisionReason","sender","lines","createdByApiKey","sentAt","submittedAt","approvedAt","paidAt","canceledAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/partner-invoice-requests/{id}/cancel":{"post":{"operationId":"cancelPartnerInvoiceRequest","tags":["Partner invoice requests"],"summary":"請求書作成依頼を取り消す","description":"依頼を取り消します。送付済みのリンクは使えなくなります。支払い済み（paid）の依頼は取り消せません。\n\n必要な権限（scope）: `invoice_requests:write`","x-required-scopes":["invoice_requests:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"請求書作成依頼のID","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":2000,"nullable":true,"description":"取り消す理由（Tooonの履歴に残ります）"}},"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","editing","submitted","needs_revision","approved","scheduled_for_payment","paid","canceled"]},"externalRef":{"type":"string","nullable":true},"partnerId":{"type":"string"},"partnerOrderId":{"type":"string"},"requestedAmount":{"type":"integer","description":"明細から計算した請求額（円）"},"currency":{"type":"string"},"isIncludingTax":{"type":"boolean"},"billingDate":{"type":"string","nullable":true},"paymentDeadline":{"type":"string","nullable":true},"expiresAt":{"type":"string","nullable":true},"buyerMessage":{"type":"string","nullable":true},"revisionReason":{"type":"string","nullable":true},"sender":{"type":"object","properties":{"name":{"type":"string","nullable":true,"description":"請求元の名前"},"companyName":{"type":"string","nullable":true,"description":"屋号・法人名"},"registrationNumber":{"type":"string","nullable":true,"description":"適格請求書発行事業者の登録番号"},"address":{"type":"string","nullable":true},"phoneNumber":{"type":"string","nullable":true},"bankAccount":{"type":"string","nullable":true,"description":"振込先"},"remarks":{"type":"string","nullable":true,"description":"備考"}},"required":["name","companyName","registrationNumber","address","phoneNumber","bankAccount","remarks"],"additionalProperties":false,"description":"請求書の請求元と振込先。提出前はパートナーの登録情報から作った見込み、提出後は提出された内容です"},"lines":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"quantity":{"type":"number"},"unit":{"type":"string","nullable":true},"unitPrice":{"type":"integer"},"taxRate":{"type":"integer"},"isWithholdingTax":{"type":"boolean"},"sortOrder":{"type":"integer"}},"required":["name","quantity","unit","unitPrice","taxRate","isWithholdingTax","sortOrder"],"additionalProperties":false}},"createdByApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false,"nullable":true,"description":"APIで作られた依頼なら、作成に使ったキー"},"sentAt":{"type":"string","nullable":true},"submittedAt":{"type":"string","nullable":true},"approvedAt":{"type":"string","nullable":true},"paidAt":{"type":"string","nullable":true},"canceledAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","status","externalRef","partnerId","partnerOrderId","requestedAmount","currency","isIncludingTax","billingDate","paymentDeadline","expiresAt","buyerMessage","revisionReason","sender","lines","createdByApiKey","sentAt","submittedAt","approvedAt","paidAt","canceledAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/people":{"get":{"operationId":"listPeople","tags":["People"],"summary":"メンバー（会社の人）の一覧・検索","description":"ワークスペースに登録された会社の人（社員・役員・業務委託のスタッフなど）を返します。Tooonにログインする利用者とは別です。email は大文字小文字を区別せずに完全一致で絞り込みます。\n\n必要な権限（scope）: `people:read`","x-required-scopes":["people:read"],"parameters":[{"name":"email","in":"query","required":false,"description":"メールアドレスで絞り込み（完全一致）","schema":{"type":"string","maxLength":320}},{"name":"externalRef","in":"query","required":false,"description":"呼び出し元システムでの識別子で絞り込み","schema":{"type":"string","maxLength":200}},{"name":"partnerId","in":"query","required":false,"description":"つながっているパートナーで絞り込み","schema":{"type":"string","maxLength":100}},{"name":"limit","in":"query","required":false,"description":"1回に返す件数（既定 50、最大 100）","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"前の応答の nextCursor","schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"name":{"type":"string"},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"kind":{"type":"string","enum":["corporate","partner"],"description":"corporate＝コーポレートメンバー（社員・役員・家族など事業主の内側の人）、partner＝パートナーメンバー（業務委託など）"},"status":{"type":"string","enum":["active","inactive"]},"partnerId":{"type":"string","nullable":true,"description":"業務委託などでお金の約束があるとき、その相手のパートナー"},"businessCardId":{"type":"string","nullable":true,"description":"この人のデジタル名刺。まだ無ければ null"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalRef","name","email","phone","jobTitle","department","kind","status","partnerId","businessCardId","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createPerson","tags":["People"],"summary":"メンバー（会社の人）を登録する（externalRef で上書き）","description":"会社の人（社員・役員・業務委託のスタッフなど）を登録します。Tooonにログインする必要はありません。登録した人はTooonの「メンバー」にも出て、画面から直せます。\n\nexternalRef を付けると、同じ値で何度呼んでも1人です。2回目からは、本文に含めた項目だけを書き換えます。\n\n業務委託の人は、パートナー（POST /v1/partners）を登録してから partnerId でつなぐと、請求書作成依頼と名刺が同じ人にまとまります。\n\n必要な権限（scope）: `people:write`","x-required-scopes":["people:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":320,"nullable":true},"phone":{"type":"string","maxLength":64,"nullable":true},"jobTitle":{"type":"string","maxLength":80,"nullable":true,"description":"肩書き"},"department":{"type":"string","maxLength":80,"nullable":true,"description":"所属・部署（表示用）"},"kind":{"type":"string","enum":["corporate","partner"],"description":"既定 corporate。業務委託などは partner"},"status":{"type":"string","enum":["active","inactive"],"description":"既定 active。辞めた人は inactive"},"partnerId":{"type":"string","minLength":1,"maxLength":100,"nullable":true,"description":"業務委託などでお金の約束がある相手のパートナーとつなぐ。null で外します"},"externalRef":{"type":"string","minLength":1,"maxLength":200,"description":"呼び出し元システムでの識別子。同じ値なら同じ人として扱います"},"name":{"type":"string","minLength":1,"maxLength":200,"description":"氏名"}},"required":["name"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"name":{"type":"string"},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"kind":{"type":"string","enum":["corporate","partner"],"description":"corporate＝コーポレートメンバー（社員・役員・家族など事業主の内側の人）、partner＝パートナーメンバー（業務委託など）"},"status":{"type":"string","enum":["active","inactive"]},"partnerId":{"type":"string","nullable":true,"description":"業務委託などでお金の約束があるとき、その相手のパートナー"},"businessCardId":{"type":"string","nullable":true,"description":"この人のデジタル名刺。まだ無ければ null"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalRef","name","email","phone","jobTitle","department","kind","status","partnerId","businessCardId","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/people/{id}":{"get":{"operationId":"getPerson","tags":["People"],"summary":"メンバー（会社の人）を取得する","description":"必要な権限（scope）: `people:read`","x-required-scopes":["people:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"メンバー（人）のID","schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"name":{"type":"string"},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"kind":{"type":"string","enum":["corporate","partner"],"description":"corporate＝コーポレートメンバー（社員・役員・家族など事業主の内側の人）、partner＝パートナーメンバー（業務委託など）"},"status":{"type":"string","enum":["active","inactive"]},"partnerId":{"type":"string","nullable":true,"description":"業務委託などでお金の約束があるとき、その相手のパートナー"},"businessCardId":{"type":"string","nullable":true,"description":"この人のデジタル名刺。まだ無ければ null"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalRef","name","email","phone","jobTitle","department","kind","status","partnerId","businessCardId","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updatePerson","tags":["People"],"summary":"メンバー（会社の人）を更新する","description":"本文に含めた項目だけを書き換えます。null を送るとその項目を空にします。\n\n必要な権限（scope）: `people:write`","x-required-scopes":["people:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"メンバー（人）のID","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":320,"nullable":true},"phone":{"type":"string","maxLength":64,"nullable":true},"jobTitle":{"type":"string","maxLength":80,"nullable":true,"description":"肩書き"},"department":{"type":"string","maxLength":80,"nullable":true,"description":"所属・部署（表示用）"},"kind":{"type":"string","enum":["corporate","partner"],"description":"既定 corporate。業務委託などは partner"},"status":{"type":"string","enum":["active","inactive"],"description":"既定 active。辞めた人は inactive"},"partnerId":{"type":"string","minLength":1,"maxLength":100,"nullable":true,"description":"業務委託などでお金の約束がある相手のパートナーとつなぐ。null で外します"},"externalRef":{"type":"string","minLength":1,"maxLength":200,"nullable":true,"description":"呼び出し元システムでの識別子。null で外します"},"name":{"type":"string","minLength":1,"maxLength":200,"description":"氏名"}},"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"externalRef":{"type":"string","nullable":true},"name":{"type":"string"},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"kind":{"type":"string","enum":["corporate","partner"],"description":"corporate＝コーポレートメンバー（社員・役員・家族など事業主の内側の人）、partner＝パートナーメンバー（業務委託など）"},"status":{"type":"string","enum":["active","inactive"]},"partnerId":{"type":"string","nullable":true,"description":"業務委託などでお金の約束があるとき、その相手のパートナー"},"businessCardId":{"type":"string","nullable":true,"description":"この人のデジタル名刺。まだ無ければ null"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","externalRef","name","email","phone","jobTitle","department","kind","status","partnerId","businessCardId","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/business-cards":{"get":{"operationId":"listBusinessCards","tags":["Business cards"],"summary":"名刺の一覧・検索","description":"ワークスペースのデジタル名刺を返します（アーカイブしたものを除く）。持ち主の人（personId）で絞り込めます。\n\n必要な権限（scope）: `business_cards:read`","x-required-scopes":["business_cards:read"],"parameters":[{"name":"personId","in":"query","required":false,"description":"持ち主の人で絞り込み","schema":{"type":"string","maxLength":100}},{"name":"limit","in":"query","required":false,"description":"1回に返す件数（既定 50、最大 100）","schema":{"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"description":"前の応答の nextCursor","schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string","nullable":true,"description":"名刺の持ち主の人（GET /v1/people）"},"status":{"type":"string","enum":["draft","published","unpublished","archived"]},"name":{"type":"string","nullable":true,"description":"表示する氏名"},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"bio":{"type":"string","nullable":true,"description":"自己紹介"},"image":{"type":"string","nullable":true,"description":"顔写真のURL"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"},"type":{"type":"string","enum":["website","social","email","phone","other"]}},"required":["label","url","type"],"additionalProperties":false},"description":"公開するリンク（並び順どおり）"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"description":"名刺に表示する項目。テンプレートが付いているときはテンプレートの設定が優先されます"},"pageId":{"type":"string","description":"公開URLの末尾"},"publicUrl":{"type":"string","nullable":true,"description":"公開ページのURL。status が published のときだけ開けます"},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","personId","status","name","jobTitle","department","email","phone","bio","image","links","visibleFields","pageId","publicUrl","publishedAt","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"type":"string","nullable":true,"description":"続きがあるときに次の呼び出しの cursor に渡す値"}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createBusinessCard","tags":["Business cards"],"summary":"人の名刺を作る（あれば上書き）","description":"人（personId）の名刺を下書きで作ります。氏名・メール・肩書き・所属は、本文で省くと人の登録内容から写します。作った名刺はTooonの名刺一覧にも出て、画面から直せます。\n\n1人につき名刺は1枚です。すでにあれば、本文に含めた項目だけを書き換えます。公開するには POST /v1/business-cards/{id}/publish を呼んでください。\n\n人は POST /v1/people で登録し、GET /v1/people?externalRef= で探せます。\n\n必要な権限（scope）: `business_cards:write`","x-required-scopes":["business_cards:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":80,"nullable":true,"description":"表示する氏名。null ならメンバーの名前を使います"},"jobTitle":{"type":"string","maxLength":80,"nullable":true},"department":{"type":"string","maxLength":80,"nullable":true,"description":"部署。画面で部署ごとのテンプレートを決めていれば、そのデザインになります"},"email":{"type":"string","format":"email","maxLength":320,"nullable":true},"phone":{"type":"string","maxLength":64,"nullable":true},"bio":{"type":"string","maxLength":5000,"nullable":true,"description":"自己紹介"},"image":{"type":"string","maxLength":2048,"nullable":true,"description":"顔写真のURL（https）"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","maxLength":2048},"type":{"type":"string","enum":["website","social","email","phone","other"],"description":"既定 website"}},"required":["label","url"],"additionalProperties":false},"maxItems":20,"description":"公開するリンク。送ると、今のリンクをすべてこの並びに置き換えます"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"minItems":1,"description":"名刺に表示する項目。name を含めないと公開できません"},"pageId":{"type":"string","minLength":1,"maxLength":80,"description":"公開URLの末尾（カスタムURL）。半角英小文字・数字・ハイフンで3〜40文字。前のURLは新しいURLへ移ります"},"personId":{"type":"string","minLength":1,"maxLength":100,"description":"名刺の持ち主の人"}},"required":["personId"],"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string","nullable":true,"description":"名刺の持ち主の人（GET /v1/people）"},"status":{"type":"string","enum":["draft","published","unpublished","archived"]},"name":{"type":"string","nullable":true,"description":"表示する氏名"},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"bio":{"type":"string","nullable":true,"description":"自己紹介"},"image":{"type":"string","nullable":true,"description":"顔写真のURL"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"},"type":{"type":"string","enum":["website","social","email","phone","other"]}},"required":["label","url","type"],"additionalProperties":false},"description":"公開するリンク（並び順どおり）"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"description":"名刺に表示する項目。テンプレートが付いているときはテンプレートの設定が優先されます"},"pageId":{"type":"string","description":"公開URLの末尾"},"publicUrl":{"type":"string","nullable":true,"description":"公開ページのURL。status が published のときだけ開けます"},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","personId","status","name","jobTitle","department","email","phone","bio","image","links","visibleFields","pageId","publicUrl","publishedAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/business-cards/{id}":{"get":{"operationId":"getBusinessCard","tags":["Business cards"],"summary":"名刺を取得する","description":"必要な権限（scope）: `business_cards:read`","x-required-scopes":["business_cards:read"],"parameters":[{"name":"id","in":"path","required":true,"description":"名刺のID","schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string","nullable":true,"description":"名刺の持ち主の人（GET /v1/people）"},"status":{"type":"string","enum":["draft","published","unpublished","archived"]},"name":{"type":"string","nullable":true,"description":"表示する氏名"},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"bio":{"type":"string","nullable":true,"description":"自己紹介"},"image":{"type":"string","nullable":true,"description":"顔写真のURL"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"},"type":{"type":"string","enum":["website","social","email","phone","other"]}},"required":["label","url","type"],"additionalProperties":false},"description":"公開するリンク（並び順どおり）"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"description":"名刺に表示する項目。テンプレートが付いているときはテンプレートの設定が優先されます"},"pageId":{"type":"string","description":"公開URLの末尾"},"publicUrl":{"type":"string","nullable":true,"description":"公開ページのURL。status が published のときだけ開けます"},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","personId","status","name","jobTitle","department","email","phone","bio","image","links","visibleFields","pageId","publicUrl","publishedAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"operationId":"updateBusinessCard","tags":["Business cards"],"summary":"名刺を更新する","description":"本文に含めた項目だけを書き換えます。null を送るとその項目を空にします。公開中の名刺は、公開し直すまで公開ページは変わりません。\n\n必要な権限（scope）: `business_cards:write`","x-required-scopes":["business_cards:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"名刺のID","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":80,"nullable":true,"description":"表示する氏名。null ならメンバーの名前を使います"},"jobTitle":{"type":"string","maxLength":80,"nullable":true},"department":{"type":"string","maxLength":80,"nullable":true,"description":"部署。画面で部署ごとのテンプレートを決めていれば、そのデザインになります"},"email":{"type":"string","format":"email","maxLength":320,"nullable":true},"phone":{"type":"string","maxLength":64,"nullable":true},"bio":{"type":"string","maxLength":5000,"nullable":true,"description":"自己紹介"},"image":{"type":"string","maxLength":2048,"nullable":true,"description":"顔写真のURL（https）"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"url":{"type":"string","maxLength":2048},"type":{"type":"string","enum":["website","social","email","phone","other"],"description":"既定 website"}},"required":["label","url"],"additionalProperties":false},"maxItems":20,"description":"公開するリンク。送ると、今のリンクをすべてこの並びに置き換えます"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"minItems":1,"description":"名刺に表示する項目。name を含めないと公開できません"},"pageId":{"type":"string","minLength":1,"maxLength":80,"description":"公開URLの末尾（カスタムURL）。半角英小文字・数字・ハイフンで3〜40文字。前のURLは新しいURLへ移ります"}},"additionalProperties":false}}}},"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string","nullable":true,"description":"名刺の持ち主の人（GET /v1/people）"},"status":{"type":"string","enum":["draft","published","unpublished","archived"]},"name":{"type":"string","nullable":true,"description":"表示する氏名"},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"bio":{"type":"string","nullable":true,"description":"自己紹介"},"image":{"type":"string","nullable":true,"description":"顔写真のURL"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"},"type":{"type":"string","enum":["website","social","email","phone","other"]}},"required":["label","url","type"],"additionalProperties":false},"description":"公開するリンク（並び順どおり）"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"description":"名刺に表示する項目。テンプレートが付いているときはテンプレートの設定が優先されます"},"pageId":{"type":"string","description":"公開URLの末尾"},"publicUrl":{"type":"string","nullable":true,"description":"公開ページのURL。status が published のときだけ開けます"},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","personId","status","name","jobTitle","department","email","phone","bio","image","links","visibleFields","pageId","publicUrl","publishedAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/business-cards/{id}/publish":{"post":{"operationId":"publishBusinessCard","tags":["Business cards"],"summary":"名刺を公開する","description":"今の中身で名刺を公開します（公開中なら、今の中身で公開し直します）。公開すると publicUrl が開けるようになります。氏名を表示項目に含めていないと公開できません。\n\n必要な権限（scope）: `business_cards:write`","x-required-scopes":["business_cards:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"名刺のID","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string","nullable":true,"description":"名刺の持ち主の人（GET /v1/people）"},"status":{"type":"string","enum":["draft","published","unpublished","archived"]},"name":{"type":"string","nullable":true,"description":"表示する氏名"},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"bio":{"type":"string","nullable":true,"description":"自己紹介"},"image":{"type":"string","nullable":true,"description":"顔写真のURL"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"},"type":{"type":"string","enum":["website","social","email","phone","other"]}},"required":["label","url","type"],"additionalProperties":false},"description":"公開するリンク（並び順どおり）"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"description":"名刺に表示する項目。テンプレートが付いているときはテンプレートの設定が優先されます"},"pageId":{"type":"string","description":"公開URLの末尾"},"publicUrl":{"type":"string","nullable":true,"description":"公開ページのURL。status が published のときだけ開けます"},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","personId","status","name","jobTitle","department","email","phone","bio","image","links","visibleFields","pageId","publicUrl","publishedAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/business-cards/{id}/unpublish":{"post":{"operationId":"unpublishBusinessCard","tags":["Business cards"],"summary":"名刺を非公開にする","description":"公開ページを閉じます。中身は残るので、もう一度公開できます。\n\n必要な権限（scope）: `business_cards:write`","x-required-scopes":["business_cards:write"],"parameters":[{"name":"id","in":"path","required":true,"description":"名刺のID","schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"Idempotency-Key","in":"header","required":false,"description":"通信が切れてやり直すときに同じ値を送ると、24時間は1回目と同じ結果を返し、処理を二重に行いません","schema":{"type":"string","maxLength":255}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"personId":{"type":"string","nullable":true,"description":"名刺の持ち主の人（GET /v1/people）"},"status":{"type":"string","enum":["draft","published","unpublished","archived"]},"name":{"type":"string","nullable":true,"description":"表示する氏名"},"jobTitle":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"bio":{"type":"string","nullable":true,"description":"自己紹介"},"image":{"type":"string","nullable":true,"description":"顔写真のURL"},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string"},"type":{"type":"string","enum":["website","social","email","phone","other"]}},"required":["label","url","type"],"additionalProperties":false},"description":"公開するリンク（並び順どおり）"},"visibleFields":{"type":"array","items":{"type":"string","enum":["name","image","jobTitle","department","email","phone","bio"]},"description":"名刺に表示する項目。テンプレートが付いているときはテンプレートの設定が優先されます"},"pageId":{"type":"string","description":"公開URLの末尾"},"publicUrl":{"type":"string","nullable":true,"description":"公開ページのURL。status が published のときだけ開けます"},"publishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","personId","status","name","jobTitle","department","email","phone","bio","image","links","visibleFields","pageId","publicUrl","publishedAt","createdAt","updatedAt"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/company-page":{"get":{"operationId":"getCompanyPage","tags":["Company page"],"summary":"会社のページを取得","description":"このワークスペースの会社のページ（紹介、会社概要、公開中の提供メニューと実績、載せているメンバー）を返します。自社サイトや自社アプリに、Tooon と同じ中身を表示するときに使います（例: 自社サイトのメンバーページ）。下書き・非公開のメニューと実績、実績のクライアント名、会社のページから外した名刺は返しません。\n\n必要な権限（scope）: `company_page:read`","x-required-scopes":["company_page:read"],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"object","properties":{"isPublic":{"type":"boolean","description":"会社のページを公開しているか。false のときは外に出さない前提で扱う"},"url":{"type":"string","nullable":true,"description":"Tooon の Network での会社のページのURL"},"name":{"type":"string","nullable":true},"heading":{"type":"string","nullable":true,"description":"ひとこと（見出し）"},"description":{"type":"string","nullable":true,"description":"短い紹介"},"summary":{"type":"string","nullable":true,"description":"紹介文"},"image":{"type":"string","nullable":true,"description":"アイコン画像のURL"},"headerImage":{"type":"string","nullable":true,"description":"ヘッダー画像のURL"},"availability":{"type":"string","enum":["open","selective","busy","closed"],"description":"open: 受付中 / selective: 内容による / busy: 余裕なし / closed: 受け付けていない"},"skills":{"type":"array","items":{"type":"string"}},"links":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}},"required":["name","url"],"additionalProperties":false}},"menus":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"priceType":{"type":"string","enum":["fixed","hourly","free","consultation","none"],"description":"fixed: 固定報酬 / hourly: 時間単価 / free: 無料 / consultation: 要相談 / none: 未設定"},"price":{"type":"integer","nullable":true,"description":"円。fixed と hourly のときだけ入る"},"deliveryDays":{"type":"integer","nullable":true,"description":"納期の目安（日）"},"thumbnail":{"type":"string","nullable":true},"accepting":{"type":"boolean","description":"いま相談を受け付けているか"}},"required":["id","title","description","priceType","price","deliveryDays","thumbnail","accepting"],"additionalProperties":false},"description":"公開中の提供メニュー（新しい順）"},"portfolios":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"thumbnail":{"type":"string","nullable":true}},"required":["id","title","thumbnail"],"additionalProperties":false},"description":"公開中の実績（新しい順）"},"overview":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"],"additionalProperties":false},"description":"会社概要（会社名・代表者・所在地など、項目と内容の行）"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"image":{"type":"string","nullable":true,"description":"写真のURL"},"jobTitle":{"type":"string","nullable":true,"description":"肩書き"},"department":{"type":"string","nullable":true,"description":"部門（名刺の部門）。メンバーを部門ごとに分けるときに使う"},"cardUrl":{"type":"string","nullable":true,"description":"その人のデジタル名刺のURL（会社サイトの下）"}},"required":["id","name","image","jobTitle","department","cardUrl"],"additionalProperties":false},"description":"会社のページに載せているメンバー（会社のページで選んだ公開中の名刺を、選んだ順に）"},"siteUrl":{"type":"string","nullable":true,"description":"会社サイト（◯◯.tooon.site）のURL。会社のページが非公開なら null"}},"required":["isPublic","url","name","heading","description","summary","image","headerImage","availability","skills","links","menus","portfolios","overview","members","siteUrl"],"additionalProperties":false}}}}}},"default":{"description":"エラー","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Authorization: Bearer tooon_sk_..."}},"schemas":{"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","requestId"],"properties":{"code":{"type":"string","description":"エラーの種類（unauthorized, forbidden, insufficient_scope, not_found, invalid_request, rate_limited, idempotency_key_reused など）"},"message":{"type":"string"},"requestId":{"type":"string","description":"問い合わせ時に伝えてください"}}}}}}}}