PricePlans
PHP

Introduction

With the PricePlans API, you can query and maintain (detailed) price information of CM's products.

Accounts

Query accounts linked to a priceplan

GetAccounts

Retrieve a list of accounts linked to a certain priceplan

https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan}/products/{product}/accounts

GET Parameters

name in description required type format
priceplan path The priceplan identifier true integer int32
product path The product to query linked accounts for true integer int32
timeStamp query Query for a specific timestamp in UTC (default is now) false string date-time

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan}/products/{product}/accounts?timeStamp='timeStamp'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'priceplan' => 10,
    'product' => 10
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/priceplans/'
         .$priceplan
         .'/products/'
         .$product
         .'/accounts?timeStamp='timeStamp'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Countries

GetCountries

Retrieve a list of all country codes for a certain account and product

https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/countries

GET Parameters

name in description required type format
account path The account to query country codes for true string
product path The product to query country codes for true integer int32
timeStamp query Query for a specific timestamp in UTC (default is now) false string date-time

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/countries?timeStamp='timeStamp'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'account' => 'account',
    'product' => 10
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/accounts/'
         .$account
         .'/products/'
         .$product
         .'/countries?timeStamp='timeStamp'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

EuroExchangeRate

Exposes the “EURO Exchange Rates” from PricePlans throuwh a Web API call. Supported use cases are converting from a foreign currency to EURO and from EURO to a foreign currency"

  1. From EUR to XXX (e.g. USD) currency
  2. From XXX (e.g. USD) currency to EUR
GetEuroExchangeRates

Retrieve a list of all EURO exchange rates

https://api.cmtelecom.com/priceplans/v2.0/euroexchangerates

Responses

http status description
200 OK
ConvertToForeignCurrency

Convert an amount in EURO to the specified currency

https://api.cmtelecom.com/priceplans/v2.0/euroexchangerates/toforeigncurrency

GET Parameters

name in description required type format
foreignCurrency query The ISO4217 currency code of the foreign currency true string
amountInEuro query The amount in EURO true number double

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/euroexchangerates/toforeigncurrency?foreignCurrency='foreignCurrency'&amountInEuro='amountInEuro'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $url = 'https://api.cmtelecom.com/priceplans/v2.0/euroexchangerates/toforeigncurrency?foreignCurrency='foreignCurrency'&amountInEuro='amountInEuro'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
ConvertToEuro

Convert an amount in the specified currency to EURO

https://api.cmtelecom.com/priceplans/v2.0/euroexchangerates/toeuro

GET Parameters

name in description required type format
foreignCurrency query The ISO4217 currency code of the foreign currency true string
amountInForeignCurrency query The amount in the foreign currency true number double

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/euroexchangerates/toeuro?foreignCurrency='foreignCurrency'&amountInForeignCurrency='amountInForeignCurrency'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $url = 'https://api.cmtelecom.com/priceplans/v2.0/euroexchangerates/toeuro?foreignCurrency='foreignCurrency'&amountInForeignCurrency='amountInForeignCurrency'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

PriceDefaults

Query and maintain the default (non overriden) prices

GetDefaultPriceChanges

Retrieve the history of default prices for a certain price cell

https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan}/products/{product}/pricedefaults

GET Parameters

name in description required type format
priceplan path The priceplan to query prices for true integer int32
product path The product to query prices for true integer int32
fallbackCountry query Flag, indicating to query the prices for the fallback country (a.k.a. "other countries") false boolean
country query The country to query prices for. NOTE: only valid when flag fallbackCountry is 'false' false string
fallbackOperator query Flag, indicating to query the prices for the fallback operator (a.k.a. "other operator") false boolean
operatorCode query The operator to query prices for. NOTE: only valid when flag fallbackOperator is 'false' false string
fallbackStatus query Flag, indicating to query the prices for the fallback status (a.k.a. "other statuses") false boolean
status query The status to query prices for. NOTE: only valid when flag fallbackStatus is 'false' false integer int32
volume query The volume to query prices for false integer int32
tariff query The tariff to query prices for false integer int32

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan}/products/{product}/pricedefaults?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&volume=10&tariff=10
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'priceplan' => 10,
    'product' => 10
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/priceplans/'
         .$priceplan
         .'/products/'
         .$product
         .'/pricedefaults?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&volume=10&tariff=10';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
ChangeDefaultPrices

Change default prices for a certain account and product

https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan}/products/{product}/pricedefaults/change

POST Parameters

name in description required schema type format
changedPrice body The price change to apply true
  • {
    • "UnitPrice" : {
      • "format" : "double",
      • "type" : "number"
      }, "SetupFee" : {
      • "format" : "double",
      • "type" : "number"
      }, "TimeStamp" : "string"
    }
priceplan path The priceplan to change default prices for true integer int32
product path The product to change default prices for true integer int32
fallbackCountry query Flag, indicating to change default prices for the fallback country (a.k.a. "other countries") false boolean
country query The country to change default prices for false string
fallbackOperator query Flag, indicating to change default prices for the fallback operator (a.k.a. "other operators") false boolean
operatorCode query The operator to change defaultprices for false string
fallbackStatus query Flag, indicating to change default prices for the fallback status (a.k.a. "other statuses") false boolean
status query The status to change default prices for false integer int32
volume query The volume to change default prices for false integer int32
tariff query The tariff to change default prices for false integer int32

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan}/products/{product}/pricedefaults/change?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&volume=10&tariff=10
     -X POST
     -H "Content-Type: application/json"
     -d "{
 'UnitPrice' : {
  'format' : 'double',
  'type' : 'number'
 },
 'SetupFee' : {
  'format' : 'double',
  'type' : 'number'
 },
 'TimeStamp' : 'string'
}"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'priceplan' => 10,
    'product' => 10,
    'data' => json_encode(array(
               "UnitPrice": array(
                "format" => "double",
                "type" => "number"
               ),
               "SetupFee": array(
                "format" => "double",
                "type" => "number"
               ),
               "TimeStamp" => "string"
              )          )
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/priceplans/'
         .$priceplan
         .'/products/'
         .$product
         .'/pricedefaults/change?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&volume=10&tariff=10';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_POST           => true,
     CURLOPT_POSTFIELDS     => $data,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
CreateDefaultPrice

Create new default prices for a certain account and product

https://api.cmtelecom.com/priceplans/priceplans/v2.0/priceplans/{priceplan}/products/{product}/pricedefaults/create

POST Parameters

name in description required schema type format
newPrice body The default price to create true
  • {
    • "UnitPrice" : {
      • "format" : "double",
      • "type" : "number"
      }, "SetupFee" : {
      • "format" : "double",
      • "type" : "number"
      }, "TimeStamp" : "string"
    }
priceplan path The priceplan to create default prices for true integer int32
product path The product to create default prices for true integer int32
fallbackCountry query Flag, indicating to create default prices for the fallback country (a.k.a. "other countries") false boolean
country query The country to create default prices for false string
fallbackOperator query Flag, indicating to create default prices for the fallback operator (a.k.a. "other operators") false boolean
operatorCode query The operator to create default prices for false string
fallbackStatus query Flag, indicating to create default prices for the fallback status (a.k.a. "other statuses") false boolean
status query The status to create default prices for false integer int32
volume query The volume to create default prices for false integer int32
tariff query The tariff to create default prices for false integer int32

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/priceplans/v2.0/priceplans/{priceplan}/products/{product}/pricedefaults/create?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&volume=10&tariff=10
     -X POST
     -H "Content-Type: application/json"
     -d "{
 'UnitPrice' : {
  'format' : 'double',
  'type' : 'number'
 },
 'SetupFee' : {
  'format' : 'double',
  'type' : 'number'
 },
 'TimeStamp' : 'string'
}"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'priceplan' => 10,
    'product' => 10,
    'data' => json_encode(array(
               "UnitPrice": array(
                "format" => "double",
                "type" => "number"
               ),
               "SetupFee": array(
                "format" => "double",
                "type" => "number"
               ),
               "TimeStamp" => "string"
              )          )
  );

  $url = 'https://api.cmtelecom.com/priceplans/priceplans/v2.0/priceplans/'
         .$priceplan
         .'/products/'
         .$product
         .'/pricedefaults/create?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&volume=10&tariff=10';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_POST           => true,
     CURLOPT_POSTFIELDS     => $data,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

PriceDetails

Query details of prices that are currently active for a certain account and product (at a specific moment in time). The resultset includes the default prices as well the possible override price.

