Authentication
Pix's APIs are based on the OAuth 2 protocol, specifically, with client_credentials flow.
To get started, go to First Steps and register the Direct Pix APIs you want to use.
Generate API access key
To make requests to the Pix APIs, it is necessary to generate an access key (access_token) through a request on the token generation endpoint Gerando Access Tokens.
The validity of the access key is obtained from the expires_in object, in seconds.
It is necessary for the partner to manage the access key to ensure that all requests to the Pix APIs will be made using a valid key.
Generate token
To generate the token, follow the instructions:
- With the API Key, API Secret and Scope prepare an HTTP POST request to the endpoint Gerando Access Tokens.;
- In Body, use the values retrieved from the application to fill in the parameters below:
client_id
with the value of client_id;client_secret
with value of client_secret;scope
with a value equal to the scope obtained from the credentials;grant_type
with value equal toclient_credentials
;
- Make the request and obtain the access_token.
Note:
The access_token obtained when generating the token must be used in other Pix API requests.
Updated about 1 year ago