Skip to content

Renew, suspend and stop a subscription

This guide shows what to do when the user pays for the next period, when you block the line of the user for some time, and when the user stops the subscription.

Before you start

  • Know the renewal mode of each service. See Subscription lifecycle.
  • All requests in this guide use the same URL. Only the operation is different:
GET https://billing.megogo.net/terminals/{partner_id}/subscription/{operation}?phone={phone}&serviceId={service_id}&sign={sign}

Renew the subscription

Renewal mode What to do
Automatic renewal Nothing. MEGOGO renews the subscription until you send unsubscribe
Renewal by the partner After the user pays for the next period, send subscribe. MEGOGO adds one period after the current end date

WARNING

In the mode "renewal by the partner", subscribe is not idempotent. Each successful request adds one more period. Before you send the request again, get subscriptions for the user. See Retries.

You can send subscribe before the end date. The new period starts after the current end date, not from now.

Stop the subscription

Send unsubscribe. Access stops immediately. The subscription is not in subscriptions after the request.

You decide when to send unsubscribe: when the user cancels, or at the end of the period that the user paid.

CAUTION

Use the service ID that subscriptions shows for the user. If the user has two of your service IDs of one MEGOGO subscription, unsubscribe with the other ID does not stop the subscription. See Two service IDs of one subscription.

unsubscribe gives "successful": true also when the subscription is not active. To make sure that the subscription stopped, get subscriptions.

Change the subscription

To change the subscription of the user, for example from "Light" to "Maximum":

  1. Send unsubscribe for the old service ID.
  2. Send subscribe for the new service ID.

Suspend and resume the subscription

Use suspend and resume if the user must keep the time that is left, for example during a temporary block of the line. If you do not need this, use only subscribe and unsubscribe.

  1. Send suspend. Access stops. The subscription is not in subscriptions.
  2. When the access must start again, send resume. The end date moves forward by the time of the suspension.

WARNING

Send resume only after your own suspend. If the user has no suspended subscription, resume works as subscribe: it adds a period or starts a new subscription.

CAUTION

Do not send subscribe while the subscription is suspended. It starts a new subscription, and the suspended time does not come back.

To stop a suspended subscription, send unsubscribe. The suspended time is lost.

Errors

Response Cause Action
Code 2023 for subscribe or resume The service has automatic renewal and is already active. Or the end date would be more than 15 years from now No action is necessary
"message": "Invalid operation passed" The operation is not subscribe, unsubscribe, suspend or resume Correct the URL
Timeout, HTTP 5xx Temporary problem See Retries

For all errors, see the Error catalog.


Guide version 1.0.0, 2026-11-02 · Report a problem on this page