# Pay an invoice from your Dime wallet

Pays one of your `UNPAID` invoices by debiting your own Dime merchant
wallet. No card is charged. `currency` selects which wallet to debit.
Use the invoice's currency; a USD or JMD wallet can also pay a JMD or
USD invoice. The invoice is marked `PAID`.
A second call for the same invoice returns `400 already_billed`.
This endpoint does not change any subscription's status.

Endpoint: POST /subscriptions/dime-billing
Security: ClientKey, SecretKey

## Security:

  - `ClientKey` (unknown)
    apiKey in header X-Dime-Client

  - `SecretKey` (unknown)
    http bearer

## Request fields (application/json):

  - `invoice_id` (string, required)
    The `token` of the invoice to pay. A database id is rejected with `400`.
    Example: inv_20260825_giodwK2

  - `currency` (string, required)
    The currency of the wallet to debit.
    Enum: "USD", "JMD", "GBP", "EUR", "TTD", "BBD", "XCD", "GYD", "SRD"

## Response 200:

  - `200` (unknown)
    The invoice was paid from your wallet.

## Response 200 fields (application/json):

  - `invoice_token` (string | null)
    The `token` of the invoice paid.
    Example: inv_20260825_giodwK2

  - `amount` (number)
    Amount debited from the wallet.
    Example: 5000

  - `currency` (string)
    Enum: "USD", "JMD", "GBP", "EUR", "TTD", "BBD", "XCD", "GYD", "SRD"

  - `wallet_id` (string | null)
    The `token` of the wallet debited, as listed by `GET /p2p/wallets`.
    Example: wal_Q3nT8vKp_Zx2Lm9Rc_Yb4Hu7Wd_E1sGf0a

## Response 400:

  - `400` (unknown)
    The request was rejected.

## Response 400 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 401:

  - `401` (unknown)
    The client key or secret key was missing, not recognized, or the two do not belong to the same key.

## Response 401 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 404:

  - `404` (unknown)
    No such invoice for this merchant.

## Response 404 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 200 examples:

  - `Invoice paid from your wallet` (unknown)

## Response 400 examples:

  - `A required field was absent` (unknown)

## Response 401 examples:

  - `unauthorized` (unknown)

  - `Client key sent without its secret key` (unknown)

## Response 404 examples:

  - `missing` (unknown)

