SubscriptionsPlans
Subscription Plans
Plans define the pricing, billing interval, and rules for your subscriptions. Create plans once and enroll as many subscribers as you need.
Create a plan
Define a new subscription plan with a name, amount, currency, and billing interval.
POST
/subscriptions/plansCreate a new subscription plan.
Request body
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | required | Display name of the plan (e.g., "Pro Monthly"). |
| amount | integer | required | Charge amount in smallest currency unit (e.g., fils for IQD). |
| currency | string | required | ISO 4217 currency code. Supported: IQD, USD, EUR, GBP, AED, TRY. |
| interval | string | required | Billing interval: "daily", "weekly", "monthly", or "yearly". |
| trial_days | integer | optional | Number of free trial days before the first charge. Default: 0. |
| max_cycles | integer | optional | Maximum billing cycles before auto-cancel. Null for unlimited. |
| grace_period_days | integer | optional | Days to retry failed payments before canceling. Default: 7. |
curl -X POST https://wallet.e-mazad.store/api/v1/subscriptions/plans \
-H "Authorization: Bearer sk_sandbox_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Pro Monthly",
"amount": 15000,
"currency": "IQD",
"interval": "monthly",
"trial_days": 14,
"max_cycles": null,
"grace_period_days": 7
}'Immutable pricing
Once a plan is created, the
amount and currency cannot be changed. To update pricing, create a new plan and migrate subscribers.List plans
Retrieve all subscription plans for your merchant account with optional filtering.
GET
/subscriptions/plansList all subscription plans. Supports pagination and filtering by status.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| status | string | optional | Filter by plan status: "active" or "archived". Default: all. |
| page | integer | optional | Page number for pagination. Default: 1. |
| per_page | integer | optional | Results per page (max 100). Default: 20. |
curl https://wallet.e-mazad.store/api/v1/subscriptions/plans?status=active \
-H "Authorization: Bearer sk_sandbox_..."Supported intervals
Choose the billing frequency that fits your business model.
| Interval | Billing cycle | Example use case |
|---|---|---|
| daily | Every 24 hours | Daily access passes |
| weekly | Every 7 days | Weekly deliveries or memberships |
| monthly | Same day each month | SaaS subscriptions, gym memberships |
| yearly | Same date each year | Annual licenses, premium tiers |
Monthly billing on the 31st
If a subscription starts on the 31st, months with fewer days will bill on the last available day (e.g., February 28th). The original anchor date is preserved for months that have 31 days.