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

SetServicesSubscription

Overview

  • Method: POST
  • Endpoint: /api/SetServicesSubscription
  • Description: Updates or adds services for an existing subscription.
POST /api/SetServicesSubscription
Content-Type: application/json
{
  "subscriptionId": "###3Vp17###7Xg79e",
  "services": {
     "internationalDialing":true
  }
}

Request Body Parameters

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

  • subscriptionId (string, required if phoneNumber is not provided): Identifier of the subscription to update.
  • phoneNumber (string, required if subscriptionId is not provided): Phone number associated with the subscription.
  • services (object, required): Object defining the services to be added or updated.
  • referenceNumber (string, optional, max 15 characters): A reference number for tracking the service update request.

Info

At least one of subscriptionId or phoneNumber is required to identify the subscription.

Tips

You will find the list of possible services here.


Response Structure

The response includes details about the updated subscription:

{
    "id": "###WaEac###McgYzl",
    "createdAt": "2025-01-31T15:47:38.1146014+01:00",
    "modifiedAt": "2025-01-31T15:47:38.1146014+01:00",
    "status": "INIT",
    "providerEnvironment": "SP16001",
    "activationType": "SETSERVICES",
    "referenceNumber": "",
    "subscriptionId": "###3Vp17###7Xg79e",
    "phoneNumber": "06-######969",
    "info": {
        "services": {
            "internationalDialing": true
        }
    }
}

Field Descriptions

  • id: A unique identifier for the service update request.
  • createdAt: Timestamp of when the request was created.
  • modifiedAt: Timestamp of the last modification.
  • status: The current status of the service update request:
    • INIT: The request is being initialized.
    • BUSY: The request is being processed.
    • DONE: The update has been successfully completed.
    • ERROR: The request has failed.
  • activationType: The type of activation (SETSERVICES).
  • providerEnvironment: The Envirionment where the sim is registered at the provider.
  • subscriptionId: The ID of the associated subscription.
  • phoneNumber: The phone number linked to the request.
  • referenceNumber: A reference for tracking purposes.
  • info: Additional metadata, including the updated services.

Info

If an invalid service is requested, it will not be included in the response.


Usage Notes

  • The services parameter must define all the services to be updated or added.
  • Either subscriptionId or phoneNumber is required.
  • Use referenceNumber for tracking purposes.
  • If an unavailable service is requested, it will be ignored in the response.

Example Requests

Update services using subscriptionId

POST /api/SetServicesSubscription
Content-Type: application/json

{
  "subscriptionId": "SUB12345",
  "services": {
    "dataPlan": "20GB",
    "voicePlan": "Unlimited",
    "internationalCalling": true
  },
  "referenceNumber": "REF98765"
}

Update services using phoneNumber

POST /api/SetServicesSubscription
Content-Type: application/json

{
  "phoneNumber": "0612345678",
  "services": {
    "dataPlan": "10GB",
    "smsPlan": "Unlimited"
  },
  "referenceNumber": "REF54321"
}

Example Error

If a non-existing service is requested, it will not be included in the response.

POST /api/SetServicesSubscription
Content-Type: application/json

{
  "subscriptionId": "###gxhI5###Zvz9Js",
  "services": {
    "newOptionNotDefined": true
  }
}

Example Response:

{
    "id": "On######hdVe###p6",
    "createdAt": "2025-02-03T11:51:21.5276728+01:00",
    "modifiedAt": "2025-02-03T11:51:21.5276728+01:00",
    "status": "INIT",
    "activationType": "SETSERVICES",
    "providerEnvironment": "SP16001",
    "referenceNumber": "",
    "subscriptionId": "###gxhI5###Zvz9Js",
    "phoneNumber": "06-#####969",
    "info": {
        "services": {}
    }
}

Warning

If you request a non-existing value for a service like "dataRoamingLimitation" (for example "Limit 12.5") the whole request with all service changes will be rejected. The 'Activation' record will have status 'ERROR' although the first response on the request had status 'INIT'.


Summary

The /api/SetServicesSubscription endpoint allows updating or adding services for an existing subscription.

  • Requires either subscriptionId or phoneNumber.
  • Services must be specified in the services object.
  • The response includes a tracking id.
  • Invalid service requests are ignored or respond with an 'ERROR' status.

Use this API to efficiently manage subscription services.

Last Updated:
Contributors: UP2media-AR, Jos Harink
Prev
SimSwapSubscription
Next
MoveEnvironmentSubscription