Add a channel rate
curl --request POST \
--url https://api.bbrands.io/api/v3/notification/rate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "sms",
"provider": "onesignal",
"country": "CL",
"unit": "segment",
"amount": 0.045,
"currency": "USD",
"valid_from": "2026-12-01"
}
'import requests
url = "https://api.bbrands.io/api/v3/notification/rate"
payload = {
"channel": "sms",
"provider": "onesignal",
"country": "CL",
"unit": "segment",
"amount": 0.045,
"currency": "USD",
"valid_from": "2026-12-01"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel: 'sms',
provider: 'onesignal',
country: 'CL',
unit: 'segment',
amount: 0.045,
currency: 'USD',
valid_from: '2026-12-01'
})
};
fetch('https://api.bbrands.io/api/v3/notification/rate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bbrands.io/api/v3/notification/rate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channel' => 'sms',
'provider' => 'onesignal',
'country' => 'CL',
'unit' => 'segment',
'amount' => 0.045,
'currency' => 'USD',
'valid_from' => '2026-12-01'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bbrands.io/api/v3/notification/rate"
payload := strings.NewReader("{\n \"channel\": \"sms\",\n \"provider\": \"onesignal\",\n \"country\": \"CL\",\n \"unit\": \"segment\",\n \"amount\": 0.045,\n \"currency\": \"USD\",\n \"valid_from\": \"2026-12-01\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bbrands.io/api/v3/notification/rate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": \"sms\",\n \"provider\": \"onesignal\",\n \"country\": \"CL\",\n \"unit\": \"segment\",\n \"amount\": 0.045,\n \"currency\": \"USD\",\n \"valid_from\": \"2026-12-01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bbrands.io/api/v3/notification/rate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel\": \"sms\",\n \"provider\": \"onesignal\",\n \"country\": \"CL\",\n \"unit\": \"segment\",\n \"amount\": 0.045,\n \"currency\": \"USD\",\n \"valid_from\": \"2026-12-01\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "email",
"provider": "horizon",
"country": "<string>",
"unit": "message",
"amount": 123,
"currency": "USD",
"valid_from": "2023-11-07T05:31:56Z",
"change_reason": "<string>",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
},
"message": "<string>",
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "UNPROCESSABLE_ENTITY",
"errors": [
{
"code": "change-reason-required",
"field": "change_reason",
"message": "change_reason is required"
}
],
"message": "Unprocessable Entity"
}
}Suppressions and rates
Add Channel Rate
Requires notification-rate:update. Rates are append-only: a new
price is a new row valid from valid_from (default now), so past
sends keep the price they were sent at. A send uses the latest rate
valid at send time for the recipient’s country, else the
all-countries rate (country null). Without change_reason a
default note is stored. 409 rate-already-exists when a rate of the
same channel, provider and country already starts at that date.
POST
/
notification
/
rate
Add a channel rate
curl --request POST \
--url https://api.bbrands.io/api/v3/notification/rate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel": "sms",
"provider": "onesignal",
"country": "CL",
"unit": "segment",
"amount": 0.045,
"currency": "USD",
"valid_from": "2026-12-01"
}
'import requests
url = "https://api.bbrands.io/api/v3/notification/rate"
payload = {
"channel": "sms",
"provider": "onesignal",
"country": "CL",
"unit": "segment",
"amount": 0.045,
"currency": "USD",
"valid_from": "2026-12-01"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
channel: 'sms',
provider: 'onesignal',
country: 'CL',
unit: 'segment',
amount: 0.045,
currency: 'USD',
valid_from: '2026-12-01'
})
};
fetch('https://api.bbrands.io/api/v3/notification/rate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bbrands.io/api/v3/notification/rate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channel' => 'sms',
'provider' => 'onesignal',
'country' => 'CL',
'unit' => 'segment',
'amount' => 0.045,
'currency' => 'USD',
'valid_from' => '2026-12-01'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bbrands.io/api/v3/notification/rate"
payload := strings.NewReader("{\n \"channel\": \"sms\",\n \"provider\": \"onesignal\",\n \"country\": \"CL\",\n \"unit\": \"segment\",\n \"amount\": 0.045,\n \"currency\": \"USD\",\n \"valid_from\": \"2026-12-01\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bbrands.io/api/v3/notification/rate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": \"sms\",\n \"provider\": \"onesignal\",\n \"country\": \"CL\",\n \"unit\": \"segment\",\n \"amount\": 0.045,\n \"currency\": \"USD\",\n \"valid_from\": \"2026-12-01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bbrands.io/api/v3/notification/rate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel\": \"sms\",\n \"provider\": \"onesignal\",\n \"country\": \"CL\",\n \"unit\": \"segment\",\n \"amount\": 0.045,\n \"currency\": \"USD\",\n \"valid_from\": \"2026-12-01\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "email",
"provider": "horizon",
"country": "<string>",
"unit": "message",
"amount": 123,
"currency": "USD",
"valid_from": "2023-11-07T05:31:56Z",
"change_reason": "<string>",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
},
"message": "<string>",
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "UNPROCESSABLE_ENTITY",
"errors": [
{
"code": "change-reason-required",
"field": "change_reason",
"message": "change_reason is required"
}
],
"message": "Unprocessable Entity"
}
}Authorizations
bearerAuthapiKeyAuth
Body
application/json
Was this page helpful?