Account Pricing

Retrieve your account's pricing & supported destination via MoceanSMS API Server at Base URL

Response will be given for every request in XML format by default. In fact, you get to choose between XML or JSON format by setting value for optional parameter "mocean-resp-format" and submit along your account pricing query.

HTTP Method Supported

GET - MoceanSMS API Server only reads data from HTTP URL

Base URL

https://rest-api.moceansms.com/rest/1/account/pricing

Parameters

Parameter Name

Data Format

Descriptions

mocean-api-key

* Required

string

Your account API key.

mocean-api-secret

* Required

string

Your account API secret.

mocean-mcc

* Optional

number

User can specify to get pricing for a particular Mobile Country Code (MCC).

mocean-mnc

* Optional

number

Mobile Network Code (MNC) needs to be specified if user passes in mocean-mcc. User is allowed to pass ONE MNC only per query.

mocean-resp-format

* Optional

string

Response format. By default, response format will be returned in XML. Supported formats are:

  1. XML
  2. JSON
  3. CSV

mocean-delimiter

* Optional

string

Delimiter to be used in CSV format. By default, delimiter is set to “;”. User can specify to set delimiter to “;”, “:” or “|” only.

Example Request

curl -X GET "https://rest-api.moceansms.com/rest/1/account/pricing?mocean-api-key={api_key}&mocean-api-secret={api_secret}"
$url = 'https://rest-api.moceansms.com/rest/1/account/pricing?' . http_build_query(
[
'mocean-api-key' => 'API_KEY',
'mocean-api-secret' => 'API_SECRET',
]
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Example Response

A successful response for account balance query will be as follows:

<result>
    <status>0</status>
    <data>
        <destination>
            <country>Default</country>
            <operator>Default</operator>
            <mcc>Default</mcc>
            <mnc>Default</mnc>
            <price>0.0100</price>
            <currency>MYR</currency>
        </destination>
        <destination>
            <country>Malaysia</country>
            <operator>Default</operator>
            <mcc>502</mcc>
            <mnc>Default</mnc>
            <price>0.0040</price>
            <currency>MYR</currency>
        </destination>
        <destination>
            <country>Malaysia</country>
            <operator>Digi</operator>
            <mcc>502</mcc>
            <mnc>16</mnc>
            <price>0.0010</price>
            <currency>MYR</currency>
        </destination>
        <destination>
            <country>Malaysia</country>
            <operator>Celcom</operator>
            <mcc>502</mcc>
            <mnc>12,19</mnc>
            <price>0.0020</price>
            <currency>MYR</currency>
        </destination>
    </data>
</result>                  
{
    "status":0,
    "destinations":[
        {
            "country":"Default",
            "operator":"Default",
            "mcc":"Default",
            "mnc":"Default",
            "price":"0.0100",
            "currency":"MYR"
        },
        {
            "country":"Malaysia",
            "operator":"Default",
            "mcc":"502",
            "mnc":"Default",
            "price":"0.0040",
            "currency":"MYR"			
        },
        {
            "country":"Malaysia",
            "operator":"Celcom",
            "mcc":"502",
            "mnc":"13,19",
            "price":"0.0020",
            "currency":"MYR"			
        },
        {
            "country":"Malaysia",
            "operator":"DiGi+Telecom",
            "mcc":"502",
            "mnc":"16",
            "price":"0.0010",
            "currency":"MYR"
        }
    ]
}

While unsuccessful response will be as follows:

<result>
    <status>1</status>
    <err_msg>Authorization failed</err_msg>
</result>                  
{
  "status":1,
  "err_msg":"Authorization failed"
}

Account Pricing Response Variables

Parameter Name

Data Format

Descriptions

status

number

Status of the request.

country

string

Country name of the destination.

operator

string

Operator name of the destination.

mcc

string

Corresponding Mobile Country Code for the country name given.

mnc

string

Corresponding Mobile Network Code for the country name given.

price

number

Price of the destination.

currency

string

Currency (in string) for price listed.

err_msg

string

Error message.

Account Pricing Response Status Codes

Status Code

Descriptions

0

OK. No error encountered

1

Authorization failed. Invalid mocean-api-key or mocean-api-secret.

3

No pricing list found.

24

Unknown error.

32

Throttled. Too many queries sent in within period defined by Micro Ocean Technologies.

46

Invalid mocean-mcc or invalid mocean-mnc passed in.

51

Invalid mocean-delimiter passed in.

52

Multiple charging packages.