Skip to main content

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

Headers

HeaderValueRequired
AuthorizationBearer YOUR_API_TOKENYes
Content-Typeapplication/jsonYes
Acceptapplication/jsonRecommended

Path Parameters

ParameterTypeRequiredDescription
idintegerYesThe subscription ID

Request Body

ParameterTypeRequiredDescription
daysintegerRequired without monthsNumber of days to extend the subscription (1-365)
monthsintegerRequired without daysNumber 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:
FieldTypeDescription
idintegerSubscription ID
statusstringCurrent subscription status
external_customer_idstring/nullStable identifier the merchant supplied at checkout creation. Use this to correlate RMZ subscriptions with your own user records. null if not supplied.
current_period_startstringStart of the current billing period
current_period_endstringNew end of the current billing period (extended)
end_datestringUpdated 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

CodeDescription
401Unauthorized — invalid or missing token
404Subscription not found
409Subscription is canceled or expired and cannot be extended
422Validation error — must provide days (1-365) or months (1-24)