v1

latestOpenAPI 3.0.02026-07-243678114.1 KB
Subscriptions

List Subscriptions

The List Subscriptions endpoint allows you to retrieve a list of all active subscriptions within your organization. Use this endpoint to track and manage your organization's ongoing subscriptions with its customers.

📘 Note

A subscription is created automatically when a customer makes a payment on a recurring plan. Use this endpoint to track all active subscriptions.

get/v1/subscriptions

Query parameters

customer_idstring

Retrieve a list of subscriptions for a particular customer.

status'Pending' | 'Active' | 'Canceled' | 'InTrial'

Retrieve subscriptions based on their respective status.

afterstring

Retrieve subscriptions after this timestamp.

beforestring

Retrieve subscriptions before this timestamp.

limitinteger

Maximum number of subscriptions to retrieve per page (default=100).

pageinteger

Page number of the results to retrieve (default=1).

sincestring

Retrieve subscriptions since this timestamp.

sort'asc' | 'desc'

Sort order for the retrieved subscriptions (ascending or descending).

untilstring

Retrieve subscriptions until this timestamp.

Response

OK

errorboolean

Example response

{
  "data": {
    "items": [
      {
        "created_at": "2023-01-01T12:00:00Z",
        "currency": "USD",
        "customer": {
          "created_at": "2023-01-01T12:00:00Z",
          "deleted_at": "2023-01-05T10:00:00Z",
          "email": "customer@example.com",
          "id": "customer123",
          "name": "John Doe",
          "org_id": "org123",
          "reference": "REF-123456",
          "updated_at": "2023-01-02T09:00:00Z"
        },
        "customer_id": "customer123",
        "id": "sub123",
        "items": [
          {
            "created_at": "2023-01-01T12:00:00Z",
            "id": "item123",
            "plan_id": "plan456",
            "subscription_id": "sub123",
            "updated_at": "2023-01-02T09:00:00Z"
          }
        ],
        "org_id": "org123",
        "reference": "REF-123456",
        "start_at": "2023-01-05T10:00:00Z",
        "updated_at": "2023-01-02T09:00:00Z"
      }
    ],
    "last_update": "2021-01-01T00:00:00Z",
    "next": 10,
    "total": 10
  }
}