API Reference
Base URL: https://birrpay-beta1b.pages.dev/api/v1 — Auth: Authorization: Bearer sk_test_...
All responses use the envelope { "ok": true, "data": ... } or { "ok": false, "error": { "code", "message" } }.
Checkout sessions
| Endpoint | Method | Description |
|---|---|---|
/checkout/sessions |
POST | Create a session. Supports Idempotency-Key header. |
/checkout/sessions/:id |
GET | Retrieve a session by id or reference. |
/checkout/sessions/:id/expire |
POST | Force-expire an open session. |
Transactions
| Endpoint | Method | Description |
|---|---|---|
/transactions |
GET | List. Query: status, provider, customer, limit, cursor. |
/transactions/:reference |
GET | Authoritative verification of one transaction. |
Other
| Endpoint | Method | Description |
|---|---|---|
/customers |
GET/POST | List derived customers / save a customer. |
/events |
GET | Your app's event log. |
/webhooks/test |
POST | Fire a signed test.event to your endpoint. |
/ping |
GET | Key identity check. |
Error codes
| Code | Meaning |
|---|---|
invalid_request |
Validation failed — see message. |
unauthorized |
Missing/invalid key. |
forbidden |
Key lacks scope for this action. |
not_found |
Unknown resource for this app. |
conflict |
Duplicate reference. |
idempotency_conflict |
Same key, different payload. |
rate_limited |
Slow down — see Retry-After. |
provider_error |
Upstream gateway failed — safe to retry. |
Ready to take your first payment?
Create account