PayclaveDocs

Payclave developers

Checkout sessions

Create hosted checkout and read verified payment progress.

Access and availability
Checkout creation and retrieval accept publishable, secret, or restricted agent keys under their respective field restrictions. Payment retrieval accepts secret or restricted agent keys. Read amounts and payment status from the API before fulfillment.

Checkout sessions

POST

POST /v1/checkout-sessions

Create a hosted checkout session for an order.

Body parameters

JSON body
amountRequired
string · decimal
A positive decimal amount in the selected settlement currency.
externalReference
string
Your order or purchase identifier. Use it to match the checkout to your records.
  • Currency and recipient come from the selected active merchant wallet in the key's mode. A request cannot supply an arbitrary recipient.

curl https://api.payclave.com/v1/checkout-sessions \  -H "Authorization: Bearer sk_test_..." \  -H "Content-Type: application/json" \  -H "Idempotency-Key: order_8431" \  -d '{    "amount": "25.00",    "customerEmail": "customer@example.com",    "externalReference": "order_8431",    "successUrl": "https://merchant.example/orders/8431/success",    "cancelUrl": "https://merchant.example/cart",    "metadata": { "cartId": "cart_8431" }  }'
GET

GET /v1/checkout-sessions/:id

Path: the returned checkout id. No body. There is no checkout-session list endpoint.

curl "https://api.payclave.com/v1/checkout-sessions/YOUR_CHECKOUT_ID" -H "Authorization: Bearer sk_test_..."

Agent payments with x402

GET

GET /v1/checkout-sessions/:id/x402

Pay an eligible checkout through its returned x402Url. No API key is required.

Payment sequence

HTTP payment challenge
  1. Read the PAYMENT-REQUIRED response challenge at the returned x402Url.
  2. Validate the recipient, network, token, and amount before authorizing payment.
  3. Retry the original resource with PAYMENT-SIGNATURE and the original authorization.
  • Live checkouts require USDC; test checkouts use Base Sepolia USDC.
  • After a timeout, reuse the original authorization. Do not create a replacement authorization just to retry.

Payment records

GET

GET /v1/payments/:id

Secret or restricted agent key; path: paymentId from the invoice or checkout response. No body.

curl "https://api.payclave.com/v1/payments/YOUR_PAYMENT_ID" -H "Authorization: Bearer sk_test_..."

On this page