Renew, suspend and stop a subscription¶
This guide shows what to do when the subscriber pays for the next period, when you block the access of the subscriber for some time, and when the subscriber stops or changes 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/partners/{partner_id}/subscription/{operation}?userId={identifier}&serviceId={service_id}
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 subscriber 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 user/subscriptions. See
Retries.
Stop the subscription¶
Send unsubscribe. Access stops immediately: the subscription is not in
user/subscriptions and not in the MEGOGO profile of the subscriber.
You decide when to send unsubscribe: when the subscriber cancels, or at
the end of the period that the subscriber paid.
CAUTION
Use the service ID that user/subscriptions shows. If the subscriber
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.
The MEGOGO account of the subscriber stays after unsubscribe. When the
subscriber buys again, send only subscribe.
Change the subscription¶
To change the subscription, for example from "Light" to "Maximum":
- Send
unsubscribefor the old service ID. - Send
subscribefor the new service ID.
Suspend and resume the subscription¶
Use suspend and resume if the subscriber must keep the time that is
left, for example when you block the internet access for a debt. If you do
not need this, use only subscribe and unsubscribe.
sequenceDiagram
participant Server as Your server
participant API as MEGOGO Partner Billing API
Server->>API: subscription/suspend (userId, serviceId)
API-->>Server: "successful": true
Note over API: No access. The time that is left stays
Server->>API: subscription/resume (userId, serviceId)
API-->>Server: "successful": true
Note over API: Access again. The end date moves forward
- Send
suspend. Access stops. The subscription is not inuser/subscriptions. - 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 subscriber has no
suspended subscription, resume works as subscribe.
CAUTION
Do not send subscribe while the subscription is suspended. It starts
a new subscription, and the suspended time does not come back.
Errors¶
| Response | Cause | Action |
|---|---|---|
Code 2023 for subscribe or resume |
The subscription is already active, and the service does not permit a renewal of an active subscription. Or the end date would be more than 15 years from now | No action is necessary |
Code 40000, Invalid operation passed |
The operation is not subscribe, unsubscribe, suspend or resume |
Correct the URL |
| Code 40416 | The service ID is not configured for your partner ID | Use a service ID from your MEGOGO manager |
| Timeout, HTTP 5xx | Temporary problem | See Retries |
For all errors, see the Error catalog.
Related pages¶
Guide version 1.0.2, 2026-11-08 · Report a problem on this page