Checkouts

Create a payment session, hand the customer the reference code, and verify the receipt.

AGENTS.md

A checkout is the unit of payment. It carries the expected amount, the reference code the customer must include in the bank transfer, the merchant accounts, and the verification state.

Create

POST/api/v1/checkouts/

Call this from your server with a secret key. A publishable key can also create a checkout for its own app, but the server path is preferred because you can authorize the order first.

Request
POST https://api.payproof.et/api/v1/checkouts/
Authorization: Bearer sk_live_...
Idempotency-Key: order_1001
Content-Type: application/json

{
  "app_id": 1,                    // optional with an app-scoped key
  "product_id": 1,                // or "package_id": 3
  "amount_etb": "999.50",         // dynamic/open pricing only
  "customer_ref": "user_42",
  "customer_email": "customer@example.com",
  "customer_name": "Abebe K.",
  "customer_phone": "09xxxxxxxx",
  "success_url": "https://example.com/orders/42/thanks",
  "cancel_url": "https://example.com/cart",
  "expires_in_hours": 48
}
FieldRequiredNotes
app_idOptionalInferred from an app-scoped key; a mismatch returns 403.
product_id / package_idOne ofPackage id is preferred for catalog plans.
amount_etbConditionalRequired for dynamic or open-priced products.
customer_refRecommendedYour stable user id; used by entitlements and billing status.
success_url / cancel_urlOptionalFall back to the app gateway settings.
expires_in_hoursOptionalDefaults to the app checkout expiry.
201 Created
{
  "checkout": {
    "id": "cs_7f3a...",
    "public_id": "cs_7f3a...",
    "app_id": 1,
    "reference_code": "PP-1-AB12CD34",
    "expected_amount_etb": "999.50",
    "status": "pending",
    "expires_at": "2026-10-25T12:00:00Z"
  },
  "payment_accounts": [
    {
      "bank_name": "Commercial Bank of Ethiopia",
      "account_number": "1000123456789",
      "account_name": "My Shop PLC"
    }
  ],
  "pay_url": "/pay/cs_7f3a..."
}

Status

GET/api/v1/checkouts/:public_id/status/
GET/api/public/gateway/checkouts/:public_id/status/

Status is public for the hosted page and app-scoped on /api/v1. Both return { "checkout": { ... } }. Poll while the customer is paying, or subscribe to the WebSocket for push updates.

StatusMeaning
pendingWaiting for a receipt or a matching transfer.
partially_paidVerified amount is below the expected total.
manual_reviewA receipt needs a human decision.
verifiedPaid in full; entitlement and webhook fire.
failedTerminal failure with failure_code and failure_reason.
expiredThe checkout window elapsed.
canceledCanceled by you or the customer.

Verify a receipt

POST/api/v1/checkouts/:public_id/verify/
POST/api/public/gateway/checkouts/:public_id/verify/

Send multipart form data. The public endpoint is rate-limited and needs no key; the /api/v1 endpoint is app-scoped.

multipart/form-data
images[]        receipt image(s)
qr_payload      optional QR payload
text            optional SMS / receipt text
reference_number
bank_name
sender_account
receipt_url

A successful upload returns a verification id and status. The final result arrives on the checkout WebSocket and by webhook.

Cancel

POST/api/v1/checkouts/:public_id/cancel/

Cancels a checkout that is still open (pending, partially_paid, manual_review, or failed). Verified and expired checkouts cannot be canceled.

Recreate

POST/api/v1/checkouts/:public_id/recreate/

Creates a fresh checkout with the same product and customer context after expiry or cancellation. Use the new public_id; the old one stays terminal.

Hosted page

GET/api/public/gateway/checkouts/:public_id/

Returns the checkout, payment accounts, and instructions used by /pay/{public_id}. The pay URL path is relative to the same API host.

Dashboard

GET/api/platform/checkouts/
GET/api/platform/checkouts/:id/
POST/api/platform/checkouts/:public_id/cancel/
POST/api/platform/checkouts/:public_id/retry/

See How checkout works for the end-to-end flow and Errors for the error envelope.