subscription product. Use these endpoints to retrieve, update, pause, resume, or cancel them.
The subscription object
Unique identifier. Prefixed with
sub_.Always
"subscription".The customer this subscription belongs to.
The product being subscribed to.
One of
trialing, active, past_due, paused, or canceled.ISO 8601 timestamp. Start of the current billing period.
ISO 8601 timestamp. End of the current billing period.
If
true, the subscription will cancel at the end of the current period rather than renewing.ISO 8601 timestamp. Set when the subscription is canceled.
ISO 8601 timestamp. Set when the subscription is paused.
Number of trial days, if any.
Number of consecutive failed renewal attempts.
Arbitrary key-value data.
ISO 8601 timestamp.
ISO 8601 timestamp.
List subscriptions
GET /subscriptions?customer_id={customer_id}
Returns all subscriptions for a customer.
The customer whose subscriptions to list.
Retrieve a subscription
GET /subscriptions/{id}
Fetches the subscription and syncs its status with the Stellar network before returning.
related_resources (the product and asset) and last_attempt (the most recent payment).
Update a subscription
PUT /subscriptions/{id}
Body
Set to
true to schedule cancellation at the end of the current period, or false to undo a scheduled cancellation.Merged with existing metadata.
Swap to a different product.
Cancel a subscription
POST /subscriptions/{id}/cancel
Schedules the subscription to cancel at the end of the current billing period. The customer keeps access until current_period_end; no further renewals are charged. On-chain cancellation happens automatically when the period ends.
cancel_at_period_end: true and status still active.
To undo a scheduled cancellation before the period ends, use PUT /subscriptions/{id} with { "cancel_at_period_end": false }.
Pause a subscription
POST /subscriptions/{id}/pause
Resume a subscription
POST /subscriptions/{id}/resume

