Create an order
Create an order and its Lightning invoice.
bearerAuthorizationBearer <token>Your secret API key, cp_live_…, created in the merchant console.
idempotency-key*string16–128 letters, digits, _ or -. Use a new UUID for each order and reuse it when retrying.
application/json- body
slug*stringPay link the order belongs to. It must be one of your pay links.
amountUsdCents*integerAmount in US cents, from 100 ($1.00) to 1000000 ($10,000.00).
100 <= value <= 1000000reference*stringYour own order number, up to 128 characters. It is returned as is and does not need to be unique.
length <= 128successUrl?stringHTTPS URL the checkout page sends the customer to after payment.
^https://urilength <= 2048cancelUrl?stringHTTPS URL behind the checkout page's “Return to store” link while the order is unpaid.
^https://urilength <= 2048Order
application/json- response
id*stringOrder ID, a UUID.
slug*stringPay link the order belongs to. It must be one of your pay links.
reference*stringThe reference you sent.
amountUsdCents*integerAmount in US cents, from 100 ($1.00) to 1000000 ($10,000.00).
100 <= value <= 1000000amountSat*integerAmount in satoshis, quoted when the order was created. The invoice is for exactly this amount.
1 <= value <= 9007199254740status*stringpending until the invoice is paid or expires. paid is final. An expired order can still become paid if a late payment arrives.
"pending""paid""expired"invoice*stringBOLT11 Lightning invoice. Show it yourself or send the customer to checkoutUrl.
checkoutUrl*stringHosted checkout page for this order.
successUrl*|The success URL you sent, or null.
cancelUrl*|The cancel URL you sent, or null.
createdAt*stringWhen the order was created. ISO 8601, UTC.
expiresAt*stringWhen the invoice expires, one hour after creation. ISO 8601, UTC.
paidAt*|When the payment arrived, or null. ISO 8601, UTC.
curl -X POST 'https://api.cashpayment.co/v1/orders' \ -H 'Authorization: Bearer cp_live_xxx' \ -H 'idempotency-key: 5f2b7c1e-9a4d-4e8b-b1c3-7d6e0a9f2c41' \ -H 'Content-Type: application/json' \ -d '{ "slug": "onne", "amountUsdCents": 1500, "reference": "WC-10234"}'{ "id": "12345678-1234-4234-8234-123456789abc", "slug": "onne", "reference": "WC-10234", "amountUsdCents": 1500, "amountSat": 15000, "status": "pending", "invoice": "lnbc150u1p5...", "checkoutUrl": "https://www.cashpayment.co/invoice/12345678-1234-4234-8234-123456789abc", "successUrl": "https://shop.example.com/thanks", "cancelUrl": "https://shop.example.com/cart", "createdAt": "2026-11-17T12:00:00.000Z", "expiresAt": "2026-11-17T13:00:00.000Z", "paidAt": null}