Documentation Index
Fetch the complete documentation index at: https://docs.swiftpay.cx/llms.txt
Use this file to discover all available pages before exploring further.
API Reference
The SwiftPay API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes.Base URL
Authentication
The SwiftPay API uses API keys to authenticate requests. Include your API key in theAuthorization header:
Request Format
ForPOST and PUT requests, include a Content-Type: application/json header and pass parameters as JSON in the request body.
Response Format
All responses are returned as JSON objects with the following structure:Success Response
List Response
Error Response
HTTP Status Codes
| Code | Description |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid API key |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Resource doesn’t exist |
429 | Too Many Requests - Rate limit exceeded |
500 | Server Error - Something went wrong |
Pagination
List endpoints support cursor-based pagination:| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of results per page (default: 20, max: 100) |
cursor | string | Cursor for the next page of results |
Rate Limiting
API requests are rate limited per API key:| Tier | Requests/Min | Burst |
|---|---|---|
| Standard | 60 | 120 |
| Growth | 300 | 600 |
| Enterprise | Custom | Custom |
Idempotency
ForPOST requests, you can pass an Idempotency-Key header to ensure exactly-once delivery:
Versioning
The current API version isv1. The version is included in the URL path:
Currently, all routes are unversioned. Versioning will be introduced in
future releases with backward compatibility.
Available Endpoints
Balance
- GET /api/balance - Get your current balance
Checkout Sessions
- POST /api/checkout/sessions - Create a checkout session
- GET /api/checkout/sessions - List all sessions
- GET /api/checkout/sessions/:id - Get a session
Refunds
- POST /api/refunds - Create a refund
- GET /api/refunds - List all refunds
- GET /api/refunds/:id - Get a refund
Reserves
- GET /api/reserves/config - Get reserve configuration
- GET /api/reserves/summary - Get reserve summary
- GET /api/reserves - List all reserves
- GET /api/reserves/:id - Get a reserve
Withdrawals
- POST /api/withdrawals - Create a withdrawal
- GET /api/withdrawals - List withdrawals
- GET /api/withdrawals/:id - Get a withdrawal
- POST /api/withdrawals/:id/cancel - Cancel a withdrawal
Webhooks
- POST /api/webhooks - Create webhook endpoint
- GET /api/webhooks - List webhook endpoints
- GET /api/webhooks/:id - Get webhook endpoint
- PUT /api/webhooks/:id - Update webhook endpoint
- DELETE /api/webhooks/:id - Delete webhook endpoint
- GET /api/webhooks/events - List webhook events
- POST /api/webhooks/retry/:id - Retry event delivery
SDKs
Official SDKs are coming soon for:- Node.js / TypeScript
- Python
- PHP
- Go
- Ruby