Retrieve Subscription

GET/subscriptions/{subscription_id}

Path Parameters

subscription_idstringrequired

The unique identifier of the subscription.

Response

200

idstring
namestring
descriptionstring
account_idstring
countrystring

The subscription’s country (ISO 3166-1 alpha-2).

merchant_referencestring
soft_descriptorstring
statusstring
amountobject
Show amount properties
currencystring
valuenumber
frequencyobject
Show frequency properties
typestring
valueinteger
billing_cyclesobject
Show billing_cycles properties
totalinteger
currentinteger
next_atstring
scheduling_datestring

When the debit instruction is handed to the Pix rail — next_at minus four days. Only present on PIX_AUTOMATIC subscriptions that WHITELABEL executes, and only where the four-day scheduling lead is enabled for the organization; absent, not null, otherwise. Read-only. See Pix Automático.

paidinteger

How many cycles have been paid so far. Distinct from current, which is the cycle being billed.

current_period_startstring

Start of the billing period the subscription is currently in, one cadence before current_period_end. Inside a trial or any other plan phase it follows that phase’s cadence. A terminal subscription (CANCELED or COMPLETED) keeps its final window rather than going null. Null only for a subscription with no recurring cadence. Always returned together with current_period_end.

current_period_endstring

End of the billing period the subscription is currently in. Equal to billing_cycles.next_at. Always returned together with current_period_start.

billing_dateobject

Only present on subscriptions billed on a fixed date instead of a frequency; mutually exclusive with frequency.

Show billing_date properties
typestring
dayinteger
customer_payerobject
Show customer_payer properties
idstring
payment_methodobject
Show payment_method properties
typestring
vaulted_tokenstring
cardobject
Show card properties
installmentsinteger
network_transaction_idstring
usagestring
availabilityobject
Show availability properties
start_atstring
finish_atstring
retriesobject

The retry policy applied when a recurring charge is declined. See Retries.

Show retries properties
retry_on_declineboolean

Whether declined charges are retried at all.

amountinteger

How many retries a billing cycle gets. Capped by your environment’s retry schedule length (6 in production).

strategystring

How the timing of each retry is decided: DEFAULT, SMART or CUSTOM_SCHEDULE. Treat as open-ended — handle unrecognized values gracefully.

scheduleobject[]

The per-attempt schedule, only set when strategy is CUSTOM_SCHEDULE; null otherwise.

stop_on_hard_declineboolean

When true, a hard decline stops the retries for the current billing cycle.

cancel_on_exhausted_retriesboolean

When true, the subscription is canceled once a cycle’s retries end without a successful payment, with cancellation_source set to RETRIES_EXHAUSTED.

profilestring

The fixed retry ladder the subscription follows instead of the configurable schedule. Always PIX_AUTOMATIC. This field and the three below are only present on PIX_AUTOMATIC subscriptions that WHITELABEL executes; they are absent, not null, on every other payment method. See Pix Automático.

max_attemptsinteger

How many retries the Pix ladder runs. Always 3, matching the amount reported for these subscriptions.

min_gap_hoursinteger

Always 24 — the gap between the ladder’s debit dates (D, D+1, D+2, D+3), not between dispatch attempts.

untilstring

When the ladder stops — billing_cycles.next_at plus 7 days. Moves with next_at at every renewal.

trial_periodobject
Show trial_period properties
billing_cyclesinteger
amountobject
Show amount properties
valuenumber
currencystring
metadataobject[]
Show metadata properties
keystring
valuestring
additional_dataobject

The optional order enrichment sent at creation, echoed back. See The Subscription Object for its full shape.

initial_payment_validationboolean

Whether the subscription waited for its first payment to succeed before activating. false by default.

reasonstring

Free-form reason for the subscription’s current status, when one was recorded; null otherwise.

renewal_notification_daysinteger

How many days before the next billing date the subscription.close_to_renewal webhook is sent. null means no renewal notification is sent.

paymentsstring[]
subscription_agreement_idstring
cancellation_timestring

