Overview
Create and manage recurring subscriptions with automatic billing. Handle plan changes, cancellations, and invoice management seamlessly.Recurring Billing
Flexible Plans
Plan Changes
Invoice Management
Subscription Plans
Subscription plans define the pricing, billing frequency, and trial periods for your subscriptions. Create and manage plans before subscribing customers.Create Plan
Create a new subscription plan with pricing and billing configuration.Request Parameters
Billing Intervals
- $99.99 MXN =
9999 - $299.99 USD =
29999
Response
Get Plan
Retrieve details about a specific plan.Response
Same structure as Create Plan response.List Plans
List all subscription plans with filtering and pagination.Query Parameters
Response
Update Plan
Update an existing plan’s settings.Request Parameters
Response
Archive Plan
Deactivate a plan to prevent new subscriptions.active: false. Existing subscriptions are not affected and continue billing normally. You can reactivate the plan by updating active: true.Response
When to Archive
Discontinuing a plan
Discontinuing a plan
Seasonal or limited offers
Seasonal or limited offers
Managing Subscriptions
Create Subscription
Create a new subscription for a customer with a specific plan and payment method.Request Parameters
Response
Subscription Statuses
Get Subscription
Retrieve details about a specific subscription.Response
List Subscriptions
List all subscriptions with filtering and pagination.Query Parameters
Response
Update Subscription
Update subscription settings like payment method or cancellation behavior.Request Parameters
Response
Cancel Subscription
Cancel a subscription immediately or at the end of the current billing period.Request Parameters
Cancellation Behaviors
Cancel at Period End (Recommended)
Cancel at Period End (Recommended)
- Status remains
ACTIVE cancelAtPeriodEndset totruecanceledAttimestamp recorded- Billing continues until period end
- Status changes to
CANCELEDafter period expires
Cancel Immediately
Cancel Immediately
- Status immediately set to
CANCELED canceledAtandendedAttimestamps recorded- No further billing
- Customer loses access now
Response
List Subscription Invoices
Get all invoices for a specific subscription.Query Parameters
Response
Invoice Statuses
Plan Changes & Proration
When a customer changes their subscription plan mid-cycle, Cheqpay calculates a fair adjustment (proration) so they only pay for what they use.Upgrades
Downgrades
Preview
How Proration Works
When a customer upgrades mid-cycle, Cheqpay calculates:- Credit for the unused portion of the old plan
- Charge for the prorated portion of the new plan
- Net amount = Charge - Credit
5000 means $50.00 MXN.- Credit for unused Basic: $99.99 x (15/30) = $50.00
- Charge for prorated Pro: $299.99 x (15/30) = $150.00
- Net proration: $100.00 (charged or deferred, depending on behavior)
Change Plan
Update a subscription to a different plan with automatic proration handling.Request Parameters
Headers
Proration Behaviors
create_prorations (Default)
create_prorations (Default)
- No immediate charge to the customer
- Proration appears as an adjustment on the next invoice
- Plan switches immediately, but billing adjustment is deferred
- Supports accumulation: if a customer changes plans multiple times in the same cycle, all prorations combine into a single adjustment
always_invoice
always_invoice
- Immediate charge via the customer’s payment method on file
- A proration invoice is created and paid instantly
- If payment fails, the plan change is rejected (nothing changes)
- Optionally reset the billing cycle with
resetBillingCycle: true
none
none
- No credits or charges for unused time
- Plan switches immediately
- Next invoice at full new plan price
Upgrade vs Downgrade Behavior
Billing Cycle Reset
When usingalways_invoice, you can optionally reset the billing cycle:
resetBillingCycle: true:
- The billing period restarts from today
- The customer is charged the full new plan amount minus credit for unused old plan time
- The next invoice date is recalculated from today
resetBillingCycle is only allowed with always_invoice behavior on upgrades. It will be rejected for downgrades, create_prorations, or none.Response
subscription.planId in the response still shows the current plan. The new (cheaper) plan will take effect when the next billing cycle starts.Preview Plan Change
See the exact impact of a plan change before committing. This endpoint performs all calculations without modifying the subscription.Request Parameters
Same as Change Plan —newPlanId, prorationBehavior, prorationDate, resetBillingCycle.
Response
create_prorations:
Use Cases
Show upgrade cost to customer
Show upgrade cost to customer
Compare proration strategies
Compare proration strategies
List Plan Changes
Get the history of all plan changes for a subscription. Every plan change (upgrade, downgrade, or same-price swap) is recorded with full details.Query Parameters
Response
Response Fields
Merchant Configuration
Your account has a default proration behavior that controls how plan changes are billed, plus a flag that controls whether individual API requests can override that default.prorationBehavior parameter, exactly as shown in the plan change examples above.
Configuration Options
Behavior Resolution
When a plan change request is made, the proration behavior is determined in this order:- If the request includes
prorationBehaviorandallowBehaviorOverrideistrue→ use the request value - If the request includes
prorationBehaviorbutallowBehaviorOverrideisfalse→ the request value is ignored, merchant default is used - If no
prorationBehaviorin the request → use the merchantdefaultBehavior - If no merchant configuration exists → system default (
create_prorations)
Common Scenarios
Upgrade with Immediate Charge
Customer upgrades and pays the difference immediately.Upgrade with Deferred Proration
Customer upgrades now, pays the adjustment on the next invoice.Downgrade (Always Deferred)
Customer downgrades. They keep the current plan until the billing period ends.Multiple Plan Changes in One Cycle
When usingcreate_prorations, multiple changes in the same billing cycle accumulate.
always_invoice, each change is charged independently. There’s no accumulation — each upgrade creates its own proration invoice.Upgrade with Billing Cycle Reset
Start a fresh billing period from today after upgrading.Cancel a Pending Downgrade with an Upgrade
If a customer downgrades and then upgrades before the next billing cycle, the downgrade is automatically canceled.Webhooks
When a subscription plan changes, Cheqpay sends asubscription.plan_changed webhook event to your configured URL.
x-webhook-signature header for verification. See Webhooks for setup and verification details.
Webhook fields
Error Handling
Plan Errors
Create Subscription Errors
Get/Update/Cancel Errors
Plan Change Errors
Best Practices
Always preview before changing plans
Always preview before changing plans
Use idempotency keys for plan changes
Use idempotency keys for plan changes
Use immediate proration for upgrades
Use immediate proration for upgrades
Use deferred proration for downgrades
Use deferred proration for downgrades
Use clear, customer-facing plan names
Use clear, customer-facing plan names
Use externalId for your own identifiers
Use externalId for your own identifiers
Create new plans instead of updating pricing
Create new plans instead of updating pricing
Handle plan change webhook events
Handle plan change webhook events
Always include security code on creation
Always include security code on creation
Offer graceful cancellation
Offer graceful cancellation
Monitor invoice status
Monitor invoice status
Related Resources
- Webhooks - Receive real-time notifications for plan changes and other events
- API Reference - Complete endpoint documentation
- Customers - Manage customer records
- Payment Methods - Manage payment methods for subscriptions