Overview
Shoppex handles recurring payments automatically. Create subscription products and let us manage renewals, retries, and cancellations.This guide is about the subscription flow itself.
For Developer API endpoints and webhook event names, use the API reference and webhook docs.
Creating a Subscription Product
Configure Billing
Set the billing interval:
- Daily - Charged every day
- Weekly - Charged every 7 days
- Monthly - Charged on the same day each month
- Yearly - Charged annually
Handling Failed Payments
When a renewal payment fails, Shoppex:- Retries automatically - 3 attempts over 7 days
- Notifies the customer - Email with payment update link
- Marks as past_due - Subscription continues during grace period
- Cancels - After all retries fail
Customer Portal
Give customers control over their subscriptions via the Shoppex billing portal. Each customer receives a unique portal link in their confirmation emails where they can:- View billing history
- Update payment method
- Cancel subscription
- Download invoices
Webhooks
Subscribe to these events for subscription updates:| Event | Description |
|---|---|
subscription:created | New subscription started |
subscription:cancelled | Subscription cancelled |
subscription:updated, subscription:renewed, subscription:upcoming, and trial events.
See the Webhooks Guide for setup instructions.
Prorating
When customers upgrade or downgrade:- Upgrade: Charged the difference immediately
- Downgrade: Credit applied to next invoice
Proration is calculated based on days remaining in the current billing period.
Managing Subscriptions via API
The Dev API exposes full subscription management. Here are the most common operations:| Action | Endpoint |
|---|---|
| List all subscriptions | GET /dev/v1/subscriptions |
| Get subscription details | GET /dev/v1/subscriptions/{id} |
| Cancel a subscription | POST /dev/v1/subscriptions/{id}/cancel |
| Pause billing | POST /dev/v1/subscriptions/{id}/pause |
| Resume billing | POST /dev/v1/subscriptions/{id}/resume |
| Change plan | POST /dev/v1/subscriptions/{id}/change-plan |
| Issue a refund | POST /dev/v1/subscriptions/{id}/refund |
| List available plans | GET /dev/v1/subscriptions/{id}/plan-options |
| Update custom fields | PATCH /dev/v1/subscriptions/{id}/custom-fields |
| View billing history | GET /dev/v1/subscriptions/{id}/billing-history |
Next Steps
Webhooks Guide
Get notified about subscription lifecycle events
Invoice Guide
Understand the invoices generated by subscriptions