When the subscription was canceled. Only set once it reaches CANCELED; null otherwise.

cancellation_sourcestring

What triggered the cancellation: MERCHANT, SYSTEM, PLAN_CHANGE or RETRIES_EXHAUSTED. Only set once the subscription reaches CANCELED; null otherwise. Treat as open-ended — handle unrecognized values gracefully.

ending_timestring

When the subscription completed or expired. Only set once it reaches COMPLETED; null otherwise.

plan_idstring

Only present when the subscription is linked to a plan.

plan_assigned_atstring

Only present on plan-linked subscriptions. The moment the plan was attached — at creation from a plan, migration onto a plan, or a plan change.

previous_subscription_idstring

Only present when this subscription was created by a plan change (switching an existing subscription to a different plan).

phasesobject[]

The linked plan’s phase definitions, as the plan declares them — including the terminal REGULAR phase. Only present on plan-linked subscriptions whose plan has phases. This is the plan’s own ladder, not this subscriber’s snapshot: for what was pinned for this subscription at creation, use billing_phases.

Show phases properties
orderinteger
namestring
typestring

TRIAL or REGULAR.

durationobject

How long the phase lasts. null on the terminal REGULAR phase, which runs until the subscription ends.

Show duration properties
typestring
valueinteger
frequencyobject

How often the phase bills. null on the terminal REGULAR phase, which bills at the plan’s own frequency.

Show frequency properties
typestring
valueinteger
amountobject

The phase price. null on the terminal REGULAR phase, whose price resolves from the plan at every billing.

Show amount properties
currencystring
valuenumber
total_paymentsinteger
country_pricesobject[]

Per-country overrides of the phase price, empty when the phase has none.

Show country_prices properties
countrystring
amountobject
Show amount properties
currencystring
valuenumber
current_phasestring

Only present on plan-linked subscriptions.

current_phase_endstring

When the phase named by current_phase hands over to the next one — for a subscription in its trial, when it switches to the regular price. End of the last billing period the phase covers, so on the final period of a trial it equals current_period_end. Null for a subscription with no plan and for one that already left the phase ladder.

billing_phasesobject[]

Only present on plan-linked subscriptions whose plan has phases. Contains the leading TRIAL phases only, snapshotted at creation — the terminal REGULAR phase is never included, since its price isn’t pinned and instead resolves from the plan at every billing. current_phase: "REGULAR" is how you know the ladder is exhausted.

Show billing_phases properties
orderinteger
typestring

Always TRIAL — the terminal REGULAR phase is never in this array.

namestring
amountobject
Show amount properties
currencystring
valuenumber
frequencyobject
Show frequency properties
typestring
valueinteger
start_cycleinteger
end_cycleinteger
pending_plan_changeobject

The plan change scheduled for the next billing cycle, or null when none is pending. Schedule one with the plan_change block on Update Subscription.

Show pending_plan_change properties
plan_idstring

The identifier of the target plan.

plan_namestring

The name of the target plan.

direction"UPGRADE" | "DOWNGRADE"

Whether the target plan is an upgrade or a downgrade. Informational only.

effective"NEXT_BILLING_CYCLE"

When the change applies.

phases_behavior"START_FROM_REGULAR" | "HONOR_PHASES"

What happens when the target plan has phases.

applies_atstring

The billing event the change will take effect on — the subscription’s next billing date.

requested_atstring

When the change was scheduled.

created_atstring
updated_atstring

400

Request
curl -X GET "https://api-sandbox.whitelabel.com/v1/subscriptions/<subscription_id>" \
  -H "public-api-key: <public-api-key>" \
  -H "private-secret-key: <private-secret-key>"
