List Subscription Payments

This is a net-new endpoint

There was no payments subresource before Plans — the payments array on the subscription object is a legacy, always-empty field. Since there’s no prior merchant integration to preserve here, this endpoint ships as one clean data[] shape with full plan/phase context — no legacy fields.

offset must be a multiple of limit

A non-aligned offset would re-serve rows you already saw and corrupt has_more, so it’s rejected with 400 BAD_REQUEST instead of being silently floored.

Free cycles are total: 0, not a distinct status

A $0 billing cycle (e.g. a free trial payment) is recognizable by total == 0 — there’s no separate “free” status.

GET/subscriptions/{subscription_id}/payments

Returns the charge history for a subscription — one row per billing attempt, including plan/phase context when the subscription is linked to a plan. This is a net-new endpoint (there was no payments subresource before Plans), so it ships as a single, clean shape with no legacy fields to carry.

Path Parameters

subscription_idstringrequired

The unique identifier of the subscription.

Query Parameters

limitinteger

Max items to return. 1-100, defaults to 20.

offsetinteger

Number of items to skip. Must be a non-negative multiple of limit, else 400 BAD_REQUEST — a non-aligned offset would re-serve rows you already saw and corrupt has_more. Defaults to 0.

Response

200

dataobject[]

Every payment attempt for this subscription, most recent first.

Show data properties
idstring
payment_idstring
idempotency_keystring
statusstring

Platform vocabulary: SUCCEEDED, DECLINED, REJECTED, ERROR, PENDING, CREATED, CANCELED — not the engine’s internal EXECUTED.

sub_statusstring
providerstring

null for $0 cycles, the starter row, and rows charged before the provider-capture field existed.

payment_methodobject
Show payment_method properties
idstring
typestring
amountobject
Show amount properties
currencystring
valuenumber
currencystring
subtotalnumber
totalnumber
plan_idstring

null for raw (non-plan) subscriptions.

line_itemsobject[]
Show line_items properties
typestring
labelstring
service_periodobject
Show service_period properties
startstring
endstring
amountobject
Show amount properties
currencystring
valuenumber
phaseobject

null for the starter row and for legacy (non-plan) rows.

Show phase properties
indexinteger
namestring
typestring
phase_paymentinteger

1..N within the current phase. null on the starter row.

billing_cycleinteger

0 = starter row, null = TRIAL-phase rows, 1.. from the first REGULAR-phase payment.

retryobject
Show retry properties
countinteger
forcedboolean
trace_idstring
created_atstring
updated_atstring
paginationobject
Show pagination properties
totalinteger
limitinteger
offsetinteger
has_moreboolean
Request
curl -X GET "https://api-sandbox.whitelabel.com/v1/subscriptions/<subscription_id>/payments?limit=<limit>&offset=<offset>" \
  -H "public-api-key: <public-api-key>" \
  -H "private-secret-key: <private-secret-key>"
Response
{
  "data": [
    {
      "id": "string",
      "payment_id": "string",
      "idempotency_key": "string",
      "status": "string",
      "sub_status": "string",
      "provider": "string",
      "payment_method": {
        "id": "string",
        "type": "string"
      },
      "amount": {
        "currency": "string",
        "value": 0
      },
      "currency": "string",
      "subtotal": 0,
      "total": 0,
      "plan_id": "string",
      "line_items": [
        {
          "type": "string",
          "label": "string",
          "service_period": {
            "start": "string",
            "end": "string"
          },
          "amount": {
            "currency": "string",
            "value": 0
          }
        }
      ],
      "phase": {
        "index": 0,
        "name": "string",
        "type": "string"
      },
      "phase_payment": 0,
      "billing_cycle": 0,
      "retry": {
        "count": 0,
        "forced": true
      },
      "trace_id": "string",
      "created_at": "string",
      "updated_at": "string"
    }
  ],
  "pagination": {
    "total": 0,
    "limit": 0,
    "offset": 0,
    "has_more": true
  }
}