Skip to main content

PCR Profile API

Overview

The PCR Profile API provides functionalities for retrieving and modifying Policy and Charging Rules (PCR) profiles for SIM cards, including data, voice, SMS, and wallet configurations.

getPCRProfile

This method returns the Policy and Charging Rules (PCR) profile configuration for a specific SIM card.

Parameters

  • iccid (required): The ICCID of the SIM card (19-20 digits)

Return Type:

  • GetPCRProfileResponse

Authorization:

  • Requires ApiUserId and ApiKeyAuth

Example

Here's how to use the PCR Profile API to fetch a PCR profile:

import { PCRProfileApi, Configuration } from '@betatelltd/esim-sdk';

const config = new Configuration({
apiKey: (name: string) => {
if (name === 'x-api-key') return 'your-api-key';
if (name === 'x-user-id') return 'your-user-id';
return '';
},
basePath: 'base-url',
});
const apiInstance = new PCRProfileApi(configuration);

let iccid: string; // The ICCID of the SIM card (19-20 digits) (default to undefined)

const { status, data } = await apiInstance.getPCRProfile(iccid);

Response Codes

  • 200: Success
  • 400: Bad Request - Invalid ICCID format
  • 401: Unauthorized - Invalid or missing API key
  • 404: Not Found - SIM card not found
  • 500: Internal Server Error

GetPCRProfileResponse

The GetPCRProfileResponse object contains the following properties:

NameTypeDescriptionNotes
dataDataProfile[default to undefined]
voiceServiceProfile[][default to undefined]
smsServiceProfile[][default to undefined]
wallet_modestringCurrent wallet mode[default to undefined]
route_policynumberCurrent route policy[optional] [default to undefined]

Example

import { GetPCRProfileResponse } from '@betatelltd/esim-sdk';

const instance: GetPCRProfileResponse = {
data,
voice,
sms,
wallet_mode,
route_policy,
};

modifyPCRProfile

This method updates the Policy and Charging Rules (PCR) profile for a specific SIM card including data, voice, SMS, and wallet configurations.

Parameters

  • iccid (required): The ICCID of the SIM card (19-20 digits)
  • modifyPCRProfileRequest (required): ModifyPCRProfileRequest object

Return Type:

  • void (empty response body)

Authorization:

  • Requires ApiUserId and ApiKeyAuth

Example

Here's how to use the PCR Profile API to modify a PCR profile:

import { PCRProfileApi, Configuration, ModifyPCRProfileRequest } from '@betatelltd/esim-sdk';

const config = new Configuration({
apiKey: (name: string) => {
if (name === 'x-api-key') return 'your-api-key';
if (name === 'x-user-id') return 'your-user-id';
return '';
},
basePath: 'base-url',
});
const apiInstance = new PCRProfileApi(configuration);

let iccid: string; // The ICCID of the SIM card (19-20 digits) (default to undefined)
let modifyPCRProfileRequest: ModifyPCRProfileRequest; //

const { status, data } = await apiInstance.modifyPCRProfile(
iccid,
modifyPCRProfileRequest
);

Response Codes

  • 204: PCR profile updated successfully (no content)
  • 400: Bad Request - Invalid input or ICCID format
  • 401: Unauthorized - Invalid or missing API key
  • 404: Not Found - SIM card not found
  • 500: Internal Server Error