Get Access Token
POST https://api-sandbox.letpay.io/auth
Requests a new refreshed access token to be used on every authenticated endpoint. Each token is configured to expire after 5 minutes.
Authorization
Header | Value |
---|---|
X-Auth-Token | MY_ACCESS_TOKEN |
Request Body
- Type: form-data
apiKey
: A key that can be used to authenticateapiSecret
: A secret that can be used to authenticate
Response Body
- 200 - Authenticated
- 401 - Unauthorized
Example Request
200 - Authenticated
curl --location 'https://api-sandbox.letpay.io/auth' \
--form 'apiKey="MY_API_KEY"' \
--form 'apiSecret="MY_API_SECRET"'
Example Response
Header
Content-Type: application/json
Body
{
"token": "MY_ACCESS_TOKEN",
"user": {
"id": "acb14525-577b-46b5-b40f-861d78341ce2",
"username": "MY_USERNAME",
"name": "MY_NAME",
"enable": true,
"open": true,
"roles": ["MERCHANT_ADMIN"],
"merchant_id": "acb14525-577b-46b5-b40f-861d78341ce2"
},
"version": "0.5.21"
}
Example Request
401 - Unauthorized
curl --location 'https://api-sandbox.letpay.io/auth' \
--form 'apiKey="INVALID_API_KEY"' \
--form 'apiSecret="INVALID_API_SECRET"'
Example Response
Header
Content-Type: application/json
Body
{
"timestamp": "2024-01-15T19:23:27.248+0000",
"status": 401,
"error": "Unauthorized",
"message": "Access Denied",
"path": "/auth"
}