https://api.agentaos.ai/api/v1
Authentication: x-api-key header with your secret key.
SDK vs REST API: The TypeScript SDK (
@agentaos/pay) wraps these endpoints. Method mapping: checkouts.create() → POST /gateway/sessions, checkouts.retrieve() → GET /gateway/sessions/:id. The SDK uses camelCase field names (checkoutUrl), the REST API uses snake_case (checkout_url).Checkout Sessions
Create Session
Amount in currency units (e.g.
49.99). Required if no linkId.EUR or USD. Defaults to org settlement currency.Shown on checkout page. Max 1000 chars.
Redirect customer here after payment. HTTPS only.
“Cancel” link on checkout page. HTTPS only.
Server notification URL. HTTPS only.
UUID of pre-created tax rate.
Pre-populate buyer email.
Pre-populate buyer name.
Pre-populate company name.
ISO 3166-1 alpha-2 (e.g.
DE).VAT number (e.g.
DE123456789).Custom key-value data. Max 8KB.
Seconds until expiry (300-86400).
Create from a payment link template.
POST /gateway/sessions
Retrieve Session
GET /gateway/sessions/:sessionId
List Sessions
GET /gateway/sessions
| Parameter | Type | Description |
|---|---|---|
status | string | open, completed, expired, cancelled |
limit | number | Max results (1-100, default 10) |
offset | number | Pagination offset |
Cancel Session
POST /gateway/sessions/:sessionId/cancel
Payment Links
Create Payment Link
POST /gateway/payment-links
List Payment Links
GET /gateway/payment-links
Cancel Payment Link
DELETE /gateway/payment-links/:id
Transactions
List Transactions
GET /gateway/all-transactions
| Parameter | Type | Description |
|---|---|---|
direction | string | all, inbound, outbound |
from | string | Start date (ISO 8601) |
to | string | End date (ISO 8601) |
limit | number | Max results |
offset | number | Pagination offset |
Invoices
List Invoices
GET /gateway/invoices
Download Invoice PDF
GET /gateway/invoices/:id/pdf
Download Monthly Statement
GET /gateway/invoices/statement
Export CSV
GET /gateway/invoices/export
Void Invoice
POST /gateway/invoices/:id/void
Errors
| Status | Meaning |
|---|---|
400 | Bad request - invalid parameters |
401 | Unauthorized - invalid or missing API key |
403 | Forbidden - key doesn’t have access |
404 | Not found - resource doesn’t exist |
409 | Conflict - idempotency conflict |
429 | Rate limited (check Retry-After header) |
500 | Server error - retry with backoff |
Rate Limits
| Endpoint | Limit |
|---|---|
POST /gateway/send | 20/min |
| All authenticated endpoints | 100/min |
| Public endpoints | 30/min |