Pricing API

In this quickstart, you'll learn how to list the Prices for Outbound SMS, MMS or Voice messages from your web application using the Pricing API.

Step 1: Fetch your credentials

Before we get started, collect your live API key from the Developer Dashboard.

Step 2: List pricing information for outbound SMS messages

With your credentials at hand, you can now list the pricing information for outbound SMS messages.

curl -X GET https://rest.messagebird.com/pricing/sms/outbound \
-H 'Authorization: AccessKey YOUR-API-KEY'

This will return the pricing information for your default SMS configuration in MessageBird.

To list the pricing information for a specific SMPP user name, simply use the below URL and specify the smppUser with the SMPP SystemID provided by MessageBird.

curl -X GET https://rest.messagebird.com/pricing/sms/outbound/smpp/{smppUser} \
-H 'Authorization: AccessKey YOUR-API-KEY'

Pricing API endpoints for related products are:

  • Voice Messages (Text to Speech): https://rest.messagebird.com/pricing/tts/outbound
  • MMS: https://rest.messagebird.com/pricing/mms/outbound

Responses are the same for all endpoints.

Step 3: View the response

Now, let’s view Pricing API’s HTTP response to your request. If the set up was correct, you'll receive a response similar to this:

{
"gateway": 10,
"currencyCode": "EUR",
"totalCount": 3,
"prices": [
{
"price": "0.060000",
"currencyCode": "EUR",
"mccmnc": "0",
"mcc": "0",
"mnc": null,
"countryName": "Default Rate",
"countryIsoCode": "XX",
"operatorName": "Default Rate"
},
{
"price": "0.047000",
"currencyCode": "EUR",
"mccmnc": "202",
"mcc": "202",
"mnc": null,
"countryName": "Greece",
"countryIsoCode": "GR",
"operatorName": null
},
{
"price": "0.045000",
"currencyCode": "EUR",
"mccmnc": "20205",
"mcc": "202",
"mnc": "05",
"countryName": "Greece",
"countryIsoCode": "GR",
"operatorName": "Vodafone"
}
]
}

If something went wrong, you’ll receive an error response from the Pricing API. Don't worry if this happens, just head over to the SMS API Troubleshooting to understand the cause of the error.

Step 4: Checking the pricing information

The response includes pricing information for destinations, country default rates, and the default rate for all other destinations.

The pricing is applied in order from most specific to least specific rate:

  • if the destination is listed, then the destination specific rate will be applied.
  • if the destination is not listed but the country default rate is specified, then the country default rate will be applied.
  • if neither the destination nor the country default rate is listed, then the default rate will be applied.

Examples

The rate for an outbound SMS message sent to a Vodafone Greece recipient can be found under the entry with the mobile country code (mcc) for Greece and the mobile network code (mnc) for Vodafone.

{
"mccmnc": "20205",
"mcc": "202",
"mnc": "05",
"countryName": "Greece",
"operatorName": "Vodafone"
}

The rate for an outbound SMS message sent to a Greek mobile network operator that is not listed can be found under the default country rate for Greece.

{
"price": "0.047000",
"mccmnc": "202",
"mcc": "202",
"mnc": null,
"countryName": "Greece",
"operatorName": null
}

The rate for an outbound SMS message sent to any destination that is not listed can be found under the default rate for all other destinations.

{
"price": "0.060000",
"mccmnc": "0",
"mcc": "0",
"mnc": null,
"countryName": "Default Rate",
"operatorName": "Default Rate"
}

Congratulations! You can now programmatically list your outbound SMS messages rates with the MessageBird Pricing API using cURL.

Questions?

We’re always happy to help with code or other doubts you might have! Check out our Quickstarts, API Reference, Tutorials, SDKs, or contact our Support team.

Cookie Settings