Skip to main content

General Definitions

Security​

HTTPS​

All BTG Pactual Empresas API endpoints use the HTTPS protocol.

OAuth 2​

The BTG Empresas APIs use the OpenID Connect authorization protocol, based on OAuth 2.0, which lets third-party applications access the client's resources. To learn more, go here.

📘 BTG Id

The BTG Empresas Authorization Server is called BTG Id. Using BTG Id, a partner application obtains consent and authorization to perform operations on the BTG APIs on the client's behalf.

Response Codes​

The BTG Pactual Empresas APIs use conventional HTTP response codes to indicate the status of requests.

  • 2XX codes: success.
  • 4XX codes: an error in the parameters the client sent to the API. This class of errors usually requires adjusting the requests.
  • 5XX codes: an error on the BTG Empresas servers.
Status CodeDefinition
200 - OKSuccessful request.
201 - CreatedResource created. This code always comes with the Location header containing the address of the created resource.
202 - AcceptedSuccessful asynchronous operation request.
400 - Bad RequestInvalid request. Usually happens due to invalid parameters being sent or missing data for the operation.
401 - UnauthorizedUnauthorized request. Usually happens due to errors related to token authentication.
403 - ForbiddenRequest authenticated successfully, but the token used does not have permission for the operation.
404 - Not FoundThe resource for the request does not exist.
409 - ConflictRequest conflicts with a previous request. This may be due to the use of the same idempotent key, or the resulting resource conflicts with an existing one.
429 - Too Many RequestsToo many requests by the same client in a short period of time.
500, 502, 503, 504 - Server ErrorsA problem on the BTG Empresas API servers. To learn more, visit the status page.

Conventions​

Requests to consume the BTG Empresas APIs must follow the date format YYYY-MM-DD and the currency format 000.01.