Skip to main content

Sandbox

The BTG PACTUAL EMPRESAS sandbox environment includes all the endpoints that exist in the production API, but all responses are predetermined and static. The environment is also connected to an authentication server dedicated to its operation.

APIs URIBTG Id URI
https://api.sandbox.empresas.btgpactual.comhttps://id.sandbox.btgpactual.com

Purpose​

The sandbox environment was designed with its main role being to validate the API contracts and the token generation flow. The environment is therefore mocked — in other words, it has static responses, validating the contracts and, on success, returning responses faithful to the production environment.

Collections, payments, and other entities are not actually created or stored, and there is no connection between the sandbox environment and the production environment. This provides the safety of never exposing your data in any way and offers unmatched stability.

When should I use the sandbox?​

  • When you want to check the behavior of the authorization and authentication flows, since it is connected to a dedicated BTG Id authentication server;
  • When you want to test the API contracts without exposing sensitive data in the early stages of development.

When should I not use the sandbox?​

  • When you want to test webhooks;
  • When you want to test the contracts with real data;
  • When you want to run a stress test.

Token and Requests​

Tokens generated in the sandbox environment allow consent to be given only to the company dedicated to the environment's operation.

Therefore, the companyId, accountId, and the other token claims will derive from this company. In this case, the company is 30306294000145 and this value:

  • Will replace your company's CNPJ wherever the companyId is required;
  • Will be part of the accountId obtained from the account listing endpoint;
  • Will appear in your token's claims instead of the CNPJ of any other company (when you paste the token into jwt.io you will see the claims).