You can query prices per account or per price-plan for a certain product. The resultset can be filtered on (product) status, volume, tariff and operator-code (mcc/mnc in case of SMS). When timestamp, status, volume, tariff and operatorCode are specified, you will get one price in the response.

GetDetailedPrices

Retrieve a list of all active prices with details for a certain account and product

https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/pricedetails

GET Parameters

name in description required type format
account path The account to query prices for true string
product path The product to query prices for true integer int32
fallbackCountry query Flag, indicating to query the prices for the fallback country (a.k.a. "other countries") false boolean
country query The country to query prices for. NOTE: only valid when flag fallbackCountry is 'false' false string
fallbackOperator query Flag, indicating to query the prices for the fallback operator (a.k.a. "other operator") false boolean
operatorCode query The operator to query prices for. NOTE: only valid when flag fallbackOperator is 'false' false string
fallbackStatus query Flag, indicating to query the prices for the fallback status (a.k.a. "other statuses") false boolean
status query The status to query prices for. NOTE: only valid when flag fallbackStatus is 'false' false integer int32
timeStamp query Query for a specific timestamp in UTC (default is now) false string date-time
volume query The volume to query prices for false integer int32
tariff query The tariff to query prices for false integer int32

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/pricedetails?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&timeStamp='timeStamp'&volume=10&tariff=10
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'account' => 'account',
    'product' => 10
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/accounts/'
         .$account
         .'/products/'
         .$product
         .'/pricedetails?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&timeStamp='timeStamp'&volume=10&tariff=10';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

PriceOverrides

Query and maintain the overrides for an account

GetPriceOverrides

Retrieve a list of all price overrides for a certain price cell

https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/priceoverrides

GET Parameters

name in description required type format
account path The account to query prices for true string
product path The product to query prices for true integer int32
fallbackCountry query Flag, indicating to query the prices for the fallback country (a.k.a. "other countries") false boolean
country query The country to query prices for. NOTE: only valid when flag fallbackCountry is 'false' false string
fallbackOperator query Flag, indicating to query the prices for the fallback operator (a.k.a. "other operator") false boolean
operatorCode query The operator to query prices for. NOTE: only valid when flag fallbackOperator is 'false' false string
fallbackStatus query Flag, indicating to query the prices for the fallback status (a.k.a. "other statuses") false boolean
status query The status to query prices for. NOTE: only valid when flag fallbackStatus is 'false' false integer int32
volume query The volume to query prices for false integer int32
tariff query The tariff to query prices for false integer int32

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/priceoverrides?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&volume=10&tariff=10
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'account' => 'account',
    'product' => 10
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/accounts/'
         .$account
         .'/products/'
         .$product
         .'/priceoverrides?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&volume=10&tariff=10';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
CreatePriceOverride

Create price overrides for a certain account and product

https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/priceoverrides

POST Parameters

name in description required schema type format
priceOverride body The price override to apply true
  • {
    • "UnitPriceOverride" : {
      • "format" : "double",
      • "type" : "number"
      }, "SetupFeeOverride" : {
      • "format" : "double",
      • "type" : "number"
      }, "OverrideValidity" : {
      • "From" : "string",
      • "To" : "string"
      }
    }
account path The account to override prices for true string
product path The product to override prices for true integer int32
fallbackCountry query Flag, indicating to override prices for the fallback country (a.k.a. "other countries") false boolean
country query The country to override prices for false string
fallbackOperator query Flag, indicating to override prices for the fallback operator (a.k.a. "other operators") false boolean
operatorCode query The operator to override prices for false string
fallbackStatus query Flag, indicating to override prices for the fallback status (a.k.a. "other statuses") false boolean
status query The status to override prices for false integer int32
volume query The volume to override prices for false integer int32
tariff query The tariff to override prices for false integer int32

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/priceoverrides?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&volume=10&tariff=10
     -X POST
     -H "Content-Type: application/json"
     -d "{
 'UnitPriceOverride' : {
  'format' : 'double',
  'type' : 'number'
 },
 'SetupFeeOverride' : {
  'format' : 'double',
  'type' : 'number'
 },
 'OverrideValidity' : {
  'From' : 'string',
  'To' : 'string'
 }
}"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'account' => 'account',
    'product' => 10,
    'data' => json_encode(array(
               "UnitPriceOverride": array(
                "format" => "double",
                "type" => "number"
               ),
               "SetupFeeOverride": array(
                "format" => "double",
                "type" => "number"
               ),
               "OverrideValidity": array(
                "From" => "string",
                "To" => "string"
               )
              )          )
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/accounts/'
         .$account
         .'/products/'
         .$product
         .'/priceoverrides?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&volume=10&tariff=10';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_POST           => true,
     CURLOPT_POSTFIELDS     => $data,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
