Trials, plan changes, and canceling
Give customers clear trials, plan changes with their proration shown first, reminders before they're charged, and online canceling, by default.
Customers who know what they'll be charged, and when, trust you more and dispute less. Commerce's subscriptions start from defaults that keep customers informed, and you don't have to build any of them.
Trials
Trials follow these rules:
- A trial takes a payment method by default. You can turn that off.
- Customers get a reminder 7 days before a trial or an introductory price ends.
- Where it's required, the button that starts a trial says the customer will pay when it ends.
A trial isn't in your MRR. It counts as a trial until its first paid period starts.
Start a trial
Set trial in subscription_options, with interval and interval_count, or with end_at. To start a trial without a payment method, set trial.payment_method_required to false, and set trial.missing_payment_method to cancel or pause for when the trial ends with no method.
The subscription starts as trialing, with the trial's end in trial_end, and nothing is due until the trial ends. Pay.com sends subscription.trial_will_end 7 days before the end, and subscription.active when the first payment succeeds.
curl https://api.sandbox.pay.com/v1/subscriptions \
-u ':sk-pay-com-sandbox-…' \
-H "Content-Type: application/json" \
-H "idempotency-key: $(uuidgen)" \
-d '{
"customer_reference_id": "cust-jane-doe-001",
"items": [{ "price": "prc_691180240037724160", "quantity": 1 }],
"payment_method": "pm_card_684790996696828928",
"subscription_options": {
"trial": { "interval": "day", "interval_count": 14 }
}
}'{
"id": "sub_691226648512843776",
"resource": "subscription",
"status": "trialing",
"customer_reference_id": "cust-jane-doe-001",
"payment_method": "pm_card_684790996696828928",
"items": [
{ "id": "subitem_691226648512843778", "price": "prc_691180240037724160", "price_version": 1, "quantity": 1 }
],
"trial_end": "2026-12-09T10:30:00.000Z",
"created": "2026-11-25T10:30:00.000Z"
}Renewals
Customers get a reminder 7 days before a yearly renewal. Pay.com also sends you subscription.upcoming_renewal 7 days before each renewal.
Plan changes
Before a customer confirms a change of plan, they see its proration.
To change a plan from your server, preview the change with POST /v1/subscriptions/{subscription_id}/previews and show the customer what's due now and on the next invoice. Amounts are in the smallest currency unit, so 1500 is $15.00 USD. A preview lasts 15 minutes.
curl https://api.sandbox.pay.com/v1/subscriptions/sub_684790996696828928/previews \
-u ':sk-pay-com-sandbox-…' \
-H "Content-Type: application/json" \
-H "idempotency-key: $(uuidgen)" \
-d '{
"items": [{ "price": "prc_691180262046953472", "quantity": 1 }],
"proration": "prorate_now"
}'{
"id": "subprv_691255520390475776",
"resource": "subscription_preview",
"subscription": "sub_684790996696828928",
"lines": [
{ "description": "Unused time on Pro plan", "amount": -1000, "proration": true },
{ "description": "Remaining time on Business plan", "amount": 2500, "proration": true }
],
"due_now": { "amount": 1500, "currency": "usd" },
"next_invoice": { "amount": 4999, "currency": "usd", "due_on": "2026-12-25" },
"expires_at": "2026-12-10T10:45:00.000Z"
}When the customer confirms, apply the preview:
curl -X PATCH https://api.sandbox.pay.com/v1/subscriptions/sub_684790996696828928 \
-u ':sk-pay-com-sandbox-…' \
-H "Content-Type: application/json" \
-d '{ "preview": "subprv_691255520390475776" }'The change applies exactly as previewed, and Pay.com sends subscription.updated. If the subscription, its prices, or its tax inputs changed after the preview, the request returns 409 with preview_stale, so create a new preview. See Preview a change of plan or quantity.
Canceling
Canceling follows these rules:
- Customers cancel online in the customer portal, and the cancellation takes effect at the end of the period.
- The customer keeps access until the cancellation takes effect.
- The last day to cancel before the next charge is shown, and the subscription returns it in
next_payment.cancel_by.
From your server, cancel at the end of the period or on any later date with POST /v1/subscriptions/{subscription_id}/cancel and an optional cancel_at. See Cancel a subscription.
In your reports, churn counts when access ends, and a cancellation scheduled for the end of the period appears as a scheduled cancellation until then.
Withdrawal
Where the law needs one, customers get a withdrawal button, with a confirm step and a receipt. Withdrawing ends the subscription immediately, and Pay.com never charges anything owed automatically.
When a customer withdraws through you, send POST /v1/subscriptions/{subscription_id}/withdraw with sent_at, the time they sent it. The subscription ends with cancellation_reason set to withdrawn, and returns withdrawal_charge and refund_due_by. After withdrawal_ends_at, the request returns 422 with withdrawal_period_ended.