With the PricePlans API, you can query and maintain (detailed) price information of CM's products.
Query accounts linked to a priceplan
Retrieve a list of accounts linked to a certain priceplan
https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan}/products/{product}/accounts
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 |
http status | description |
---|---|
200 | OK |
curl -i https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan}/products/{product}/accounts?timeStamp='timeStamp' -X GET -H "Content-Type: application/json"
<?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 )); ?>
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
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 |
http status | description |
---|---|
200 | OK |
curl -i https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/countries?timeStamp='timeStamp' -X GET -H "Content-Type: application/json"
<?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 )); ?>
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"
Retrieve a list of all EURO exchange rates
https://api.cmtelecom.com/priceplans/v2.0/euroexchangerates
http status | description |
---|---|
200 | OK |
Convert an amount in EURO to the specified currency
https://api.cmtelecom.com/priceplans/v2.0/euroexchangerates/toforeigncurrency
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 |
http status | description |
---|---|
200 | OK |
curl -i https://api.cmtelecom.com/priceplans/v2.0/euroexchangerates/toforeigncurrency?foreignCurrency='foreignCurrency'&amountInEuro='amountInEuro' -X GET -H "Content-Type: application/json"
<?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 )); ?>
Convert an amount in the specified currency to EURO
https://api.cmtelecom.com/priceplans/v2.0/euroexchangerates/toeuro
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 |
http status | description |
---|---|
200 | OK |
curl -i https://api.cmtelecom.com/priceplans/v2.0/euroexchangerates/toeuro?foreignCurrency='foreignCurrency'&amountInForeignCurrency='amountInForeignCurrency' -X GET -H "Content-Type: application/json"
<?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 )); ?>
Query and maintain the default (non overriden) prices
Retrieve the history of default prices for a certain price cell
https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan}/products/{product}/pricedefaults
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 |
http status | description |
---|---|
200 | OK |
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 // 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 )); ?>
Change default prices for a certain account and product
name | in | description | required | schema | type | format |
---|---|---|---|---|---|---|
changedPrice | body | The price change to apply | true |
|
||
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 |
http status | description |
---|---|
200 | OK |
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 // 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 )); ?>
Create new default prices for a certain account and product
name | in | description | required | schema | type | format |
---|---|---|---|---|---|---|
newPrice | body | The default price to create | true |
|
||
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 |
http status | description |
---|---|
200 | OK |
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 // 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 )); ?>
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.
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
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 |
http status | description |
---|---|
200 | OK |
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 // 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 )); ?>
Query and maintain the overrides for an account
Retrieve a list of all price overrides for a certain price cell
https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/priceoverrides
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 |
http status | description |
---|---|
200 | OK |
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 // 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 )); ?>
Create price overrides for a certain account and product
https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/priceoverrides
name | in | description | required | schema | type | format |
---|---|---|---|---|---|---|
priceOverride | body | The price override to apply | true |
|
||
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 |
http status | description |
---|---|
200 | OK |
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 // 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 )); ?>
Retrieve a list of all scheduled price overrides for a certain account and product (including all countries and operators)
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 |
http status | description |
---|---|
200 | OK |
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 // 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 )); ?>
Close price overrides for a certain account and product
https://api.cmtelecom.com/priceplans/v2.0/accounts/{account}/products/{product}/priceoverrides/close
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 |
http status | description |
---|---|
200 | OK |
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 // 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 )); ?>
Query (standard) price plans and monthly subscription prices.
Retrieve the collection of price plans
https://api.cmtelecom.com/priceplans/v2.0/priceplans
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 |
http status | description |
---|---|
200 | OK |
curl -i https://api.cmtelecom.com/priceplans/v2.0/priceplans?currency='currency'&isStandard='isStandard' -X GET -H "Content-Type: application/json"
<?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 )); ?>
Retrieve the collection of standard price plans with the monthly price
https://api.cmtelecom.com/priceplans/v2.0/priceplans/standards/monthlyprice
name | in | description | required | type |
---|---|---|---|---|
currency | query | The currency to query price plans for | true | string |
http status | description |
---|---|
200 | OK |
curl -i https://api.cmtelecom.com/priceplans/v2.0/priceplans/standards/monthlyprice?currency='currency' -X GET -H "Content-Type: application/json"
<?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 )); ?>
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
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 |
http status | description |
---|---|
200 | OK |
curl -i https://api.cmtelecom.com/priceplans/v2.0/priceplans/service/{serviceID}/monthlyprice?currency='currency' -X GET -H "Content-Type: application/json"
<?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 )); ?>
Retrieve a single price plan by its unique identifier
https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan}
name | in | description | required | type | format |
---|---|---|---|---|---|
priceplan | path | The priceplan identifier | true | integer | int32 |
http status | description |
---|---|
200 | OK |
curl -i https://api.cmtelecom.com/priceplans/v2.0/priceplans/{priceplan} -X GET -H "Content-Type: application/json"
<?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 )); ?>
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.
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
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 |
http status | description |
---|---|
200 | OK |
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 // 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 )); ?>
Retrieve a list of all products
https://api.cmtelecom.com/priceplans/v2.0/products
http status | description |
---|---|
200 | OK |
Retrieve a list of all statuses for a certain product
https://api.cmtelecom.com/priceplans/v2.0/products/{product}/statuses
name | in | description | required | type | format |
---|---|---|---|---|---|
product | path | The product to retrieve status codes for | true | integer | int32 |
http status | description |
---|---|
200 | OK |
curl -i https://api.cmtelecom.com/priceplans/v2.0/products/{product}/statuses -X GET -H "Content-Type: application/json"
<?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 )); ?>
Retrieve a list of all units
https://api.cmtelecom.com/priceplans/v2.0/units
http status | description |
---|---|
200 | OK |