GetScheduledOverrides

Retrieve a list of all scheduled price overrides for a certain account and product (including all countries and operators)

https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/scheduledpriceoverrides

GET Parameters

name in description required type format
account path The account to query prices for true string
product path The product to query prices for true integer int32
fallbackCountry query Flag, indicating to query the prices for the fallback country (a.k.a. "other countries") false boolean
country query The country to query prices for. NOTE: only valid when flag fallbackCountry is 'false' false string
fallbackOperator query Flag, indicating to query the prices for the fallback operator (a.k.a. "other operator") false boolean
operatorCode query The operator to query prices for. NOTE: only valid when flag fallbackOperator is 'false' false string
fallbackStatus query Flag, indicating to query the prices for the fallback status (a.k.a. "other statuses") false boolean
status query The status to query prices for. NOTE: only valid when flag fallbackStatus is 'false' false integer int32
timeStamp query Query for a specific timestamp in UTC (default is now) false string date-time
volume query The volume to query prices for false integer int32
tariff query The tariff to query prices for false integer int32

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/scheduledpriceoverrides?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&timeStamp='timeStamp'&volume=10&tariff=10
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'account' => 'account',
    'product' => 10
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/accounts/'
         .$account
         .'/products/'
         .$product
         .'/scheduledpriceoverrides?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&timeStamp='timeStamp'&volume=10&tariff=10';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
ClosePriceOverride

Close price overrides for a certain account and product

https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/priceoverrides/close

POST Parameters

name in description required type format
account path The account to close price overrides for true string
product path The product to close price overrides for true integer int32
fallbackCountry query Flag, indicating to override prices for the fallback country (a.k.a. "other countries") false boolean
country query The country to close price overrides for false string
fallbackOperator query Flag, indicating to close price overrides for the fallback operator (a.k.a. "other operators") false boolean
operatorCode query The operator to close price overrides for false string
fallbackStatus query Flag, indicating to close price overrides for the fallback status (a.k.a. "other statuses") false boolean
status query The status to close price overrides for false integer int32
timeStamp query Date-time for closing the overrides in UTC (default is now) false string date-time
volume query The volume to close the overrides for false integer int32
tariff query The tariff to close the overrides for false integer int32

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/priceoverrides/close?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&timeStamp='timeStamp'&volume=10&tariff=10
     -X POST
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'account' => 'account',
    'product' => 10
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/accounts/'
         .$account
         .'/products/'
         .$product
         .'/priceoverrides/close?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&timeStamp='timeStamp'&volume=10&tariff=10';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

PricePlans

Query (standard) price plans and monthly subscription prices.

GetPricePlans

Retrieve the collection of price plans

https://api.cmtelecom.com/priceplans/v2.0/priceplans

GET Parameters

name in description required type
currency query The currency to query price plans for false string
isStandard query When true; query only the standard price plans false boolean

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/priceplans?currency='currency'&isStandard='isStandard'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $url = 'https://api.cmtelecom.com/priceplans/v2.0/priceplans?currency='currency'&isStandard='isStandard'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
GetStandardPricePlansMonthlyPrice

Retrieve the collection of standard price plans with the monthly price

https://api.cmtelecom.com/priceplans/v2.0/priceplans/standards/monthlyprice

GET Parameters

name in description required type
currency query The currency to query price plans for true string

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/priceplans/standards/monthlyprice?currency='currency'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $url = 'https://api.cmtelecom.com/priceplans/v2.0/priceplans/standards/monthlyprice?currency='currency'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
GetServicePricePlansMonthlyPrice

Retrieve the collection of price plans for a specific service with the monthly price

https://api.cmtelecom.com/priceplans/v2.0/priceplans/service/{serviceID}/monthlyprice

GET Parameters

