sTN Partner APIsTN Partner API
Home
Getting Started
Guide
Home
Getting Started
Guide
  • Guide

    • Introduction
    • Supported Features
    • Authentication
    • Base URLs
    • Advanced Query Parameters
    • Error Handling
  • Getting Started

    • Introduction
    • Quick Start Guide
  • API Endpoints

    • QuerySimcard
    • QueryActivation
    • QuerySubscription
    • NewSubscription
    • CancelNewSubscription
    • SuspendSubscription
    • ResumeSubscription
    • SimSwapSubscription
    • SetServicesSubscription
    • MoveEnvironmentSubscription
    • InPortSubscription
    • ChangeInPortSubscription
    • CancelInPortSubscription
    • PortingOutSubscription
    • CancelPortingOutSubscription
    • TerminateSubscription
    • CancelTerminateSubscription
    • QueryInvoice
    • QueryCdrMonth
    • QueryCdr
    • QueryUsageSubscription

TerminateSubscription

Overview

  • Method: POST
  • Endpoint: /api/TerminateSubscription
  • Description: Terminates an existing subscription, canceling all associated services.
POST /api/TerminateSubscription
Content-Type: application/json
{
    "subscriptionId": "###3Vp17###7Xg79e",
    "phoneNumber": "06-######969",
    "wishDate": "2025-03-01T12:00:00+01:00"
}

Request Body Parameters

The request body should be a JSON object with the following structure:

  • subscriptionId (string, required if phoneNumber is not provided): Identifier for the subscription to terminate.
  • phoneNumber (string, required if subscriptionId is not provided): Phone number associated with the subscription.
  • wishDate (string, optional): Desired date and time for the termination (ISO 8601 format). If left blank, the termination will be processed immediately.
  • referenceNumber (string, optional max 15 characters): A reference number for tracking the subscription.

Info

At least one of subscriptionId or phoneNumber must be provided to identify the subscription to be terminated.


Response Structure

The response will be an Activation object with the following structure:

{
    "id": "###eP7ds###WQJoIE",
    "createdAt": "2025-02-19T14:51:09.823Z",
    "status": "string",
    "activationType": "TERMINATE",
    "providerEnvironment": "SP16001",
    "subscriptionId": "###3Vp17###7Xg79e",
    "phoneNumber": "06-######969",
    "activatedDate": "2025-02-19T14:51:09.823Z",
    "info": {}
}

Field Descriptions

  • id: A unique identifier for the termination request.
  • createdAt: The timestamp when the termination request was created.
  • status: The current status of the termination request:
    • BUSY: The request is being processed.
    • DONE: The termination was successfully completed.
    • ERROR: The request failed.
  • activationType: The type of activation, always TERMINATE for this request.
  • providerEnvironment: The Envirionment where the sim is registered at the provider.
  • subscriptionId: The ID of the terminated subscription.
  • phoneNumber: The phone number linked to the subscription.
  • activatedDate: The timestamp when the termination process was completed.
  • info: Additional metadata about the termination process.

Info

Optional fields will only be included in the response if they were provided in the request.


Usage Notes

  • This endpoint permanently terminates a subscription and cancels all associated services.
  • Either subscriptionId or phoneNumber must be provided.
  • The wishDate allows scheduling a termination; if omitted, termination occurs as soon as possible.
  • The response includes a unique id for tracking the termination request.
  • The info field may contain additional details about the process.
  • Once a subscription is terminated, it cannot be reactivated. A new subscription must be created if service is needed again.

Querying Termination Status

To track the status of the termination request, use the QueryActivation API until the status field is set to DONE or ERROR.

GET /api/QueryActivation?id=TER12345

Example Response:

{
    "offset": 0,
    "total": 80,
    "results": [
        {
            "id": "###eP7ds###WQJoIE",
            "createdAt": "2025-02-18T11:00:09.823Z",
            "modifiedAt": "2025-02-19T15:10:55.098Z",
            "status": "DONE",
            "activationType": "TERMINATE",
            "providerEnvironment": "SP16001",
            "subscriptionId": "###3Vp17###7Xg79e",
            "phoneNumber": "06-######969",
            "activatedDate": "2025-02-19T15:10:55.098Z",
            "info": {
                "wishDate": "2025-02-19T15:00:00+01:00"
            }
        }
    ],
    "meta": {}
}

Summary

The /api/TerminateSubscription endpoint allows the cancellation of an active subscription.

  • Requires subscriptionId or phoneNumber.
  • Allows scheduling via wishDate.
  • Provides a tracking id to monitor termination status via QueryActivation.

Use this API to efficiently terminate a subscription and cancel all related services.

Last Updated:
Contributors: UP2media-AR, Jos Harink
Prev
CancelPortingOutSubscription
Next
CancelTerminateSubscription