Manage customer subscription lifecycles, active plan queries, upgrades, cancellations, and auto-renewal toggles.
ZezoPay provides a complete subscription lifecycle engine that manages recurring billing, active subscription checks, plan upgrades/downgrades, and auto-renewals across multiple payment gateways.
Query the currently active subscription and expiration metadata for a specific customer.
https://payapi.zezo.in/api/v1/subscriptions/{user_id}/current| Parameter | Type | Required | Description |
|---|---|---|---|
x-public-key | string | Required | Your Public Key. |
Content-Type | string | Required | Payload encoding format. Default: application/json |
curl -X GET "https://payapi.zezo.in/api/v1/subscriptions/usr_9912059abc/current" \
-H "x-public-key: zp_pub_xxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json"{
"message": "Current subscription fetched successfully",
"data": {
"id": "sub_66d3b980f72a",
"customer": {
"id": "cust_66d2e734c67cf10fd3b46b86",
"user_id": "usr_9912059abc",
"name": "Sarah Connor",
"email": "sarah.connor@example.com",
"phone": "+919876543210"
},
"plan": {
"id": "66d3a12b4e89",
"name": "Pro Monthly",
"duration_days": 30,
"duration_label": "Monthly"
},
"is_subscribed": true,
"status": "active",
"payment_status": "paid",
"amount": 2999,
"currency": "INR",
"billing_cycle": "recurring",
"start_date": "2026-09-01T00:00:00.000Z",
"end_date": "2026-10-01T00:00:00.000Z",
"next_renewal_date": "2026-10-01T00:00:00.000Z",
"auto_renew": true,
"renewal_count": 1
}
}Cancel, pause, or resume a customer subscription.
https://payapi.zezo.in/api/v1/subscriptions/manage/{id}/status| Parameter | Type | Required | Description |
|---|---|---|---|
x-public-key | string | Required | Your Public Key. |
x-secret-key | string | Required | Your Secret Key. |
Content-Type | string | Required | Payload encoding format. Default: application/json |
| Parameter | Type | Required | Description |
|---|---|---|---|
status | string | Required | Target status: `active`, `paused`, `cancelled`, `expired`. |
import axios from "axios";
const response = await axios.patch(
"https://payapi.zezo.in/api/v1/subscriptions/manage/sub_66d3b980f72a/status",
{
status: "cancelled",
},
{
headers: {
"x-public-key": process.env.ZEZOPAY_PUBLIC_KEY,
"x-secret-key": process.env.ZEZOPAY_SECRET_KEY,
"Content-Type": "application/json",
},
}
);
console.log("Status updated:", response.data);{
"message": "Subscription status updated successfully",
"status": "cancelled"
}Enable or disable automatic renewals on a subscription.
https://payapi.zezo.in/api/v1/subscriptions/manage/{id}/auto-renew| Parameter | Type | Required | Description |
|---|---|---|---|
x-public-key | string | Required | Your Public Key. |
x-secret-key | string | Required | Your Secret Key. |
Content-Type | string | Required | Payload encoding format. Default: application/json |
| Parameter | Type | Required | Description |
|---|---|---|---|
auto_renew | boolean | Required | Boolean flag to enable (`true`) or disable (`false`) auto-renewal. |
import axios from "axios";
const response = await axios.patch(
"https://payapi.zezo.in/api/v1/subscriptions/manage/sub_66d3b980f72a/auto-renew",
{
auto_renew: false,
},
{
headers: {
"x-public-key": process.env.ZEZOPAY_PUBLIC_KEY,
"x-secret-key": process.env.ZEZOPAY_SECRET_KEY,
"Content-Type": "application/json",
},
}
);
console.log("Auto-renew toggled:", response.data);{
"message": "Subscription auto-renewal preference updated",
"auto_renew": false
}