Introduction
Getting Started with B2Brouter API
Environments
B2Brouter has two environments:
- Production environment (https://app.b2brouter.net)
- Staging environment (https://app-staging.b2brouter.net)
For testing, it is recommended to always use the staging environment.
First steps with the staging environment
Register and configure your account
To start using the B2Brouter API, you first need to register and create an account on B2Brouter. You can register from this link, and detailed instructions are available here.
Once registered, log in to B2Brouter and set up your account with a Basic plan. You can find detailed instructions on how to do this here.
Staging Environment Activation
When an account is created in the staging environment with a Basic plan, it comes with limited permissions. To fully test the integration features, please submit a support ticket requesting permissions for your staging account. Our team will grant the necessary access.
Using the REST API
To access the B2Brouter API, follow these steps:
- Access your account.
- Within your account, click on the tab Developers.
- Use the Show API Key option to obtain your API key.
- To find the accounts IDs, click on View IDs for each account or click on the Edit group icon next to your group name.
- Access to the API Reference.
Note:
Keep in mind that the API key is not the same for different environments (production or staging). If you want to connect to the production environment, you must obtain the API key by accessing your account in the production environment.
If you want to connect to the staging environment, you must obtain the API key by accessing your account in the staging environment.
For default the API Reference is documented with the staging environment, to change the environment open the Base URL dropdown.
Authentication
The credentials must be provided in the request headers, with the name X-B2B-API-KEY.
Response Formats
We provide the response in two different formats:
- XML (.xml)
- JSON (.json)
You can choose it on the path parameters of each request.
Account Identifiers
Use the List Accounts endpoint
curl --request GET \
--url 'https://app.b2brouter.net/projects.json' \
--header 'X-B2B-API-Key: xxxxxxxxxxx' \
--header 'accept: application/json'
In this response, pay attention to the information in the identifier field. You should use this ID when you want to interact with the project through the API.
Note:
You can also find the accounts IDs in the Developers tab by clicking the Edit group icon next to your group name. The list of accounts and their IDs will be displayed.
API Rate Limiting
To ensure optimal performance and fair usage, B2Brouter API enforces rate limits on incoming requests:
Rate Limits:
- Production: 1,000 requests per minute
- Staging: 600 requests per minute
Rate Limit Exceeded:
When you exceed the rate limit, the API returns:
- HTTP status code
429 Too Many Requests
Best Practices:
- Implement exponential backoff when receiving 429 responses
- Cache responses when possible to reduce API calls
- Use webhooks instead of polling for real-time updates
Download the OpenAPI Reference
You can download the full REST API reference in OpenAPI (YAML) format from the following link.
Updated about 20 hours ago