Invoices
Create an invoice
Creates an invoice and returns its checkout_url. Send the customer to that URL to pay.
The settlement amount (what the business receives) is fixed when the invoice is created. EUR and INR are converted to USD with ECB reference rates; USDC, USDT and DAI count as 1 USD; other settlement coins use the current USD price.
Rate limit: 1200 per minute per API key, counted separately from other endpoints.
bearerAuthAuthorizationBearer <token>A live API key, sk_live_ followed by 32 base58 characters.
Idempotency-Key?stringA unique string of 1 to 255 characters for this operation. A key belongs to the business across every endpoint for 24 hours, so give each operation its own key, for example invoice-order-1042 and refund-order-1042, not the order id alone. A retry with the same key on the same endpoint and with the same body returns the stored response with the header Idempotent-Replayed: true. The same key with a different body or on another endpoint returns 409 idempotency_conflict. Errors are not stored, so a request that failed can be retried with the same key, even with a corrected body. While the first request with a key is still running, a retry gets 409 idempotency_conflict with Retry-After: 1.
1 <= length <= 255application/json- body
amount*AmountDecimal string with up to 2 decimals, greater than 0.
^\d{1,12}(\.\d{1,2})?$currency*Currency"USD""EUR""INR"order_id?stringYour own order reference.
1 <= length <= 200description?stringYour own note about what the invoice is for. Your dashboard and Telegram messages show it; the hosted checkout page does not.
1 <= length <= 500redirect_url?stringAn http or https URL the customer returns to after paying.
urilength <= 2048customer_email?stringWhere the receipt is sent when email is configured. Without it, the customer can enter one on the checkout page.
emailmetadata?Up to 20 keys of your own. Keys are at most 40 characters and values at most 500.
properties <= 20expires_in?integerInvoice lifetime in seconds, from 15 minutes to 24 hours.
900 <= value <= 864003600The invoice was created.
application/json- response
id*stringobject*stringmode*ModeAlways live on the objects your API key creates and reads. Only demo store invoices, seen through the public checkout endpoints, are test.
"live""test"status*InvoiceStatus"created""awaiting_payment""detected""processing""paid""underpaid""refunded""failed""expired"amount*stringDecimal string with 2 decimals.
currency*Currency"USD""EUR""INR"order_id*string|nulldescription*string|nullcustomer_email*|Where the receipt is sent. When you created the invoice without one, anyone with the checkout link can enter it on the checkout page, so it is not a verified identity of the customer.
redirect_url*string|nullmetadata*settlement*The coin and amount the business receives.
late*booleanTrue when the payment arrived on a deposit address that was already replaced or expired.
extra_payment*booleanTrue when a second payment also succeeded for this invoice.
checkout_url*stringThe hosted checkout page for this invoice.
urireceipt_url*|The public receipt page, once the invoice is paid.
uriredeemed_at*|When the payment was used with POST /api/v1/invoices/{id}/redeem; a used payment cannot be redeemed again.
date-timeexpires_at*stringdate-timecreated_at*stringdate-timecurl -X POST 'https://example.com/api/v1/invoices' \ -H 'Content-Type: application/json' \ -d '{ "amount": "25.00", "currency": "USD", "order_id": "1042", "description": "Blue T-shirt", "redirect_url": "https://shop.example/thanks"}'{ "id": "inv_7h3K9dWq2LmN4pRt6vXy", "object": "invoice", "mode": "live", "status": "created", "amount": "string", "currency": "USD", "order_id": "string", "description": "string", "customer_email": "string", "redirect_url": "string", "metadata": { "property1": "string", "property2": "string" }, "settlement": { "asset_id": "string", "symbol": "string", "blockchain": "string", "amount": "string", "amount_base": "string" }, "late": true, "extra_payment": true, "checkout_url": "http://example.com", "receipt_url": "http://example.com", "redeemed_at": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z"}