Wonder

Recurring Payment

Set up subscription plans that auto-generate and auto-bill orders on a schedule. Define billing cycles with custom intervals, handle proration for mid-cycle starts, and configure retry logic and grace periods for failed payments. The system handles the calendar — you define the rules.

Workflow

The recommended order of operations to set up and run a subscription.

  1. Create a customerAPI . You need the customer_uuid to bind the plan.

  2. Create a recurring itemAPI with label, price and currency. Items are reusable across plans.

  3. Create a recurring billing configAPI to define the billing rhythm - billing_interval, interval_count and billing_proration_enabled.

  4. Create a recurring planAPI to bind the customer, billing config, item, and retry settings together. Define multiple cycles — like a free trial followed by paid billing — in one API call.

  5. Share the recurring payment link from the recurring plan's first order with the customer. The customer completes the first payment, and their card is automatically saved as a payment_token.

  6. The system auto-generates and auto-bills a new recurring order on each billing date using the saved token. Query plan lever ordersAPI or individual recurring orderAPI through the API.

INFO

Adding cycles mid-planAPI: Use the Add Plan Cycles API to upgrade, downgrade, or extend a plan. Choose immediate (start now, cancel active cycles), next_billing_date (start on the next billing date), or as_last_cycle (append to the end).

Recurring item

A recurring item is a product or service that will be billed on each cycle. Items are created once and can be reused across multiple plans.

FieldRequiredDescription
Reference_idNoYour external reference ID for this item. Use it to map with your inventory or product system.
LabelYesThe product name displayed to the customer.
PriceYesThe billing amount for this item per cycle.
CurrencyYesISO currency code. Must match your business configuration.
DescriptionNoInternal note or description for this item.

Recurring billing config

A billing config defines the rhythm and rules for when invoices are generated. Configs are reusable — create one and assign it to multiple plans.

FieldRequiredDescription
Billing_intervalYesThe fequency:daily,weekly,monthly ,yearly.
Interval_countYesNumber of intervals between billings. interval_count = 1 + monthly = every month. interval_count = 3 + monthly = every 3 months.
Billing_typeYes1. automated: start date = the date the plan is created.
2. customized: use billing_month and billing_day_of_month to set the billing date. Customized only works with monthly/yearly intervals.
Billing_monthNoOnly applicable when billing_type = customized and billing_interval = yearly.
Billing_day_of_monthNoOnly applicable when billing_type = customized.If the month doesn't have that day, the last day of the month is used (e.g. 31st → 28th/29th/30th).
Billing_proration_enabledYesIf true, partially completed billing periods are prorated. If false, the full amount is charged regardless of when the subscription starts within a cycle.
DescriptionNoInternal label for this config.
TIP

Proration example: A customer subscribes on 1st May 2026 to a yearly plan with billing_month = 3 and proration enabled. They are billed for the period 1st May 2026 – 1st March 2027 (304 of 365 days). The next billing date is 1st March 2027 at the full annual rate.

text
POST /svc/payment/api/v1/openapi/recurring_payments/billing_configs
{
  "config": {
    "billing_interval": "monthly",
    "interval_count": 1,
    "billing_type": "automated",
    "billing_proration_enabled": true,
    "description": "Monthly billing - prorated first cycle"
  }
}

Recurring plan

A plan binds a customer to a set of items and billing rules. It controls how payments are collected and what happens when a charge fails.

FieldRequiredDescription
NameYesThe plan name.
Reference_numberYesYour reference. All orders generated by this plan receive the same reference with an incremental suffix.
Customer_uuidYesThe customer assigned to this plan. The customer's saved payment token will be used for automatic charges.
Default_collection_methodYesCurrently only charge_automatically is supported — the system auto-charges the saved payment token on each billing date.
Payment_retry_countYesHow many times to retry a failed payment before giving up.
Payment_retry_day_periodYesHow many days to wait between retry attempts.
Grace_periodNoDays after the final failed retry before the system permanently voids the recurring order. If null, the order is never auto-voided.
Callback_urlNoWebhook URL for plan and order state changes.
Redirect_urlNoWhere to redirect the customer after completing the first order's payment.
NoteNoNotes applied to all recurring orders created by this plan.
DescriptionNoInternal remark about this plan.

Recurring cycle

An ordered list of billing phases within a plan. Each cycle has its own billing config, items, and duration — cycles execute sequentially, one after the other (e.g. a 1-month free trial cycle followed by an indefinite annual cycle).

FieldRequiredDescription
Previous_cycleOutputThe unique identifier (ID) of the previous cycle.
Next_cycleOutputThe unique identifier (ID) of the next cycle.
Estimated_start_dateOutputThe estimated cycle start time.
Start_dateOutputThe actual cycle start time.
Estimated_end_dateOutputThe estimated cycle end time.
End_dateOutputThe actual cycle end time.
Next_execute_timeOutputThe next billing date time.
TIP

Multiple cycles in one plan: You can define multiple cycles when creating a plan. Example: cycle 1 = free trial (1 month, 0 billing amount), cycle 2 = annual paid (12 months, full price). Cycles execute sequentially — the next one starts when the previous one completes.

Examples

ScenarioBilling intervalInterval countBilling typeExtraResult
Monthly subscriptionmonthly1automated-Billed on the same day each month.
Quartely billingmonthly3automated-Billed every 3 months.
Ann ual plan, fixed monthyearly1customizedbilling_month = 3Billed every March 1st
Annual plan, fixed dateyearly2customizedbilling_month = 3, billing_day_of_month = 5Billed every 2 years on March 5th.
Weekly, every 2 weeksweekly2automated-Billed every 2 weeks.

Create an itemAPI

Define a recurring product with a label, price, and currency. Items are reusable — create once, reference in multiple plans.

Create a billing configAPI

Define a billing schedule with interval, count, billing type, and proration settings. Configs are reusable across plans.

Create a planAPI

Create a recurring plan with customer, billing config, items, and retry settings. Define multiple cycles in one call. The response includes a current_payment_link to share with the customer for the first payment.

Get itemsAPI
Get billing configsAPI

List all recurring items or billing configs. Use the Advanced query DSLDOC for filtering and pagination.

Delete an itemAPI
Delete a billing configAPI

Remove an item or billing config. Ensure no active plan references the resource before deleting.

Get recurring plansAPI
Get a recurring planAPI

List all plans or get a single plan by ID. The response includes the plan details, active cycles, current order, and linked customer.

Add plan cyclesAPI

Add new cycles to an existing plan (upgrade/downgrade/extend). Choose immediate, next_billing_date, or as_last_cycle activation timing.

Cancel a planAPI

Cancel all active cycles of a plan. Choose immediate or next_billing_date. Optionally refund remaining credit.

Get plan ordersAPI
Get a recurring orderAPI

Query all orders generated by a plan, or get a single recurring order by ID. Use the Advanced query DSLDOC for filtering.