Create invoice

View as Markdown
Create an invoice for agent payment. The response contains two IDs: - `id` is the merchant-side UUID - `public_invoice_id` is the payer-facing `inv_*` identifier

Authentication

AuthorizationBearer
Merchant API key (`sk_m_*`). ``` Authorization: Bearer sk_m_abc123def456... ```

Headers

Idempotency-KeystringOptionalformat: "uuid"

Client-generated UUID v4 for safe retries. Requests with the same key return the original response.

Request

This endpoint expects an object.
amount_usdclongRequired>=1

USDC amount in atomic units (6 decimals). Used in REST response bodies. 1000000 = 1.00 USDC.

descriptionstringOptional<=500 characters
metadatamap from strings to anyOptional
metadata_publicbooleanOptionalDefaults to false
expires_in_secondsintegerOptional60-86400Defaults to 900

Response headers

X-Request-Idstring
Unique request identifier for debugging and support

Response

Invoice created
idstringformat: "uuid"
public_invoice_idstringformat: "^inv_[A-Za-z0-9]{20,}$"
merchant_idstringformat: "uuid"
amount_usdclong>=1

USDC amount in atomic units (6 decimals). Used in REST response bodies. 1000000 = 1.00 USDC.

currencyenum
Allowed values:
statusenum
Allowed values:
metadata_publicboolean
created_atdatetime
expires_atdatetime
agent_protocolobject
descriptionstring
metadatamap from strings to any

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error