Response
{
  "id": "7304911d-5df9-429e-8488-ad41abea1a4c",
  "name": "sub_001",
  "description": "streaming service",
  "account_id": "2404911d-5df9-429e-8488-ad41abea1a4b",
  "country": "US",
  "merchant_reference": "001_marzo_23",
  "soft_descriptor": "ACME SUBSCRIPTION",
  "status": "ACTIVE",
  "amount": {
    "currency": "USD",
    "value": 12100
  },
  "frequency": {
    "type": "MONTH",
    "value": 1
  },
  "billing_cycles": {
    "total": 10,
    "current": 2,
    "next_at": "2023-02-16T20:00:00.786342Z",
    "scheduling_date": "2026-11-27T00:00:00Z",
    "paid": 0
  },
  "current_period_start": "2023-01-16T20:00:00.912480Z",
  "current_period_end": "2023-02-16T20:00:00.786342Z",
  "billing_date": {
    "type": "DAY",
    "day": 2
  },
  "customer_payer": {
    "id": "3t04911d-5df9-429e-8488-ad41abea1a2c"
  },
  "payment_method": {
    "type": "CARD",
    "vaulted_token": "6104911d-5df9-429e-8488-ad41abea1a4b",
    "card": {
      "installments": 0,
      "network_transaction_id": "string",
      "usage": "FIRST"
    }
  },
  "availability": {
    "start_at": "2024-01-16T00:00:00.786342Z",
    "finish_at": "2024-05-26T20:00:00.786342Z"
  },
  "retries": {
    "retry_on_decline": true,
    "amount": 4,
    "strategy": "DEFAULT",
    "schedule": [
      {}
    ],
    "stop_on_hard_decline": true,
    "cancel_on_exhausted_retries": true,
    "profile": "PIX_AUTOMATIC",
    "max_attempts": 3,
    "min_gap_hours": 24,
    "until": "string"
  },
  "trial_period": {
    "billing_cycles": 1,
    "amount": {
      "value": 0,
      "currency": ""
    }
  },
  "metadata": [
    {
      "key": "sub_ext_id",
      "value": "AA001"
    }
  ],
  "additional_data": {},
  "initial_payment_validation": false,
  "reason": "merchant request",
  "renewal_notification_days": 3,
  "payments": [
    "5104911d-5df9-229e-8468-bd41abea1a4s"
  ],
  "subscription_agreement_id": "sa_6af2dfcd-44c0-4f16-a331-8bed3ed9c9fa",
  "cancellation_time": "2023-12-16T20:46:54.786342Z",
  "cancellation_source": "MERCHANT",
  "ending_time": "2024-12-16T20:46:54.786342Z",
  "plan_id": "00000000-0000-4000-8000-000000000001",
  "plan_assigned_at": "2023-12-16T20:46:54.786342Z",
  "previous_subscription_id": "string",
  "phases": [
    {
      "order": 0,
      "name": "string",
      "type": "string",
      "duration": {
        "type": "string",
        "value": 0
      },
      "frequency": {
        "type": "string",
        "value": 0
      },
      "amount": {
        "currency": "string",
        "value": 0
      },
      "total_payments": 0,
      "country_prices": [
        {
          "country": "string",
          "amount": {
            "currency": "string",
            "value": 0
          }
        }
      ]
    }
  ],
  "current_phase": "REGULAR",
  "current_phase_end": "2023-03-16T20:00:00.786342Z",
  "billing_phases": [
    {
      "order": 0,
      "type": "string",
      "name": "string",
      "amount": {
        "currency": "string",
        "value": 0
      },
      "frequency": {
        "type": "string",
        "value": 0
      },
      "start_cycle": 0,
      "end_cycle": 0
    }
  ],
  "pending_plan_change": {
    "plan_id": "1904911d-5df9-429e-8488-ad41abea1a4d",
    "plan_name": "Pro",
    "direction": "UPGRADE",
    "effective": "NEXT_BILLING_CYCLE",
    "phases_behavior": "START_FROM_REGULAR",
    "applies_at": "2023-02-16T20:00:00.786342Z",
    "requested_at": "2023-01-20T10:12:31.786342Z"
  },
  "created_at": "2023-12-16T20:46:54.786342Z",
  "updated_at": "2023-12-16T21:00:54.786342Z"
}