API Reference

Interact programmatically with your Checkout Page account using our REST API

The Checkout Page API is organized around REST principles. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Base URL

All API requests should be made to:

https://api.checkoutpage.com

Versioning

The Checkout Page API uses URL-based versioning. The current stable version is v1. All API endpoints are prefixed with the version number:

https://api.checkoutpage.com/v1/{endpoint}

We maintain backwards compatibility within each major version. When we introduce breaking changes, we release a new major version (e.g., v2). You'll have ample time to migrate before we deprecate older versions.

Rate limiting

API requests are rate limited based on the store and api key to ensure fair usage and system stability.

By default, stores are limited to:

  • 500 requests per minute

By default, API keys are limited to:

  • 100 requests per minute

If you exceed your api key or store rate limit, you'll receive a 429 Too Many Requests.

Need higher rate limits? Contact our support team to discuss custom rate limits for your use case.

Authentication

The Checkout Page API uses API key authentication with Bearer tokens. All API requests must be authenticated.

curl https://api.checkoutpage.com/v1/payments \
  -H "Authorization: Bearer YOUR_API_KEY"

Learn more about authentication in our Authentication guide.

HTTP status codes

The Checkout Page API uses conventional HTTP response codes to indicate the success or failure of an API request.

Status CodeDescription
200Successful request
201Resource created successfully
400Bad request - Invalid request parameters
401Unauthorized - Invalid or missing API key
403Forbidden - API key lacks required permissions
404Not found - The requested resource doesn't exist
429Too many requests - Rate limit exceeded
500Internal server error - Something went wrong on our end

Errors

When an error occurs, the API returns a JSON response with the following structure:

{
  "status": "error",
  "type": "error",
  "message": "Human-readable error description"
}

Example error response

{
  "status": "error",
  "type": "error",
  "message": "Missing or invalid API key"
}

Pagination

List endpoints that return multiple items are paginated using cursor-based pagination. Results are returned in reverse chronological order (newest first). These endpoints accept the following query parameters:

ParameterTypeDefaultDescription
limitinteger20Number of items per page. Minimum value is 1, maximum is 100.
starting_afterstring-A cursor (resource ID) to start after. Retrieves items that appear after this cursor in the list. Cannot be used with ending_before.
ending_beforestring-A cursor (resource ID) to end after. Retrieves items that appear before this cursor in the list. Cannot be used with starting_after.

Paginated response

{
  "data": [...],
  "has_more": true,
  "total": 150
}

The has_more field indicates whether there are additional items available. Use the ID of the last item in the data array with starting_after to fetch the next page.

Pagination examples

Examples are using the Checkout Page SDK.

Get the first page:

const firstPage = await checkoutpage.subscriptions.list({ limit: 50 });

Get the next page:

const nextPage = await checkoutpage.subscriptions.list({
  limit: 50,
  starting_after: firstPage.data[firstPage.data.length - 1].id,
});

Get the previous page:

const previousPage = await checkoutpage.subscriptions.list({
  limit: 50,
  ending_before: nextPage.data[0].id,
});

NodeJS Example

const BASE_URL = 'https://api.checkoutpage.com/v1/payments';
const HEADERS = {
  Authorization: 'Bearer sk_live...',
};

async function fetchPayments(params) {
  const url = `${BASE_URL}?${new URLSearchParams(params)}`;
  const res = await fetch(url, { headers: HEADERS });
  return res.json();
}

await (async () => {
  // Get the first page
  const firstPage = await fetchPayments({ limit: 1 });
  console.log('First payment:', firstPage.data[0].id);

  // Get the second page
  const secondPage = await fetchPayments({
    limit: 1,
    starting_after: firstPage.data[0].id,
  });
  console.log('Next payment:', secondPage.data[0].id);

  // Get the previous page
  const previousPage = await fetchPayments({
    limit: 1,
    ending_before: secondPage.data[0].id,
  });
  console.log('Previous payment:', previousPage.data[0].id);
})();

Timestamps

All timestamps are returned in ISO 8601 format:

2024-01-15T10:30:00.000Z

Getting started

Ready to get started? Follow these steps:

  1. Create an account on Checkout Page
  2. Generate your API key from the dashboard
  3. Make your first API request to verify your integration

API Resources

Explore our API endpoints organized by resource:

Support

Need help? We're here for you: