2. Create the access token
1. Concatenate the ClientId
and ClientSecret
, ClientId:ClientSecret
ClientId
and ClientSecret
, ClientId:ClientSecret
Example: dba3a8db-fa54-40e0-8bab-7bfb9b6f2e2e:D/ilRsfoqHlSUChwAMnlyKdDNd7FMsM7cU/vo02REag
2. Encode the result in Base64;
3. Request the token creation using the HTTP POST method.
Environment | Endpoint | Authorization |
---|---|---|
Sandbox | https://mpisandbox.braspag.com.br | Basic (Authorization) The Authorization must be generated concatenating "ClientID", colon character (":") and "ClientSecret" Ex. dba3a8db-fa54-40e0-8bab-7bfb9b6f2e2e:D/ilRsfoqHlSUChwAMnlyKdDNd7FMsM7cU/vo02REag= after this, encode the result in base 64. Then, this will generate an alphanumeric code that will be used in the access token request. For test purposes, use the following data: ClientID: dba3a8db-fa54-40e0-8bab-7bfb9b6f2e2e ClientSecret: D/ilRsfoqHlSUChwAMnlyKdDNd7FMsM7cU/vo02REag= |
Production | https://mpi.braspag.com.br | After integrating on sandbox environment, get your production ClientId and ClientSecret credentials in Cielo website, tab Credenciais. |
Request
Environment | Method | Endpoint |
---|---|---|
Sandbox | post | https://mpisandbox.braspag.com.br/v2/auth/token |
Produção | post | https://mpi.braspag.com.br/v2/auth/token |
{
"EstablishmentCode": "1006993069",
"MerchantName": "Loja Exemplo Ltda",
"MCC": "5912"
}
curl
--request POST "https://mpisandbox.braspag.com.br/v2/auth/token"
--header "Content-Type: application/json"
--header "Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
--data-binary
--verbose
{
"EstablishmentCode":"1006993069",
"MerchantName": "Loja Exemplo Ltda",
"MCC": "5912"
}
Header parameters
Parameter | Description | Type | Size |
---|---|---|---|
EstablishmentCode | Cielo E-commerce 3.0 affiliation code | Numeric | 10 |
MerchantName | Merchant Name as registered on Cielo | Alphanumeric | Max 25 |
MCC | Merchant category code | Numeric | 4 |
Body parameters
Parameter | Description | Type | Size |
---|---|---|---|
EstablishmentCode | Cielo E-commerce 3.0 affiliation code | Numeric | 10 |
MerchantName | Merchant Name as registered on Cielo | Alphanumeric | Max 25 |
MCC | Merchant category code | Numeric | 4 |
Response
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjbGllbnRfbmFtZSI6IlFBXzNEU19BdXRoZW50aWNhdG9yIiwiY2xpZW50X2lkIjoiZGJhM2E4ZGItZmE1NC00MGUwLThiYWItN2JmYjliNmYyZTJlIiwic2NvcGVzIjoie1wiU2NvcGVcIjpcIjNEU0F1dGhlbnRpY2F0b3JcIixcIkNsYWltc1wiOlt7XCJOYW1lXCI6XCJNZXJjaGFudE5hbWVcIixcIlZhbHVlc1wiOFwiVmFsdWVzXCI6W1wiNTU1NVwiXX0se1wiTmFtZVwiOlwiUmVmZXJlbmNlSWRcIixcIlZhbHVlc1wiOltcImY3MjE1YmQ3LWM0OTQtNGQ5Yi1NzEyfQ.daMqXko3dZOV0TzNFQ2vSsVSKqOsrwuswg7RB82ecAASSSSSSSSSSSSFFFFFFFFFFFFFGGGGGGGGGGGGGGGGGGGGGGGG",
"token_type": "barear",
"expires_in": "2018-07-23T11:29:32"
}
--header "Content-Type: application/json"
--data-binary
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjbGllbnRfbmFtZSI6IlFBXzNEU19BdXRoZW50aWNhdG9yIiwiY2xpZW50X2lkIjoiZGJhM2E4ZGItZmE1NC00MGUwLThiYWItN2JmYjliNmYyZTJlIiwic2NvcGVzIjoie1wiU2NvcGVcIjpcIjNEU0F1dGhlbnRpY2F0b3JcIixcIkNsYWltc1wiOlt7XCJOYW1lXCI6XCJNZXJjaGFudE5hbWVcIixcIlZhbHVlc1wiOFwiVmFsdWVzXCI6W1wiNTU1NVwiXX0se1wiTmFtZVwiOlwiUmVmZXJlbmNlSWRcIixcIlZhbHVlc1wiOltcImY3MjE1YmQ3LWM0OTQtNGQ5Yi1NzEyfQ.daMqXko3dZOV0TzNFQ2vSsVSKqOsrwuswg7RB82ecAASSSSSSSSSSSSFFFFFFFFFFFFFGGGGGGGGGGGGGGGGGGGGGGGG",
"token_type": "barear",
"expires_in": "2018-07-23T11:29:32"
}
Parameter | Description | Type |
---|---|---|
access_token | Token required to continue with authentication | Alphanumeric |
token_type | Fixed "Bearer" | Alphanumeric |
expires_in | Token expiration time (minutes) | Numeric |
The
access_token
created at this step should be parameterized in Class mapping in fieldbpmpi_accesstoken
.
Updated 13 days ago
What's next