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.
Before we get started, collect your live API key from the Developer Dashboard.
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:
Responses are the same for all endpoints.
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.
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:
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.