Extend Subscription
POST/subscriptions//extend
Extends a subscription’s current billing period by a specified number of days or months. This is useful for courtesy extensions, compensation for service outages, or promotional offers. You must provide either days or months (but not both).
This endpoint has an idempotency guard. If a duplicate request is made within 10 seconds, it will return 429 Too Many Requests instead of double-extending the subscription.
Authentication
| Header | Value | Required |
|---|
Authorization | Bearer YOUR_API_TOKEN | Yes |
Content-Type | application/json | Yes |
Accept | application/json | Recommended |
Path Parameters
| Parameter | Type | Required | Description |
|---|
id | integer | Yes | The subscription ID |
Request Body
| Parameter | Type | Required | Description |
|---|
days | integer | Required without months | Number of days to extend the subscription (1-365) |
months | integer | Required without days | Number of months to extend the subscription (1-24). Each month is treated as 30 days. |
Example Request
curl -X POST "https://merchant-api.rmz.gg/shawarma/subscriptions/501/extend" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"days": 7}'
Success Response
Returns the full subscription object in the standard SubscriptionResource shape — identical to Get Subscription, List Subscriptions, and Lookup Subscriptions. The fields most relevant to extension are shown below — see Get Subscription for the complete field list.
{
"message": "Subscription extended successfully",
"data": {
"id": 501,
"status": "active",
"external_customer_id": "usr_abc123",
"current_period_start": "2025-06-01T00:00:00.000000Z",
"current_period_end": "2025-07-08T00:00:00.000000Z",
"end_date": "2025-07-08T00:00:00.000000Z"
},
"api": "rmz.shawarma",
"timestamp": 1699999999
}
Response Fields
The response is the full SubscriptionResource. See Get Subscription for the complete list. The fields most relevant to extension:
| Field | Type | Description |
|---|
id | integer | Subscription ID |
status | string | Current subscription status |
external_customer_id | string/null | Stable identifier the merchant supplied at checkout creation. Use this to correlate RMZ subscriptions with your own user records. null if not supplied. |
current_period_start | string | Start of the current billing period |
current_period_end | string | New end of the current billing period (extended) |
end_date | string | Updated subscription end date |
A subscription.updated webhook event is fired when a subscription is extended, including the number of days added and the new end date.
Error Responses
| Code | Description |
|---|
401 | Unauthorized — invalid or missing token |
404 | Subscription not found |
409 | Subscription is canceled or expired and cannot be extended |
422 | Validation error — must provide days (1-365) or months (1-24) |