API Reference
The PaymentKit 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 and authentication.
Base URL
All API requests should be made to:
For example, to list customers: https://api.paymentkit.com/api/customers
Authentication
The PaymentKit API uses API keys to authenticate requests. You can view and manage your API keys in the Dashboard.
Authentication is performed via HTTP Bearer token. Include your secret token in the Authorization header:
PaymentKit provides two types of tokens:
Your secret tokens carry many privileges, so keep them secure. Do not share them in publicly accessible areas such as GitHub, client-side code, or browser requests.
Request format
Send request data as JSON with the Content-Type: application/json header:
Errors
PaymentKit uses conventional HTTP response codes to indicate the success or failure of an API request.
Error responses include a JSON body with details:
The request_id can be used when contacting support to help diagnose issues.
Pagination
List endpoints return paginated results. Use limit and offset query parameters:
Paginated responses include metadata:
Expanding responses
Some endpoints support expanding related data. Use the expand query parameter:
Available expansions vary by endpoint. Common expansions include custom_fields for entities that support custom field values.
Deprecations
PaymentKit follows semantic versioning and provides advance notice before deprecating API endpoints or features. Active deprecations are documented in endpoint-specific guides with migration paths to replacement functionality.
Currently announced deprecations:
- Change subscription plan endpoint — Replacement: Subscription change requests
When an endpoint is deprecated, we:
- Announce the deprecation in documentation with migration guides
- Add
Deprecation: trueandSunset: <date>headers to API responses (minimum 6 months notice) - Sunset the endpoint on the announced date (returns 410 Gone with replacement endpoint)
IDs
All objects have a unique identifier prefixed with the object type and environment:
The environment segment is prod for production or stg for staging.