List SMS sending rates
/v1/billing/rates/sms-outboundfor await (const rate of bird.billingRates.smsOutbound({ country_code: "US" })) {
console.log(rate);
}for rate in client.billing_rates.sms_outbound(country_code="US"):
print(rate)for rate, err := range client.BillingRates.SmsOutbound(context.Background(), bird.BillingRatesSmsOutboundParams{CountryCode: "US"}) {
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", *rate)
}foreach ($bird->billingRates->smsOutbound(['country_code' => 'US']) as $rate) {
print_r($rate);
}bird billing rates sms-outboundcurl -X GET "https://us1.platform.bird.com/v1/billing/rates/sms-outbound" \
-H "Authorization: Bearer $TOKEN" \
--url-query "sort=country_code" \
--url-query "order=asc" \
--url-query "limit=25"{
"data": [
{
"country_code": "US",
"mcc_mnc": "310260",
"sender_type": "long_code",
"category": "transactional",
"unit": "segment",
"rate": {
"amount": "0.0097",
"currency_code": "USD",
"transaction_amount": "0.0062",
"passthrough_amount": "0.0035"
}
}
],
"next_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE0OjAzOjEwWlwiIiwiaSI6IjAxOTJmM2IxLTRjN2UtN2EyYi05ZDYxLThmM2E1YzJlN2I0MCJ9",
"prev_cursor": null,
"refresh_cursor": "eyJ2IjoxLCJzIjoiXCIyMDI2LTA1LTI1VDE2OjQyOjAxWlwiIiwiaSI6IjAxOTJmM2IxLTllMDQtN2NkMy1iODE3LTJhNmY0ZDFjOGUwOSJ9"
}
Returns what your organization pays to send an SMS, per destination country, sender type, message category and mobile network. Each rate has the fee to carry a segment, the carrier fee where one applies, and their sum. Rates are net of tax, in your organization's billing currency, with your agreed prices applied. Only destinations that have a rate are listed, and a category or network gets a row of its own only where its rate differs from the fallback row. Returns 412 when your organization has no billing currency yet, a retryable 503 when the rates cannot be read, and a 500 with RatesNotRepresentable when a price cannot be shown on this card, which retrying does not fix; a page is never returned with rates missing. Requires the rates permission in the workspace, or the organization's org:billing permission, with which the workspace can be left out. Without a credential the response is Bird's default rates, in currency; a credential that does not authenticate returns 401, never default rates.
Query Parameters
sortstringField to sort by. Rates are ordered by destination country, then sender type, category and network.
Possible values: country_code
orderstringSort direction. Defaults to asc, which sorts alphabetically or from oldest to newest, depending on the selected sort field.
Possible values: asc, desc
limitintegerMaximum number of items to return per page.
starting_afterstringCursor from the next_cursor field of a previous list response. Returns items immediately after the cursor position in the current sort order.
ending_beforestringCursor from the prev_cursor or refresh_cursor field of a previous list response. Returns items immediately before the cursor position in the current sort order. prev_cursor returns the preceding page. refresh_cursor anchors at the first row of that response, which on a newest-first sort is how to fetch the items that have appeared since.
country_codestringReturn only rates for this destination country.
sender_typestringReturn only rates for this sender type.
Possible values: long_code, short_code, alphanumeric, toll_free
categorystringReturn the rates that apply to this message category: the rates specific to it, and the rates with a null category, which apply wherever the category has no rate of its own.
Possible values: transactional, marketing, authentication, service
currencystringThe currency of the rates when the request carries no credential, USD when left out. With a credential the rates are in the organization's billing currency, and a different currency returns 422.
Response Payload
dataShow child attributes
data.country_codeThe destination country.
data.mcc_mncThe destination mobile network this rate is specific to, as its MCC and MNC digits. null on a rate that applies to every network without a row of its own.
data.sender_typeThe kind of sender identity a message was sent from: a standard long-code number, a short code, an alphanumeric sender ID, or a toll-free number. Toll-free is its own value rather than a kind of long code, because it carries a separate regulatory regime and both sending policy and pricing key on it directly.
Possible values: long_code, short_code, alphanumeric, toll_free
data.categoryThe message category this rate is specific to. null on a rate that applies to every category without a row of its own.
Possible values: transactional, marketing, authentication, service
data.unitWhat an SMS rate is charged per:
segment: One message segment. A long message is sent as several segments and charged for each.
Possible values: segment
data.rateWhat one segment costs. transaction_amount is what we charge to carry it and is always present on this card. It is charged when the message is sent, on the network a lookup of the destination number returns; when that lookup fails the message pays the transaction_amount of the row with a null mcc_mnc. passthrough_amount is the carrier fee. It is left out when this row carries none, which on a row with a null mcc_mnc says nothing about the networks that have a row of their own. It is charged only once the message is reported delivered, on the network the delivery report names, so an undelivered message does not pay it. amount is what a delivered segment costs when both fees are charged on this row's network; a message whose two fees are charged on different rows pays the transaction_amount of one and the passthrough_amount of the other.
Show child attributes
data.rate.amountThe price of one unit. Where the rate has two fees, it is the sum of the fees present.
data.rate.currency_codeYour organization's billing currency. Every amount is in it.
data.rate.transaction_amountOur own fee for one unit, on a rate made of two fees. It is the rate behind cost.transaction_amount on a message. Left out on a rate with a single fee, and where this fee is not priced.
data.rate.passthrough_amountThe third-party fee passed on for one unit. It is the rate behind cost.passthrough_amount on a message. Left out on a rate with a single fee, and where no such fee applies.
next_cursorCursor for the next page. Pass back as starting_after to advance forward. null when no next page exists.
prev_cursorCursor for the previous page. Pass back as ending_before to step backward. null when no previous page exists.
refresh_cursorRefresh anchor, the first row of this response. Pass back as ending_before to fetch what precedes it in the current sort order. On a newest-first sort those are the items that have appeared since; on any other sort they are the items that sort earlier, so refreshing such a list means re-fetching it instead. Non-null whenever data is non-empty; null only on an empty page. Distinct from prev_cursor.
Related resources
Continue with the documentation, guides and examples for this topic.