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

CancelPortingOutSubscription

Overview

  • Method: POST
  • Endpoint: /api/CancelPortingOutSubscription
  • Description: Cancels an ongoing porting-out request. This endpoint allows terminating a port-out process and optionally providing a reason for the cancellation.
POST /api/CancelPortingOutSubscription
Content-Type:application/json
{
  "activationId": "ACT12345",
  "note": "Customer decided to stay with the current provider."
}

Request Body Parameters

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

  • activationId (string, required): Identifier for the porting-out activation request to cancel.
  • note (string, optional, max 164 characters): Additional information or reason for the cancellation.

Info

The activationId was provided in the response of the PortingOutSubscription request.


Response Structure

The response will include details about the cancelled porting-out request:

{
    "id": "string",
    "createdAt": "2024-12-19T14:51:09.823Z",
    "modifiedAt": "2024-12-19T14:51:09.823Z",
    "status": "BUSY",
    "activationType": "OUTPORT",
    "providerEnvironment": "SP16001",
    "referenceNumber": "string",
    "subscriptionId": "string",
    "phoneNumber": "string",
    "activatedDate": "2024-12-19T14:51:09.823Z",
    "info": {}
}

Field Descriptions

  • id: The unique identifier for the cancellation request.
  • createdAt: The timestamp when the request was created.
  • modifiedAt: The timestamp when the request was last modified.
  • status: The current status of the cancellation request:
    • BUSY: The request is being processed.
    • DONE: The cancellation has been successfully completed.
    • ERROR: The request failed.
  • activationType: The type of activation, always OUTPORT for this request.
  • providerEnvironment: The Envirionment where the sim is registered at the provider.
  • subscriptionId: The ID of the subscription being ported out.
  • phoneNumber: The phone number linked to the porting request.
  • referenceNumber: The tracking reference number (if provided).
  • activatedDate: The timestamp when the cancellation was completed.
  • info: Additional metadata regarding the cancellation.

Info

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


Usage Notes

  • The activationId is mandatory and must correspond to an active porting-out request.
  • The note parameter is optional but recommended for internal tracking.
  • Store the response id to track the cancellation request.

Example Requests

Cancel a porting-out request with a reason

POST /api/CancelPortingOutSubscription
Content-Type: application/json
{
  "activationId": "ACT12345",
  "note": "Customer decided to stay with the current provider."
}

Cancel a porting-out request without a note

POST /api/CancelPortingOutSubscription
Content-Type: application/json
{
  "activationId": "ZsxXM3x9wcq2F5L2S"
}

Querying Cancellation Status

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

Example Response:

{
    "id": "###XM3x9###2F5L2S",
    "createdAt": "2025-02-03T12:13:29.25+01:00",
    "modifiedAt": "2025-02-03T12:26:30.5030348+01:00",
    "status": "BUSY",
    "activationType": "OUTPORT",
    "providerEnvironment": "SP16001",
    "referenceNumber": "",
    "providerOrderNumber": "03####0/2##5",
    "subscriptionId": "###3Vp17###7Xg79e",
    "phoneNumber": "06-#####969",
    "info": {
        "wishDate": "2025-03-01T12:00:00+01:00"
    }
}
GET /api/QueryActivation?id=ZsxXM3x9wcq2F5L2S
{
    "offset": 0,
    "total": 1,
    "results": [
        {
            "id": "ZsxXM3x9wcq2F5L2S",
            "createdAt": "2025-02-03T12:13:29.25+01:00",
            "modifiedAt": "2025-02-03T12:27:37.903+01:00",
            "status": "CANCELLED",
            "activationType": "OUTPORT",
            "providerEnvironment": "SP16001",
            "referenceNumber": "",
            "subscriptionId": "5xM3Vp171UK7Xg79e",
            "phoneNumber": "06-10527969",
            "activatedDate": "2025-02-03T13:26:41+01:00",
            "info": {
                "wishDate": "2025-03-01T12:00:00+01:00",
                "portingStatus": "REJECTED"
            }
        }
    ],
    "meta": {}
}

Summary

The /api/CancelPortingOutSubscription endpoint allows canceling an active number porting request.

  • Requires activationId to identify the request.
  • Optionally includes a note for tracking purposes.
  • Returns a tracking id to monitor cancellation status via QueryActivation.

Use this API to efficiently manage and track porting cancellations.

Warning

During the time the CancelPortingOutSubscription is handled by the provider the portingStatus wil have the status "protingStatus": "CANCELLING". When the message is handled, the overall status of the activation record will be "CANCELLED" and the portingStatus in the info-object will show "REJECTED".

Last Updated:
Contributors: UP2media-AR, Jos Harink
Prev
PortingOutSubscription
Next
TerminateSubscription