post https://sandbox.ecartpay.com/api/authorizations/token
You will need to create a token to make requests to Ecart Pay.
Create your token doing a post request using your public and private keys. You can find the keys in your account API Settings section. Once authorized you will receive a token which you will be able to use to make requests to Ecart Pay endpoints.
The new token has an expiration of 1 hour. So you should create a new token after 1 hour in order to avoid getting the Unauthorized error through the API.
Make sure you keep your token fully secure and delete the token when you don't need it anymore.
The response will have the following structure:
token
: A string representing the authorization token.
Example response:
{"token":"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxODliZTgwZGYyOTE1OTgyMjFhNWU5NSIsImlhdCI6MTcwNjAzNzYzNiwiZXhwIjoxNzA2MDQxMjM2fQ.J-bQwBP3HQEU4YodJw8dx0NuQ-Z2pgs1_GumL-FJHNy4PE9hBZW81BmH9ZwtEV2323xLHsov4YjqSe6hApQ"}