Checkout session in subscription mode
Create a session with mode: "subscription" and lines that point at catalogue prices, then
redirect the customer to url.
201
Rules specific to subscription mode
The trial comes from the price: if the first recurring price carries
trialPeriodDays, the
subscription is born trialing and nothing is billed at confirmation. See
Trials.
Payment link of type subscription
To sell the same subscription to many customers without an API call per sale, create a
payment link with type: "subscription" and your recurring
prices. Every customer who pays through the link gets their own subscription.
Promotion codes are honored on this door: the discount applies to the first invoice and, per
the coupon’s duration, to the following ones. See Coupons.
Finding the subscription after payment
The session does not return the subscription’s identifier, and the return URL does not carry it either. Three paths:The subscription.created webhook (recommended)
The subscription.created webhook (recommended)
Its
data carries checkoutSessionId — the session that created it — and subscriptionId.
Match it to your client_reference_id by reading the session back if needed.The customer's subscriptions
The customer's subscriptions
GET /v1/customers/{cus}/subscriptions or GET /v1/subscriptions?customerId=cus_....
The customer is the one from customer_email.The subscription object itself
The subscription object itself
idempotencyKey equals cs_<session id> and metadata.checkout_session_id carries the
session: GET /v1/subscriptions then filter.What the customer sees
On the hosted page, the customer enters their email and Mobile Money number, then approves the payment request on their phone. The page waits for the operator’s answer; a trial is announced as such (“14-day trial”) and no amount is requested.The hosted page also serves invoices: the link emailed three days before each due date
leads to
pay.yabetoo.com/i/..., where the customer can settle early. See
Billing cycle.