CoinPay
Invoices

Create invoice

Creates a new invoice and pre-computes deposit addresses for merchant-enabled chains in the API key's environment. Optionally pass `networkId` and/or `token` to lock the payment route; checkout then only shows the allowed choices. Prefer sending customers to `checkoutUrl` for payment.

POST
/v1/invoices

Creates a new invoice and pre-computes deposit addresses for merchant-enabled chains in the API key's environment. Optionally pass networkId and/or token to lock the payment route; checkout then only shows the allowed choices. Prefer sending customers to checkoutUrl for payment.

Authorization

bearerAuth
AuthorizationBearer <token>

Merchant API key (test_... or live_...)

In: header

Header Parameters

Idempotency-Key*string

Unique key per create attempt. Reuse returns the same invoice when the body matches.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Environment comes from the API key (test_ / live_). Do not send environment. Omit networkId and token to let the customer choose any enabled network/token at checkout.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/invoices" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "amount": "string"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "status": "CREATED",  "environment": "test",  "amount": "string",  "amountReceived": "string",  "referenceId": "string",  "checkoutUrl": "http://example.com",  "expiresAt": "2019-08-24T14:15:22Z",  "addresses": [    {      "chainId": "9e7fb22a-9e5b-420e-8fd7-e3454fcfd5fd",      "chainName": "string",      "family": "evm",      "networkId": 0,      "depositAddress": "string",      "tokens": [        {          "symbol": "string",          "contractAddress": "string",          "decimals": 0        }      ]    }  ]}
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "status": "CREATED",  "environment": "test",  "amount": "string",  "amountReceived": "string",  "referenceId": "string",  "checkoutUrl": "http://example.com",  "expiresAt": "2019-08-24T14:15:22Z",  "addresses": [    {      "chainId": "9e7fb22a-9e5b-420e-8fd7-e3454fcfd5fd",      "chainName": "string",      "family": "evm",      "networkId": 0,      "depositAddress": "string",      "tokens": [        {          "symbol": "string",          "contractAddress": "string",          "decimals": 0        }      ]    }  ]}
{  "error": {    "code": "string",    "message": "string"  }}
{  "error": {    "code": "string",    "message": "string"  }}
{  "error": {    "code": "string",    "message": "string"  }}