Token creation service
Consuming the token generation service is mandatory for creating or editing a merchant. As a result from this operation, the virtual store will obtain a token on their authenticity URL, which will be necessary for the next step of the flow.
#
Call details- Resource:
/v1/token/merchants
- HTTP Method:
POST
- Response format:
JSON
- Header parameters:
Parameter | Description | Format | Mandatory |
---|---|---|---|
merchant_id | Merchant code on Carat Portal. The production and certification codes will be different. | < 15 AN | YES |
merchant_key | Merchant authentication key on Carat Portal. The production and certification keys will be different. | < 80 AN | YES |
#
ExampleRequest:
To use this example, don't forget to define the variable {{url}}
with the value
esitef-homologacao.softwareexpress.com.br
Authenticity POST:
To use this example, don't forget to define the variable {{url}}
with the value
esitef-homologacao.softwareexpress.com.br
Response:
Response codes
See reference on API codes - response codes
#
Authenticity POST parametersThe table below describes the parameters sent by Carat Portal on the authenticity POST:
Parameter | Description | Format |
---|---|---|
token | Token to be sent in the next step of the flow. | = 66 AN |
Carat Portal can also send new parameters without previous warning, which means that the merchant's application must be prepared to receive additional fields and simply ignore them.
Attention: It's essential that the site hosted on the merchant's Authenticity URL receives the token and responds with
HTTP 200
, as this is how Carat Portal considers it a successful POST.
#
Response parametersIf successful, the HTTP response code will be 200
. Any other code must be interpreted as an error. The table below describes the response parameters of the token creation service:
Parameter | Description | Format |
---|---|---|
response_code | Carat Portal response code. Any code different from 0 (zero) means failure. Learn more. | < 4 N |
response_message | Carat Portal response message. | < 500 AN |