A checkout is a single payment with a hosted page. Create one from your server, send the customer to its url, and fulfil the order when you receive the checkout.paid webhook.
Create a checkout
/v1/checkoutsBody
currencystringrequired
USD or ZEC.titlestringrequired
amountstring
line_items.line_itemsarray
{ description, quantity, unit_amount }. The total is computed for you.descriptionstring
referencestring
metadataobject
customerobject
{ name, email }, shown as "Billed to".success_urlstring
{CHECKOUT_ID} is replaced with the checkout's id.cancel_urlstring
expires_ininteger
Request
curl https://api.petrapay.xyz/v1/checkouts \
-H "Authorization: Bearer pp_sk_..." \
-H "Idempotency-Key: order_1001" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"amount": "49.99",
"title": "Order #1001",
"reference": "order_1001",
"customer": { "email": "[email protected]" },
"success_url": "https://shop.example/thanks?checkout={CHECKOUT_ID}",
"cancel_url": "https://shop.example/cart"
}'The checkout object
Response
{
"id": "G8VN5idaQDX6",
"object": "checkout",
"livemode": true,
"url": "https://petrapay.xyz/pay/G8VN5idaQDX6",
"status": "open",
"number": 42,
"currency": "USD",
"amount": "49.99",
"title": "Order #1001",
"description": null,
"line_items": [{ "description": "Order #1001", "quantity": 1, "unit_amount": "49.99" }],
"reference": "order_1001",
"metadata": { "cart_id": "c_93" },
"customer": { "name": null, "email": "[email protected]" },
"success_url": "https://shop.example/thanks?checkout={CHECKOUT_ID}",
"cancel_url": "https://shop.example/cart",
"payment_link": null,
"source": "api",
"amount_received": null,
"expires_at": "2026-11-10T09:00:00.000Z",
"paid_at": null,
"created_at": "2026-11-09T09:00:00.000Z"
}statusstring
open, processing, paid, cancelled or expired.urlstring
amount_receivedobject | null
{ zec, usd }, what was delivered to your shielded address.livemodeboolean
false for test sales from a POS terminal in test mode.sourcestring
api, dashboard, payment_link or pos.Retrieve a checkout
/v1/checkouts/{id}Use this to confirm a checkout's status, for example on your success page or when reconciling.
List checkouts
/v1/checkoutsQuery
statusstring
referencestring
limit, starting_afterpagination
Cancel a checkout
/v1/checkouts/{id}/cancelFails with 409 once a payment is underway or done.
The hosted checkout flow
Create a checkout and redirect
Your server creates the checkout and sends the customer to its
url.The customer pays
They pick a token, see the exact quote and pay from their wallet, or pay shielded ZEC directly.
They come back
After a few seconds on the paid screen, the customer is sent to your
success_url.You fulfil the order
Do it when the
checkout.paidwebhook arrives, not on the success page: customers can close the tab before they're redirected.
checkout.paid either way.