name in description required type format
serviceID path The service to query price plans for true integer int32
currency query The currency to query price plans for true string

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/priceplans/service/{serviceID}/monthlyprice?currency='currency'
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'serviceID' => 10
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/priceplans/service/'
         .$serviceID
         .'/monthlyprice?currency='currency'';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>
GetPricePlan

Retrieve a single price plan by its unique identifier

https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan}

GET Parameters

name in description required type format
priceplan path The priceplan identifier true integer int32

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan}
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'priceplan' => 10
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/priceplans/'
         .$priceplan;

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Prices

Query prices that are currently active for a certain account and product (at a specific moment in time). This call returns the effective price in which possible overrides are applied.

You can query prices per account or per price-plan for a certain product. The resultset can be filtered on (product) status, volume, tariff and operator-code (mcc/mnc in case of SMS). When timestamp, status, volume, tariff and operatorCode are specified, you will get one price in the response.

GetPrices

Retrieve a list of all effective prices for a certain account and product

https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/prices

GET Parameters

name in description required type format
account path The account to query prices for true string
product path The product to query prices for true integer int32
fallbackCountry query Flag, indicating to query the prices for the fallback country (a.k.a. "other countries") false boolean
country query The country to query prices for. NOTE: only valid when flag fallbackCountry is 'false' false string
fallbackOperator query Flag, indicating to query the prices for the fallback operator (a.k.a. "other operator") false boolean
operatorCode query The operator to query prices for. NOTE: only valid when flag fallbackOperator is 'false' false string
fallbackStatus query Flag, indicating to query the prices for the fallback status (a.k.a. "other statuses") false boolean
status query The status to query prices for. NOTE: only valid when flag fallbackStatus is 'false' false integer int32
timeStamp query Query for a specific timestamp (default is now) false string date-time
volume query The volume to query prices for false integer int32
tariff query The tariff to query prices for false integer int32

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/prices?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&timeStamp='timeStamp'&volume=10&tariff=10
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'account' => 'account',
    'product' => 10
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/accounts/'
         .$account
         .'/products/'
         .$product
         .'/prices?fallbackCountry='fallbackCountry'&country='country'&fallbackOperator='fallbackOperator'&operatorCode='operatorCode'&fallbackStatus='fallbackStatus'&status=10&timeStamp='timeStamp'&volume=10&tariff=10';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Products

GetProducts

Retrieve a list of all products

https://api.cmtelecom.com/priceplans/v2.0/products

Responses

http status description
200 OK

Statuses

GetStatuses

Retrieve a list of all statuses for a certain product

https://api.cmtelecom.com/priceplans/v2.0/products/{product}/statuses

GET Parameters

name in description required type format
product path The product to retrieve status codes for true integer int32

Responses

http status description
200 OK

Code Examples:

cURL
curl -i https://api.cmtelecom.com/priceplans/v2.0/products/{product}/statuses
     -X GET
     -H "Content-Type: application/json"
PHP
<?php
  // cURL v7.18.1+ and OpenSSL 0.9.8j+ are required
  $parameters = array(
    'product' => 10
  );

  $url = 'https://api.cmtelecom.com/priceplans/v2.0/products/'
         .$product
         .'/statuses';

  $ch = curl_init();
  curl_setopt_array($ch, array(
     CURLOPT_URL            => $url,
     CURLOPT_HTTPHEADER     => array(
                                 'Content-Type: application/json'
                                 ),
     CURLOPT_HEADER       => TRUE,
     CURLOPT_RETURNTRANSFER => true
    )
  );
  $result = curl_exec($ch);
  $HeaderInfo = curl_getinfo($ch);
  $HeaderSize=$HeaderInfo['header_size'];
  $Body = trim(mb_substr($result, $HeaderSize));
  $ResponseHeader = explode('\n',trim(mb_substr($result, 0, $HeaderSize)));
  unset($ResponseHeader[0]);
  $Headers = array();
  foreach($ResponseHeader as $line){
      list($key,$val) = explode(':',$line,2);
      $Headers[strtolower($key)] = trim($val);
  }

  var_dump( array(
      'Body' => $Body,
      'Headers' => $Headers
  ));
?>

Units

GetUnits

Retrieve a list of all units

https://api.cmtelecom.com/priceplans/v2.0/units

Responses

http status description
200 OK