Skip to content
Log in

Introduction

B2Brouter has three environments — see Environments for a full comparison.

EnvironmentBase URLWhen to use
Sandboxhttps://api.b2brouter.net (key prefix test_)Daily development, payload validation, onboarding
Staginghttps://api-staging.b2brouter.netLarge integrations, broad end-to-end tests, authority QA environments
Productionhttps://api.b2brouter.netLive traffic

Start with Sandbox. It is the recommended environment for initial development and day-to-day testing. Use staging only for large-scale integrations or broad end-to-end tests that require a full environment setup.

To start using the B2Brouter API, register at app.b2brouter.net/en/register. Detailed setup instructions are available here.

Once registered, log in to B2Brouter and set up your account with a Basic plan. You can find detailed instructions here.

Open the Developers section and create a sandbox. Your sandbox API key starts with test_ and routes all requests to the sandbox environment automatically — no separate URL needed. See Sandbox for full setup instructions.

If you need the staging environment (large integrations, broad end-to-end tests), register at app-staging.b2brouter.net/en/register. Staging accounts start with limited permissions — submit a support ticket to request the necessary access. Our team will grant it.

To access the B2Brouter API, follow these steps:

  1. Access your account.
  2. Within your account, click on the Developers tab.
  3. Click on the API key to copy it to the clipboard.
  4. To find the accounts IDs, click on View IDs for each account or click on the Edit group icon next to your group name.
  5. Access to the API Reference.

Note: API keys are environment-specific. Sandbox keys (prefix test_) only work in sandbox; production keys only work in production; staging keys only work in staging. Obtain each key by logging in to the corresponding environment.

By default, the API Reference is documented with the staging environment. To switch to sandbox or production, open the Base URL dropdown.

The credentials must be provided in the request headers, with the name X-B2B-API-Key.

In B2Brouter each group has a default API Version. You can check it in the Developers tab, under API Keys. You can manually specify the API Version in the request headers, with the name X-B2B-API-Version. If no version is specified, B2Brouter will use the default version of the group.

B2Brouter only provides the response in JSON format.

Use the List Accounts endpoint

Terminal window
curl --request GET \
--url https://api-staging.b2brouter.net/accounts \
--header 'X-B2B-API-Key: {YOUR_API_KEY}' \
--header 'X-B2B-API-Version: {YOUR_API_VERSION}' \
--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 account 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.

To ensure optimal performance and fair usage, B2Brouter API enforces rate limits on incoming requests:

Rate Limits:

  • Production: 1,000 requests per minute
  • Sandbox / 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

You can integrate with the API directly over HTTP or by using an official SDK. The first official SDK is the PHP SDK:

It provides methods for complete invoice management, multi-format documents downloads, complete tax reports operations (including Verifactu), pagination utilities, and error handling. Additional SDKs for other programming languages will be added over time.

You can download the full REST API reference in OpenAPI (YAML) format from the following links: