How it works under the hood: When the customer pays, Checkout enrolls them in a recurring plan through OzuraPay API instead of making a one-time sale. The first charge happens right then, at signup; OzuraPay API runs every later charge on the plan’s schedule. Card details never reach your server.
Enable Recurring Mode
SetcheckoutMode to "recurring" and include a recurringConfig object:
recurringConfig Fields
Required
Optional
All fields below are optional. When omitted, they are not stored on the session and not sent to OzuraPay API — any defaults listed are applied by the OzuraPay API, not by Checkout.Type note:
intervalCount, initialCycles, maxCycles, and maxAttempts must be JSON numbers (not strings). initialAmount and setupFee must be JSON strings with at most 2 decimal places (like "9.99"). This matches how OzuraPay API expects them.Billing Schedule
The plan’s schedule always starts when the customer completes payment:- First charge: at signup, when the customer pays. Checkout shows it as Due today.
- Every later charge: one billing period after the previous one (
interval×intervalCount), at the same time of day. Monthly and yearly plans keep the same day of the month (in UTC); in a shorter month the charge moves to that month’s last day (a plan started on January 31 next charges on February 28, or 29 in a leap year).
startDate doesn’t delay billing. It was never sent to the payment processor, so it never moved the first charge. To give customers a free first period, use initialAmount: "0.00" with initialCycles: 1: nothing is charged at signup, and the regular amount is charged one billing period later. See Trial Pricing.amount Field
The amount on the session is the standard recurring charge — what the customer is billed on each normal billing cycle.
amount, setupFee, initialAmount, and initialCycles as separate fields to OzuraPay API, which combines them and calculates the actual charge. Checkout shows the same first-charge amount to the customer as Due today (plus sales tax, see Sales Tax), but the charge itself is always calculated by OzuraPay API. The first cycle is charged at signup.
There is no field called
intervalAmount. The field that overrides the billing amount for the first N cycles is initialAmount.Sales Tax
Unless the session istaxExempt, tax (sales tax in the US; VAT, GST or sales tax in other covered countries) is calculated from the customer’s billing address and added to every charge: the first charge at signup and each later charge.
In the order summary, once the customer has entered a complete billing address, checkout shows:
- Tax and Due today: the exact tax on the first charge and the total charged at signup.
- *Then 10.98 every month for 2 more charges, then $109.75 every month, with each amount taxed on its own.
Surcharge
Add a credit card surcharge to the recurring charge usingsurchargePercent.
Hosted payment sessions: when the customer enters their card on the processor’s secure hosted payment page (the default), Checkout doesn’t apply
surchargePercent: it’s accepted but ignored, and no surcharge line is shown in the order summary. Any surcharge is applied by the processor on its hosted page, based on how your processor account is configured.- Accepts a string (
"2.00") or number (2.0) - Maximum
"3.00"(Florida 3% cap) - Displayed as a separate line item:
Surcharge (2.00%) - Applied to the base
amountbefore tax
Trial Pricing
UsesetupFee, initialAmount, and initialCycles together to offer introductory pricing.
Setup Fee Only
A one-time fee added to the first billing cycle:Introductory Rate
Override the amount for the first N cycles:Combined (Setup Fee + Trial)
Sales tax is added to each of these amounts unless the session is tax-exempt — see Sales Tax.
Interval Examples
Useinterval alone for standard periods. Add intervalCount to create any custom period — the two fields multiply together.
intervalCount is a JSON number (not a string). "intervalCount": "3" will return a 400 validation error.Capped Plans
UseendDate or maxCycles to automatically stop billing:
maxCycles counts the first charge at signup, so 12 means the signup charge plus 11 more.
Full Example
Monthly subscription with a $5.00 setup fee, a free first month, a 12-cycle cap, and a 3% surcharge (applied only on sessions where Checkout applies surcharges — see Surcharge):What the Customer Sees
The checkout page displays a Subscription Summary block above the payment form showing:- Plan name and description
- The regular amount and billing interval (e.g.
$49.99 / month) - Next charge: the date of the first charge after signup — see Billing Schedule
- Billing ends and Total cycles (if
endDateormaxCyclesis set) - Intro price (for example $10.00 for the first 3 charges) and One-time setup fee (if
initialAmountorsetupFeeis set). The first charge is the intro price plus the setup fee. - Tax, Due today, and Then $X every month — see Sales Tax
- A surcharge row, only on sessions where Checkout applies
surchargePercent— see Surcharge
endDate or maxCycles) are left out.
The payment form and button are otherwise identical to a standard payment session.
Success Redirect
After a successful recurring signup, the customer is redirected to yoursuccessUrl with the standard transaction parameters:
Combine with Payment Links
Create a shareable recurring subscription link:POST /api/payment-links/create and share the returned url. Each customer who visits the link and pays is enrolled in their own plan, with a schedule that starts when they pay. See Payment Links for full details.
Surcharge Reference
surchargePercent is independent of checkoutMode — it works on standard payment sessions too. On hosted payment sessions (the default) it’s accepted but ignored; see Surcharge.
When Checkout applies it, the surcharge is:
- Displayed as a line item in the order summary:
Surcharge (X.XX%) - Applied to the base
amount(before tax) - Forwarded to the payment processor on every charge (including recurring cycles)
- Applied to debit cards at the processor’s discretion — OzuraPay API performs a BIN lookup and excludes debit cards automatically where required
Subtotal $100.00 + Surcharge (3.00%) $3.00 = Total $103.00