> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# チャージ請求書API：銀行振込で支払う

> APIからDiditのチャージ請求書を作成し、45日以内に銀行振込で支払えます。クレジット額は$1,000～$20,000、振込先情報とPDF付きです。

Didit のチャージ請求書 API は、USD建ての請求書を発行します。財務チームがこの請求書を銀行振込で支払うと、残高にクレジットが追加されます。振込は、どの銀行からでも45日以内に行えます。
これは、コンソールの「チャージ」ダイアログで作成されるものと同じ請求書です。

チャージ請求書作成プロンプト
        プロンプトをクリップボードにコピー



      
      

\<pre>

\`Goal: Create a Didit top-up invoice that the organization's finance team pays by bank transfer, so the balance is topped up without a card.

Endpoint: POST https://verification.didit.me/v3/billing/top-up-invoices/
Auth header: x-api-key: <DIDIT_API_KEY>
Idempotency-Key header: REQUIRED, 1 to 255 characters. One new key per invoice you intend to create; store it and reuse it ONLY to retry that same request.
Content-Type: application/json

Request body:
\- amount_in_dollars (number, REQUIRED): the credit to add, in USD, from 1,000 to 20,000, at most two decimals. Tax is added to the invoice when it applies.
\- po_number (string, optional, up to 140 characters): printed on the invoice.

curl:
curl -X POST 'https://verification.didit.me/v3/billing/top-up-invoices/' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: 0b8e6f4a-3c2d-4e1f-9a7b-5d6c8e2f1a30' \
-d '{"amount_in_dollars": 5000, "po_number": "PO-88213"}'

Response 201: the invoice { id, lane: "bank_transfer", status, credit_amount, total, tax, currency, amount_received, amount_credited, amount_open, invoice_number, hosted_invoice_url, invoice_pdf, po_number, due_at, confirmed_at, closed_at, created_at, bank_details: { currency, amount_due, account_holder_name, bank_name, account_number, routing_number, swift_code, reference } or null }

Before telling anyone to pay, read status and amount_open: a retry with the same key returns the same invoice in its CURRENT state, even paid, cancelled or expired. Give payment instructions ONLY while status is open or part_paid and amount_open is above 0.
To pay: transfer amount_open (not credit_amount: total includes tax) to bank_details, with invoice_number as the reference. routing_number is for ACH and US wires, swift_code for international wires. If bank_details is null, use hosted_invoice_url. The billing contacts also receive the invoice by email.
Credit: only what arrives is added, when it arrives. A part payment adds credit in proportion to the share of total it pays; the rest stays open with the same reference until due_at (45 days after issue). After due_at the status is expired; a transfer that still arrives with the reference is added for what it pays.
Follow it with GET /v3/billing/top-up-invoices/{top_up_id}/ and stop once status is paid, expired, cancelled or failed. Use due_at as returned (45 days after issue for new invoices). Settle on status and the amounts, never on confirmed_at (also set by a part payment) or closed_at (null for a paid invoice).

Errors (objects with code and detail, except field errors, which name the field):
\- 400 field error on amount_in_dollars (below 1,000, above 20,000, more than two decimals); idempotency_key_required (missing, blank or longer than 255 characters); a body that is not valid JSON (detail only); billing_details_required (missing lists the fields a person saves once in the console's billing details)
\- 404 billing_not_available
\- 409 top_up_invoice_open (open_invoice is the invoice still open or part paid: pay what it owes or wait for it to expire; it can be cancelled in the console only while nothing has arrived), idempotency_key_conflict (same key with another amount or from another API key), top_up_not_completed (an earlier request with this key could not issue its invoice: nothing was issued, create it again with a NEW key), top_up_not_allowed (annual Enterprise contract), billing_customer_missing
\- 502 payment_provider_error (the state could not be confirmed): retry with the SAME key. It returns the invoice if it was issued, or 409 top_up_not_completed if not; only then use a NEW key.`

\</pre>



      
      

貼り付け先

