05 subscriptions

Subscriptions are recurring payment relationships between subscribers and plans. Create a Plan once, then anyone can subscribe via the public payment link.

How Subscriptions Work

1. Merchant creates Plan (one-time)
2. Plan gets public URL → /subscribe/plan_xxx
3. Subscriber visits → Enters email → Selects chain/currency
4. Subscriber approves token spending in wallet
5. Subscription created → Billing runs automatically

Plan vs Subscription

Concept
Description

Plan

Product template — reusable, shareable

Subscription

Customer instance — one per subscriber

See Plansarrow-up-right for creating and managing Plans.


Subscription Lifecycle

pending_approval → trialing → active → cancelled
                          ↘ active → paused → active
                                   ↘ past_due → active
                                             ↘ cancelled
                 → expired (approval timeout)
Status
Description

pending_approval

Awaiting wallet approval

trialing

In free trial period

active

Subscription is running

paused

Temporarily paused

past_due

Charge failed, retrying

cancelled

Subscription ended

expired

Approval never completed


Create Subscription (Merchant API)

Pre-create a subscription for a specific user.

Request

Parameters

Field
Type
Required
Description

plan_id

string

Plan to subscribe to

subscriber_email

string

Subscriber's email

subscriber_external_id

string

Your internal customer ID

metadata

object

Custom data

Response


Public Subscribe (Self-Service)

Anyone can subscribe via the Plan's public page.

Request

Response


Approval Flow

Step 1: Subscriber Enters Email

On the plan page (/subscribe/plan_xxx), subscriber enters their email.

Step 2: Select Chain & Currency

Subscriber chooses from the plan's accepted chains and currencies.

Step 3: Connect Wallet & Approve

Subscriber connects their wallet and signs a token approval transaction.

Step 4: Confirm Approval

After wallet approval, call the confirm endpoint:

Step 5: Subscription Activates


Get Subscription

Response


Get Subscription (Public)

For approval pages. No authentication required.

Response


List Subscriptions

Query Parameters

Parameter
Type
Description

status

string

Filter by status

plan_id

string

Filter by plan

chain

string

Filter by approved chain

subscriber_wallet

string

Filter by wallet

subscriber_email

string

Filter by email

page

number

Page number

limit

number

Items per page

Response


Pause Subscription

Temporarily stop billing. The subscriber keeps their approval.

Response


Resume Subscription

Resume a paused subscription.

Response


Cancel Subscription

Request

Field
Type
Description

at_period_end

boolean

Cancel at end of period (default: true)

reason

string

Cancellation reason

Response


List Charges

Query Parameters

Parameter
Type
Description

escrow_status

string

Filter by pending, funded, released, refunded

page

number

Page number

limit

number

Items per page

Response


Refund Charge

Refund a charge that's still in escrow.

Request

Response


Subscription Webhooks

Event
Description

subscription.created

Subscription created

subscription.approved

Subscriber approved spending

subscription.charged

Successful charge

subscription.charge_failed

Charge failed

subscription.charge_released

Charge released to merchant

subscription.charge_refunded

Charge refunded

subscription.paused

Subscription paused

subscription.resumed

Subscription resumed

subscription.cancelled

Subscription cancelled

subscription.low_allowance

Allowance below 2× charge amount

subscription.approval_expiring

Approval expires within 7 days

Example Payload


Trial Periods

Plans can include free trial periods. During trial:

  1. Subscription status is trialing

  2. No charges until trial ends

  3. First charge scheduled for trial_end date


Handling Failed Charges

When a charge fails:

  1. Subscription moves to past_due

  2. Stablix retries 3 times over 7 days

  3. After 3 failures, subscription stays past_due

  4. You receive subscription.charge_failed webhooks

Retry Schedule

Attempt
Timing

1

Immediately

2

24 hours later

3

48 hours later


Escrow & Buffer Period

Charges go into escrow before release:

  1. Charge → Funds held in escrow

  2. Buffer Periodbuffer_hours from plan (default: 24)

  3. Release → Funds sent to merchant + splits

This allows time for dispute resolution.


Best Practices

  1. Use Plans — Create plans and share payment links instead of creating subscriptions manually.

  2. Set appropriate trials — 7-14 day trials reduce friction.

  3. Monitor webhooks — Handle charge_failed and low_allowance events.

  4. Communicate with subscribers — Send emails before charges and when issues occur.

  5. Use external_id — Link subscriptions to your internal customer records.

Last updated