Trial periods
Subscriptions can include a trial period during which no payment is required. When the trial ends, the first billing cycle starts and the payer is charged (or sent a payment link) according to collection_method.
How trials work
- trial_period_days — Set at creation; the subscription starts in
trialingstatus. For the given number of days from creation, no payment is collected. - trial_end — Optional ISO timestamp to set an explicit trial end. You can also set
trial_end: "now"to effectively start without a trial. - When the trial ends:
- If
collection_methodissend_payment_link: a payment link for the first period is created and (if configured) the payer is emailed. - If
collection_methodisauto_charge: the payer must have approved the allowance before or when the trial ends; otherwise the subscription may move topauseduntil they approve.
- If
- subscription.trial_will_end — OrcaRail sends this webhook about 3 days before
trial_endso you can remind the payer to add a payment method or approve auto-charge.
Creating a subscription with a trial
Use trial_period_days (or trial_end) when creating the subscription:
POST /api/v1/subscriptions
{
"description": "Pro Plan",
"amount": "10.00",
"currency": "usd",
"token_id": "...",
"network_id": "...",
"interval": "month",
"trial_period_days": 14,
}
Response will include:
status:"trialing"trial_start: set to creation timetrial_end: set to creation + 14 dayscurrent_period_start/current_period_end: first billing period after the trial
Updating trial end
You can update trial_end on an existing subscription (e.g. to extend or shorten the trial):
PATCH /api/v1/subscriptions/:id
{
"trial_end": "2025-04-15T00:00:00Z"
}
Use "now" to end the trial immediately and trigger the first billing cycle.
Status flow with trials
- trialing — No charge yet;
trial_endis in the future. - After trial_end: subscription moves to active once the first period is paid (or to paused if there is no payment method / allowance).
Webhooks
- subscription.created — Sent when the subscription is created (may be
trialing). - subscription.trial_will_end — Sent roughly 3 days before
trial_end; use it to email the payer or prompt approval for auto-charge. - subscription.payment_link.created — When the first payment link is created after trial (for
send_payment_link). - subscription.payment_link.paid — When the first cycle is paid after trial.
Best practices
- Remind before trial ends — Handle
subscription.trial_will_endto send an email or in-app message. - Auto-charge and trials — For
auto_charge, direct the payer to approve the allowance beforetrial_endso the first charge can succeed; otherwise the subscription may gopausedorpast_due. - Clear messaging — On the pay page or subscribe page, show trial length and the first charge date/amount so the payer knows what to expect.
Next steps
- Create a subscription — Use
trial_period_daysortrial_end - Subscription webhooks —
subscription.trial_will_endand paid events - Auto-charge — Getting allowance approved before trial end