## 仕組み1) [クレジット残高を取得](https://docs.didit.me/ja/management-api/billing/balance.md)でクレジットの残高を確認します。
2) 必要なクレジット分の請求書を、新しい`Idempotency-Key`を付けて作成します。金額は$1,000から$20,000までです。
3) `bank_details`に記載の口座に`amount_open`を振り込みます。振込時の参照番号には`invoice_number`を使用します。
4) `status`が`paid`になるか、`expired`または`cancelled`として終了するまで、[チャージ用の請求書を取得](https://docs.didit.me/ja/management-api/billing/get-top-up-invoice.md)で状態を確認します。## 支払い内容と受け取り内容- `amount_in_dollars`は追加するクレジットです。該当する場合は税金が請求書に加算されるため、振込額である`total`は`credit_amount`より高くなることがあります。
- 残高に加算されるのは、実際に入金された金額だけです。加算は入金されたタイミングで行われます。
- 一部入金の場合、支払われた`total`の割合に応じてクレジットが加算されます。残りは同じ参照番号のまま未払いの状態で残り、`due_at`までが期限です。
- `due_at`は請求書に記載された支払期日で、発行日から45日後です。返された値を使用してください。以前の条件で発行された請求書は、独自の期日を維持します。
- `due_at`までに`total`の全額が入金されなかった場合、請求書は`expired`になります。期限後も参照番号付きで到着した振込については、支払われた金額分が加算されます。
- `routing_number`は ACHおよび米国のワイヤー送金用、`swift_code`は国際送金用です。`bank_details`がnullの場合、`hosted_invoice_url`に同じ口座情報が表示されます。
- 請求先の連絡担当者にも、請求書がメールで届きます。## 最初の請求書の前に- 担当者が、コンソールの請求情報に会社の法的名称と住所を一度保存します。保存するまで、リクエストは`missing`フィールドを含む`400 billing_details_required`を返します。
- チャージ用の請求書は、Free、Growth、Scaleの各プランでご利用いただけます。年間のEnterprise契約では`409 top_up_not_allowed`が返されます。## 冪等性と再試行- 作成する請求書ごとに`Idempotency-Key`を1つ使用し、保存してください。同じキーは、そのリクエストを再試行する場合に限り再利用します。
- キーがない場合、空白の場合、または255文字を超える場合は、`400 idempotency_key_required`が返されます。
- 同じキーと金額を同じ認証情報から送信すると、支払い済み、キャンセル済み、期限切れであっても、現在の状態の請求書が返されます。支払い手順を案内するのは、`status`が`open`または`part_paid`で、かつ`amount_open`が0より大きい場合に限ります。
- 同じキーで別の金額を指定した場合、または別の認証情報から送信した場合は、`409 idempotency_key_conflict`が返されます。
- `502 payment_provider_error`は、請求書の状態を確認できなかったことを意味します。同じキーで再試行してください。請求書が発行されていればその請求書が返され、何も発行されていなければ`409 top_up_not_completed`が返されます。何も発行されていなかった場合にのみ、新しいキーで新しい請求書を作成してください。## 同時に保有できる請求書は1件請求書のステータスが`open`または`part_paid`の間は、新たに請求書を作成すると`409 top_up_invoice_open`が返され、エラーの`open_invoice`フィールドに既存の請求書が示されます。
未払い分を支払うか、請求書が期限切れになるまで待ってください。
コンソールでユーザーが請求書をキャンセルできるのは、入金が一切ない場合に限られます。## エラー| HTTP | `code` | 意味 |
| - | - | - |
| 400 | `amount_in_dollars` のフィールドエラー | 金額が$1,000を下回る、$20,000を超える、または小数点以下が2桁を超える場合です。 |
| 400 | `idempotency_key_required` | `Idempotency-Key` ヘッダーが指定されていない、空白である、または255文字を超えている場合です。 |
| 400 | なし（`detail` のみ） | リクエスト本文が有効なJSONではありません。 |
| 400 | `billing_details_required` | 請求書には貴社の正式名称と住所が必要です。`missing` には不足している項目が一覧で示されます。 |
| 404 | `billing_not_available` | お客様の組織ではまだ請求機能をご利用いただけません。 |
| 409 | `top_up_invoice_open` | 別の請求書が未決済または一部入金済みです。`open_invoice` でその請求書を確認できます。 |
| 409 | `idempotency_key_conflict` | このキーは別の金額で、または別のAPIキーによって使用されています。 |
| 409 | `top_up_not_completed` | このキーを使った以前のリクエストでは請求書を発行できませんでした。請求書は発行されていません。新しいキーで新しい請求書を作成してください。 |
| 409 | `top_up_not_allowed` | Enterpriseプランの年間契約ではチャージできません。 |
| 409 | `billing_customer_missing` | お客様の組織にはまだ請求アカウントがありません。担当者がコンソールで請求を設定します。 |
| 502 | `payment_provider_error` | 請求書の状態を確認できませんでした。同じキーで再試行してください。 |カードでチャージする場合は、[クレジットのチャージ](https://docs.didit.me/ja/management-api/billing/top-up.md)を参照してください。


## OpenAPI

````yaml ja/openapi-25.json POST /v3/billing/top-up-invoices/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: 本人確認API。x-api-keyヘッダーで認証します。
servers:
  - url: https://verification.didit.me
security: []
tags:
  - name: Bank Data
    description: >-
      Bank
      Link、接続、口座、残高、取引、金融機関、対応範囲に関するAPIです。実際の銀行に対する1回限りの読み取りは、本番アプリケーションで利用できます。実際の銀行への継続的なアクセスは、本番アプリケーションではまだ利用できません。サンドボックスアプリケーションでDidit
      Test Bankを使う場合に限り利用でき、国ごとに順次開放されます。サンドボックスでは料金は発生しません。


      APIキーを使った呼び出しには、銀行データにアクセスできるキーが必要です。フルアクセスのキーであればアクセスできます。スコープ付きのキーの場合は、スコープに`bank-data`を含める必要があります（読み取りはread、変更を伴う操作はwrite）。このスコープがないスコープ付きキーは拒否され、呼び出しは`403
      bank_data_access_denied`を返します。口座確認は例外です。口座確認には、セッションへの書き込みアクセス、またはフルアクセスが必要で、Bank
      dataスコープは必要ありません。生の銀行データ（口座、残高、取引、変更フィード）も、APIキーを含まないリクエストは拒否します。


      `/v3/bank/`配下で、口座確認以外のすべての拒否応答は、同じJSON本文を返します（`code`、`message`、`request_id`、`field`、`next_action`、`retry_after`）。操作ではないパス、UUIDではないID、未知のサブリソースは、すべてのメソッドで`404
      not_found`を返します。予期しないエラーは、`request_id`を含む`500
      internal_error`を返します。銀行データが利用できない場合、すべての操作は未知のルートと同じく、プラットフォーム標準の`404`を返します。
paths:
  /v3/billing/top-up-invoices/:
    post:
      tags:
        - Billing
      summary: チャージ用請求書を作成
      description: >-
        USD建ての請求書を発行し、任意の銀行から**45日**以内に銀行振込で支払われた時点で組織の残高にチャージします。これは、コンソールのチャージダイアログで利用者が作成するものと同じ請求書です。チャージを自動化する財務チーム向けです。`GET
        /v3/billing/balance/`を監視し、請求書を作成して支払い、`GET
        /v3/billing/top-up-invoices/{top_up_id}/`で追跡してください。


        - **金額。**
        `amount_in_dollars`がクレジット額で、**\$1,000から\$20,000**までの範囲で、小数点以下は2桁までです。税金が適用される場合は請求書に加算されるため、`total`（振込額）が`credit_amount`より大きくなることがあります。

        - **支払い方法。**
        `status`が`open`または`part_paid`で、かつ`amount_open`が0より大きい間は、`invoice_number`を振込の参照番号として、`bank_details`に記載された口座へ`amount_open`を振り込んでください。口座情報は、ACHおよび米国内の送金では`routing_number`、国際送金では`swift_code`で示されます。組織の請求連絡先にも請求書がメールで届き、`hosted_invoice_url`と`invoice_pdf`に同じ内容が表示されます。`bank_details`がnullの場合は、`hosted_invoice_url`を使用してください。

        - **クレジット反映。**
        入金された分だけ、入金されたタイミングで加算されます。`total`の全額が振り込まれると`credit_amount`がクレジットとして加算されます。一部入金の場合は、支払われた`total`の割合に応じてクレジットが加算されます。残りは同じ参照番号のまま未払いの状態で、請求書に記載された期日`due_at`まで保留されます。期日までに`total`の全額が入金されなかった場合、ステータスは`expired`になります。期限切れ後も参照番号付きで振込が届いた場合は、その支払額分が加算されます。

        - **同時に1件のみ。** 請求書が未払い（open）または一部入金（part
        paid）の間に別の請求書を作成しようとすると、`409`の`top_up_invoice_open`が返され、`open_invoice`が含まれます。未払い分を支払うか、期限切れになるまで待ってください。利用者はコンソールから請求書をキャンセルできますが、入金が1件も届いていない間に限られます。

        - **請求情報。**
        請求書は、会社の正式名称と住所宛てに発行されます。これらはコンソールの請求情報で一度保存する必要があります。保存されるまでは、リクエストは`400`の`billing_details_required`を返し、不足しているフィールドを`missing`に示します。

        - **プラン。**
        チャージを利用できるFree、Growth、Scaleプランで利用可能です。年間契約のEnterpriseは`409`の`top_up_not_allowed`を返します。


        **冪等性。**
        `Idempotency-Key`ヘッダーは必須です。キーがない、空である、または255文字を超える場合は、`400`の`idempotency_key_required`を返します。作成する請求書ごとに1つのキーを用意して保存し、同じリクエストを再試行する場合にのみ再利用してください。同じキーと金額で同じ認証情報から送信すると、現在の状態（支払い済み、キャンセル済み、期限切れを含む）にかかわらず、その請求書が（`201`）で返されます。そのため、支払い指示は`status`が`open`または`part_paid`で、かつ`amount_open`が0より大きい間にのみ提示してください。同じキーで別の金額を指定した場合、または別の認証情報から送信した場合は、`409`の`idempotency_key_conflict`を返します。


        **リクエストが失敗した場合。**
        `502`の`payment_provider_error`は、請求書の状態を確認できなかったことを意味します。同じキーで再試行してください。請求書が発行済みであれば再試行で請求書が返され、何も発行されていなければ`409`の`top_up_not_completed`が返されます。`top_up_not_completed`を受け取った後にのみ、新しいキーで新しい請求書を作成してください。`502`の後に新しいキーを使うだけでは、最初の請求書がまだ未払い（open）のまま残っている可能性があり（`409`の`top_up_invoice_open`）、その場合は再びエラーになります。
      operationId: billing_top_up_invoices_create
      parameters:
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            作成する請求書ごとに1つのキー。1〜255文字で、そのリクエストを再試行する場合にのみ再利用してください。同じキーと金額で同じ認証情報から送信すると同じ請求書が返され、2件が発行されることはありません。キーがない、空である、または長すぎる場合は、`400`の`idempotency_key_required`を返します。
          schema:
            type: string
            minLength: 1
            maxLength: 255
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount_in_dollars
              properties:
                amount_in_dollars:
                  type: number
                  minimum: 1000
                  maximum: 20000
                  description: >-
                    追加するクレジット額（USD）。**1,000から20,000**までで、小数点以下は最大2桁です。税金は該当する場合、請求書に加算されます。
                  multipleOf: 0.01
                po_number:
                  type: string
                  maxLength: 140
                  description: 請求書に印字されている発注番号。
            examples:
              Invoice for $5,000 of credit:
                value:
                  amount_in_dollars: 5000
                  po_number: PO-88213
      responses:
        '201':
          description: 新規作成された請求書、またはこのキーで既に作成された請求書を、現在の状態で返します。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingTopUpInvoice'
              examples:
                Issued:
                  value:
                    id: 9a4f2c1e-7b3d-4e8a-a1c5-6f0d2b9e8c47
                    lane: bank_transfer
                    status: open
                    credit_amount: '5000.00'
                    total: '5000.00'
                    tax: '0.00'
                    currency: usd
                    amount_received: '0.00'
                    amount_credited: '0.00'
                    amount_open: '5000.00'
                    presented: null
                    method:
                      type: customer_balance
                      name: Bank transfer
                    invoice_number: 7F3A2C1B-0012
                    hosted_invoice_url: https://invoice.example.com/i/7F3A2C1B-0012
                    invoice_pdf: https://invoice.example.com/i/7F3A2C1B-0012/pdf
                    po_number: PO-88213
                    due_at: '2027-01-14T10:00:00Z'
                    confirmed_at: null
                    closed_at: null
                    failure_reason: null
                    created_at: '2026-11-30T10:00:00Z'
                    bank_details:
                      currency: USD
                      amount_due: '5000.00'
                      account_holder_name: Didit
                      bank_name: Example Bank, N.A.
                      account_number: '000123456789'
                      routing_number: '000000000'
                      swift_code: EXAMUS33XXX
                      reference: 7F3A2C1B-0012
        '400':
          description: >-
            項目レベルのエラー（例:`amount_in_dollars`が\$1,000未満、\$20,000超、または小数点以下が2桁を超える場合）、または`code`を持つオブジェクト:`idempotency_key_required`（`Idempotency-Key`が欠落、空、または255文字を超える場合）または`billing_details_required`（法人名と住所がまだ保存されていない場合。`missing`にそれらが一覧されます）。JSONとして無効な本文の場合は、`detail`のみを含むオブジェクトが返されます。
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/TopUpInvoiceFieldErrors'
                  - $ref: '#/components/schemas/TopUpInvoiceError'
                  - $ref: '#/components/schemas/TopUpInvoiceDetailError'
              examples:
                Amount below the minimum:
                  value:
                    amount_in_dollars:
                      - A bank transfer top-up must be at least $1,000
                Billing details missing:
                  value:
                    code: billing_details_required
                    detail: >-
                      Add your billing details (legal name and address) before
                      creating an invoice.
                    missing:
                      - legal_name
                      - address.line1
                Body not valid JSON:
                  value:
                    detail: >-
                      JSON parse error - Expecting value: line 1 column 1 (char
                      0)
        '401':
          description: APIキーまたはアプリケーションのアクセストークンの有効期限が切れているか、失効しています。認証情報を差し替えてください。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpInvoiceDetailError'
              examples:
                Expired key:
                  value:
                    detail: This API key has expired.
        '403':
          description: 認証情報が送信されなかった場合、またはこの組織で認証情報がチャージ請求書を利用できない場合。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpInvoiceDetailError'
              examples:
                No credential:
                  value:
                    detail: Authentication credentials were not provided.
        '404':
          description: '`billing_not_available`：この組織ではまだ請求機能を利用できません。'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpInvoiceError'
              examples:
                Billing not available:
                  value:
                    code: billing_not_available
                    detail: Plans and billing settings are not available yet.
        '409':
          description: >-
            `top_up_invoice_open`（別の請求書が未払いまたは一部入金済みです。`open_invoice`
            にその請求書が示されます）、`idempotency_key_conflict`（そのキーが別の金額で、または別のAPIキーで使われました）、`top_up_not_completed`（このキーを使った前回のリクエストで請求書を発行できませんでした。何も発行されていません。新しいキーで請求書を作成してください）、`top_up_not_allowed`（年間契約のEnterpriseプラン）、または
            `billing_customer_missing`（組織にまだ請求アカウントがありません。ユーザーがコンソールで請求を設定します）。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpInvoiceError'
              examples:
                Invoice already open:
                  value:
                    code: top_up_invoice_open
                    detail: >-
                      An invoice is already open. Pay it or cancel it before
                      creating another.
                    open_invoice:
                      id: 9a4f2c1e-7b3d-4e8a-a1c5-6f0d2b9e8c47
                      lane: bank_transfer
                      status: open
                      credit_amount: '5000.00'
                      total: '5000.00'
                      tax: '0.00'
                      currency: usd
                      amount_received: '0.00'
                      amount_credited: '0.00'
                      amount_open: '5000.00'
                      presented: null
                      method:
                        type: customer_balance
                        name: Bank transfer
                      invoice_number: 7F3A2C1B-0012
                      hosted_invoice_url: https://invoice.example.com/i/7F3A2C1B-0012
                      invoice_pdf: https://invoice.example.com/i/7F3A2C1B-0012/pdf
                      po_number: PO-88213
                      due_at: '2027-01-14T10:00:00Z'
                      confirmed_at: null
                      closed_at: null
                      failure_reason: null
                      created_at: '2026-11-30T10:00:00Z'
                Open invoice closed meanwhile:
                  value:
                    code: top_up_invoice_open
                    detail: >-
                      An invoice is already open. Pay it or cancel it before
                      creating another.
                    open_invoice: null
                Key used for another invoice:
                  value:
                    code: idempotency_key_conflict
                    detail: This idempotency key was used for another top-up.
                Invoice not issued:
                  value:
                    code: top_up_not_completed
                    detail: >-
                      An earlier request with this Idempotency-Key failed before
                      the invoice was issued. Nothing is owed: create a new
                      invoice with a new key.
        '429':
          description: レート制限を超えました。リクエストを控え、`Retry-After`で示された間隔の経過後に再試行してください。
          content:
            application/json:
              examples:
                Throttled:
                  value:
                    detail: >-
                      Write request rate limit exceeded. You can make up to 300
                      requests per minute.
                    reference: RL-00000000000040008000000000000001
                    limit: 300
                    remaining: 0
                    reset: 1794358860
                    window_seconds: 60
              schema:
                $ref: '#/components/schemas/RateLimitBudgetError'
          headers:
            Retry-After:
              $ref: '#/components/headers/BudgetRetryAfter'
            X-RateLimit-Scope:
              $ref: '#/components/headers/BudgetXRateLimitScope'
            X-RateLimit-Limit:
              $ref: '#/components/headers/BudgetXRateLimitLimit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/BudgetXRateLimitRemaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/BudgetXRateLimitReset'
        '502':
          description: >-
            `payment_provider_error`：決済プロバイダーで請求書の状態を確認できませんでした。同じ
            `Idempotency-Key` で再試行してください。請求書が発行済みであれば、その請求書が返されます。何も発行されていなければ
            `409` の `top_up_not_completed` が返されます。その場合にのみ、新しいキーで新しい請求書を作成してください。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopUpInvoiceError'
              examples:
                Not issued:
                  value:
                    code: payment_provider_error
                    detail: The payment provider is not available. Try again later.
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X POST
            'https://verification.didit.me/v3/billing/top-up-invoices/' \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -H 'Idempotency-Key: 0b8e6f4a-3c2d-4e1f-9a7b-5d6c8e2f1a30' \
              -d '{
                "amount_in_dollars": 5000,
                "po_number": "PO-88213"
              }'
components:
  schemas:
    BillingTopUpInvoice:
      type: object
      description: >-
        銀行振込で支払われるチャージ用請求書です。コンソールの「Top up」ダイアログで発行されるものと同じ請求書です。現在の状況を把握するには
        `status` と金額を確認してください。タイムスタンプは、イベントが発生した時刻を記録するだけです。
      required:
        - id
        - lane
        - status
        - credit_amount
        - total
        - tax
        - currency
        - amount_received
        - amount_credited
        - amount_open
        - created_at
      properties:
        id:
          type: string
          format: uuid
          description: >-
            請求書の識別子です。`GET /v3/billing/top-up-invoices/{top_up_id}/`
            で再度取得してください。
        lane:
          type: string
          enum:
            - bank_transfer
          description: 常に `bank_transfer`。
        status:
          type: string
          enum:
            - open
            - part_paid
            - paid
            - expired
            - cancelled
            - failed
          description: >-
            `open`：振込を待っている状態です。`part_paid`：`total`
            の一部が入金され、その分のクレジットが加算されています。`due_at` の前に、同じ参照番号を付けて `amount_open`
            を送金してください。`paid`：`total` が入金され、`credit_amount`
            が加算されました。`expired`：`total` の全額が入金される前に `due_at`
            を過ぎました。入金済みの分は加算されたままです。参照番号を付けた振込が後から届いた場合は、その支払い分が加算されます。`cancelled`：入金前に、ユーザーがコンソールでキャンセルしました。入金後は請求書をキャンセルできません。`failed`：請求書を発行できませんでした。何も発行されていません。
        credit_amount:
          type: string
          description: '`total` が全額支払われたときに残高に追加されるクレジット額（USD、税抜き）です。'
          example: '5000.00'
        total:
          type: string
          description: 請求書が求める金額（USD、税込み）です。`credit_amount` より大きい場合があります。
          example: '5000.00'
        tax:
          type: string
          description: 請求書上の税額（USD）。該当しない場合は `0.00` です。
          example: '5000.00'
        currency:
          type: string
          enum:
            - usd
          description: 常に `usd`。
        amount_received:
          type: string
          description: 現時点までに到着した金額（USD）です。
          example: '5000.00'
        amount_credited:
          type: string
          description: >-
            現時点までに残高に追加されたクレジット（USD）です。一部入金の場合、支払われた `total`
            の割合に応じてクレジットが追加されます。1,100.00 USD の請求書に対して 1,000.00 USD
            のクレジットがある場合、550.00 USD の支払いで 500.00 USD が追加されます。
          example: '5000.00'
        amount_open:
          type: string
          description: >-
            未送金の金額（USD）です。`status` が `open` または `part_paid`
            の間に有効です。この金額をそのまま送金し、参照として `invoice_number`
            を記載してください。請求書が締められた後は無視してください。
          example: '5000.00'
        presented:
          type: object
          nullable: true
          description: チャージ用請求書では常に null。
          properties:
            amount:
              type: string
            currency:
              type: string
        method:
          type: object
          nullable: true
          description: 請求履歴での表記に合わせた支払い方法。
          properties:
            type:
              type: string
              example: customer_balance
            name:
              type: string
              example: Bank transfer
        invoice_number:
          type: string
          nullable: true
          description: 請求書番号です。参照として送金に記載してください。記載のない送金は請求書と照合できません。
        hosted_invoice_url:
          type: string
          format: uri
          nullable: true
          description: 銀行情報を含む請求書のページです。
        invoice_pdf:
          type: string
          format: uri
          nullable: true
          description: 請求書のPDFです。
        po_number:
          type: string
          nullable: true
          description: 請求書に記載された発注番号です（送付された場合）。
        due_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            請求書に記載された支払期日です。この値をそのまま使用し、計算式で求めないでください。新しい請求書の支払期日は発行から45日後です。以前の条件で発行された請求書は、発行時の日付を維持します。その日までに`total`の全額が到着していない場合、ステータスは`expired`になります。支払い済みの請求書は`paid`のままです。
        confirmed_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            一部入金を含め、直近の送金が確認された日時です。請求書が決済済みであることを意味しないため、`status` と
            `amount_open` を確認してください。
        closed_at:
          type: string
          format: date-time
          nullable: true
          description: 請求書が失敗、期限切れ、またはキャンセルされた日時です。未払い、一部入金、または支払い済みの請求書では null です。
        failure_reason:
          type: string
          nullable: true
          description: 失敗または期限切れになった理由と、その日時。
        created_at:
          type: string
          format: date-time
          description: 発行日時。
        bank_details:
          type: object
          nullable: true
          description: >-
            振込先。請求書が振込を受け付けられる状態（`open` または `part_paid`）の間に返されます。請求書が締め切られると
            null になります。また、現時点で振込先情報を読み取れない場合も null になります。その場合は、振込先も表示される
            `hosted_invoice_url` を使用してください。エラー時の `open_invoice` には含まれません。
          required:
            - currency
            - amount_due
            - account_holder_name
            - bank_name
            - account_number
            - routing_number
            - swift_code
            - reference
          properties:
            currency:
              type: string
              description: 常に `USD`。
            amount_due:
              type: string
              description: 送金する金額（USD）です。`amount_open` と同じです。
            account_holder_name:
              type: string
              description: お金の送金先の口座です。
            bank_name:
              type: string
              description: 受取銀行です。
            account_number:
              type: string
              description: 受取口座の番号です。
            routing_number:
              type: string
              description: ACH と米国内送金向け。
            swift_code:
              type: string
              description: 国際送金向け。
            reference:
              type: string
              description: 請求書番号です。送金に含める必要があります。
    TopUpInvoiceFieldErrors:
      type: object
      description: '項目レベルのエラー: 無効な各リクエスト項目と、そのメッセージ（例: \$1,000 未満の金額）。'
      additionalProperties:
        type: array
        items:
          type: string
      example:
        amount_in_dollars:
          - A bank transfer top-up must be at least $1,000
    TopUpInvoiceError:
      type: object
      description: チャージ用請求書リクエストのエラーボディ。
      required:
        - code
        - detail
      properties:
        code:
          type: string
          enum:
            - idempotency_key_required
            - billing_details_required
            - top_up_invoice_open
            - idempotency_key_conflict
            - top_up_not_allowed
            - top_up_not_completed
            - billing_customer_missing
            - billing_not_available
            - top_up_not_found
            - payment_provider_error
          description: 安定したエラーコード。
        detail:
          type: string
          description: 人が読める形式の説明。
        missing:
          type: array
          items:
            type: string
          description: >-
            `billing_details_required`の場合：保存が必要な請求情報（`legal_name`や`address.line1`など）。
        open_invoice:
          description: >-
            `top_up_invoice_open`の場合：未払いまたは一部入金済みの請求書。`bank_details`は含まれないため、振込先は請求書を読み取って確認してください。回答を書く前に終了していた場合はnullです。その場合は請求書を再度作成してください。
          oneOf:
            - $ref: '#/components/schemas/BillingTopUpInvoice'
            - $ref: '#/components/schemas/TopUpInvoiceNoOpenInvoice'
    TopUpInvoiceDetailError:
      type: object
      description: >-
        `detail` のみを含む拒否:
        期限切れまたは取り消された認証情報（401）、キーがない、または認証情報に必要な権限がない場合（403）、またはJSONとして無効な本文（400）。
      required:
        - detail
      additionalProperties: false
      properties:
        detail:
          type: string
          description: 人が読める形式の説明。
    RateLimitBudgetError:
      type: object
      description: >-
        レート制限ミドルウェアの予算超過による拒否の場合にのみ返されます。その他の429エラー（冪等性の競合やエンドポイント固有の上限を含む）では、これらのメタデータフィールドは保証されません。
      required:
        - detail
        - reference
        - limit
        - remaining
        - reset
        - window_seconds
      properties:
        detail:
          type: string
          description: 既存の、人が読める形式のバジェット拒否メッセージです。
        reference:
          type: string
          pattern: ^RL-[0-9a-f]{32}$
          description: RL-で始まり、その後に小文字の16進数文字32文字（UUID形式）が続く不透明なサポート参照番号。
        limit:
          type: integer
          description: 超過した範囲のバジェット。X-RateLimit-Limit と同じ値です。
        remaining:
          type: integer
          minimum: 0
          description: 残りの予算。ゼロ未満にならないよう下限をゼロに制限しています。X-RateLimit-Remaining と等しくなります。
        reset:
          type: integer
          format: int64
          description: ウィンドウのリセット時刻（Unix秒）。X-RateLimit-Resetと同じ値です。
        window_seconds:
          type: integer
          description: 固定ウィンドウの期間（秒）です。残りの待機時間ではありません。再試行する前に Retry-Afterに従ってください。
      example:
        detail: >-
          Write request rate limit exceeded. You can make up to 300 requests per
          minute.
        reference: RL-00000000000040008000000000000001
        limit: 300
        remaining: 0
        reset: 1794358860
        window_seconds: 60
    TopUpInvoiceNoOpenInvoice:
      description: 請求書はありません：回答を書く前に、開いていた請求書が終了しました。
      enum:
        - null
      nullable: true
  headers:
    BudgetRetryAfter:
      description: 次のウィンドウまでの待機秒数（切り上げ）。ミドルウェアの予算超過による拒否の場合にのみ含まれます。
      schema:
        type: integer
    BudgetXRateLimitScope:
      description: 予算を超過した範囲。ミドルウェアによる拒否の場合にのみ含まれます。
      schema:
        type: string
    BudgetXRateLimitLimit:
      description: 超過した範囲のバジェット。ボディの制限値と同じ値です。ミドルウェアのバジェットによる拒否の場合にのみ含まれます。
      schema:
        type: integer
    BudgetXRateLimitRemaining:
      description: >-
        残りの予算。ゼロ未満にならないよう下限をゼロに制限しています。ボディの remaining
        と等しくなります。ミドルウェアの予算による拒否の場合に存在します。
      schema:
        type: integer
    BudgetXRateLimitReset:
      description: リセット時刻はUnix秒です。本文のresetと同じ値です。ミドルウェアの予算超過による拒否レスポンスに含まれます。
      schema:
        type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        お客様のアプリケーションのAPIキーです。Business Console の Developers -> API keys
        から取得できます。プライマリーキーはすべてのアクセス権を持ちます。名前付きキーは範囲を制限できます。リソースごとに
        none、read、write
        を指定でき、一部のワークフローや承認済みセッションに限定できます。IPアドレスのリストや有効期限も設定できます。401
        はキーが誤っている、取り消されている、または期限切れであることを意味します。403
        はキーが送信されていない、そのリソースまたはアクションへのアクセス権がない、またはリクエストがIPリストに含まれないアドレスから送信されたことを意味します。セッションのルートでの404
        は、セッションがキーのワークフローまたはステータスの範囲外にあることを意味します。メディアへのアクセス権がないキーでは、画像、動画、PDFのURLが
        null で返されます。セッションの書き込み権限がないキーでは、セッションリンクとトークンが null で返されます。詳しくは
        https://docs.didit.me/console/api-keys を参照してください。
    BearerAuth:
      type: http
      scheme: bearer
      description: アプリケーションのクライアント認証情報によるアクセストークン。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.