Trials
Sell a plan with nothing due today. Checkout stores a reusable payment method and Altruon collects the first invoice when the trial ends.
A trial lets a shopper subscribe with nothing due today. Checkout collects a reusable payment method without charging it, and Altruon bills it automatically when the trial ends. Trials work with all four billing platforms: Stripe Billing, Chargebee, Recurly and Frisbii.
How a trial works
-
Estimate. Your billing platform returns the trial data for the cart:
trialEndandamountDueNow. Altruon uses it to show that nothing is due today and to schedule mandates. -
Acquirer setup. The acquirer runs a zero-amount flow instead of a charge. The flow depends on the payment method:
Collection mode What happens at signup SETUPThe card is tokenized. CONSENTThe shopper gives a Pix or UPI consent. MANDATEThe shopper sets up an open banking mandate. -
Subscription created. Altruon creates the subscription in trial status, with
trial_start,trial_end, andnextBillingDateset totrial_end. -
Trial end. The billing platform moves the subscription to active and generates a payment-due invoice. Altruon collects it as a merchant-initiated transaction (MIT) with the credentials stored at signup.
A payment method is always required at trial signup. That is what lets the first charge run without the customer.
Before you start
- A billing platform is connectedStripe Billing, Chargebee, Recurly or Frisbii. See Billing platforms.
- A plan to sellEither a plan with a trial configured in your billing catalog, or any paid recurring plan if you set the trial length at checkout.
- A routing entry that supports trialsThe acquirer and payment method must be one of the supported pairs.
Where the trial length comes from
By default, the trial length comes from your billing catalog, for example trial_period_days on a Stripe Price or the trial on a Chargebee item. This works on every checkout: hosted pages, dynamic hosted checkout and Altruon.js.
To decide the trial length for each checkout instead, override it when you create the session.
Override trial length per checkout
Set billingData.forceTrialPeriodDays on Create Session to set the trial length at checkout time instead of on the plan in your billing catalog.
| Field | billingData.forceTrialPeriodDays (integer, days) |
| Range | 1 to 730 |
| Effect | Starts a subscription trial of that many days with nothing due for the subscription. Overrides any trial configured on the plan. |
| Due today | The subscription portion is zero. One-time lineItems with type: "charge" are still charged today if present. |
| Billing platforms | Stripe Billing, Chargebee, Recurly, Frisbii |
| Not supported | Hosted pages (hostedPageConfigId, /checkout/p/) |
Add the field to the session request
Put the field inside billingData, not at the root of the request body. Use the ID of a paid recurring plan or price: the plan does not need a trial in your catalog.
{
"hostedCheckout": true,
"paymentData": { "currency": "USD" },
"billingData": {
"billingPlatformId": "3287b8c7-ce43-41fd-9d58-f510e610b8f3",
"forceTrialPeriodDays": 30,
"lineItems": [
{ "type": "plan", "id": "price_1SMtJj4hYau76GhIakR22BKu", "quantity": 1 }
]
},
"customerData": { "email": "shopper@example.com" },
"redirectUrl": "https://your-site.com/success"
}A top-level forceTrialPeriodDays is ignored
The field must be a property of billingData. If you send it next to paymentData, customerData or hostedCheckout, Altruon ignores it.
Check the trial in the response
The Create Session response includes a trial object that reflects the override:
{
"trial": {
"inTrial": true,
"trialStart": "2026-06-25T12:00:00Z",
"trialEnd": "2026-07-25T12:00:00Z",
"amountDueNow": "0",
"nextInvoiceDate": "2026-07-25T12:00:00Z"
}
}The trial object is output only. Do not send forceTrialPeriodDays inside it. With a one-time charge line item, amountDueNow is the total of the charges, and the subscription portion stays at zero.
Send the shopper to checkout
Redirect the shopper to checkout_url, or pass the session to Altruon.js. Checkout runs the zero-amount flow and the subscription starts in trial.
How the override combines with the catalog
| Scenario | Trial length |
|---|---|
The plan has a 7-day trial in the catalog, and you send billingData.forceTrialPeriodDays: 30 | 30 days |
The plan has no trial, and you send billingData.forceTrialPeriodDays: 30 | 30 days |
You do not send billingData.forceTrialPeriodDays | The catalog trial only |
Validation
| Rule | Result |
|---|---|
forceTrialPeriodDays is outside 1 to 730 | 400 |
forceTrialPeriodDays is combined with hostedPageConfigId (a hosted page) | 400 |
| Nothing is due today and the acquirer and payment method pair does not support trials | An unsupported error when the session is created |
Supported acquirers and payment methods
A trial with nothing due today works with these pairs:
| Acquirer | Payment methods | Collection mode |
|---|---|---|
| PagBrasil | card, pix | SETUP for card, CONSENT for Pix |
| Adyen | card | SETUP |
| Nuvei | card | SETUP |
| Checkout.com | card, applepay, kakaopay | SETUP |
| dLocal | card, pix, upi | SETUP for card, CONSENT for Pix and UPI |
| Trustly | openbanking | MANDATE |
Any other combination returns an unsupported error at session creation when the plan is in trial with nothing due today.
What the shopper sees
- The order summary shows "Free until" with the trial end date, or an equivalent, when
amountDueNowis zero. - Hosted checkout hides the payment methods that are not in the table above.
- A PagBrasil Pix trial uses a consent-only flow. There is no charge today, and the first debit is scheduled from
trialEnd(PagBrasil'spix_rec_first_recurrence).
The trial object
Session and estimate responses include a trial object when the cart is in trial, whether the trial comes from the catalog or from billingData.forceTrialPeriodDays.
| Field | Description |
|---|---|
inTrial | Whether the cart is in a trial period |
trialStart | ISO 8601 instant when the trial starts |
trialEnd | ISO 8601 instant when the trial ends |
amountDueNow | Amount charged at signup, typically 0 for a pure trial |
nextInvoiceDate | Date of the first invoice after the trial |
Pending payment responses from the acquirer may include paymentCollectionMode (SETUP, CONSENT, MANDATE or CHARGE) as a hint for your frontend.
Trial with an amount due today
If the estimate returns an amountDueNow greater than zero, for example a trial with a setup fee, a one-time charge or a discounted first period, Altruon runs a normal CHARGE flow for today's amount. The payment method is still stored for the renewal.
When the trial ends
At trialEnd, the billing platform activates the subscription and issues a payment-due invoice. Altruon collects it with the payment method stored at signup.
If the collection fails, your retry rules apply. Altruon cancels the subscription only if you configured that as the end of the retries, never preemptively at trial end. See Retries and dunning.
Test it
- Use sandbox plans with a trial period configured on your billing platform, or send
billingData.forceTrialPeriodDays. - Check that the estimate returns
trialEndbefore the payment: the session response carries thetrialobject. - Complete the checkout, then confirm that the subscription is in
trialstatus in Altruon. - Confirm that the subscription becomes
activeonce the trial end webhooks from your billing platform arrive. - Run a checkout without a trial and one with an amount due today, and confirm that both still charge as before.
See Testing for sandbox test cards.
Limits
- Hosted pages.
billingData.forceTrialPeriodDaysis not supported on hosted pages. A trial configured on the plan still works there. - Days only. The override is an integer number of days from 1 to 730. Convert months to days on your server.
- Plan level only. The override applies to the plan. You cannot force a trial per add-on.
- Stripe trial offers. Stripe Product trial offers (IDs that start with
to_) are not supported. Use a paid recurring price ID. - Unsupported pairs. Acquirer and payment method pairs outside the supported list are rejected at session creation when nothing is due today.
Next steps
How billing sync works
Your billing platform stays the source of truth. Altruon creates the subscription after the first payment and records every payment on its invoice.
Coupons
Apply coupon codes at checkout with billingData.couponCodes, let shoppers enter their own, and see what each billing platform expects.