Skip to main content

Get Access Token

https://api-sandbox.letpay.io/auth

Auth Request

Requests a new refreshed access token to be used on every authenticated endpoint. Each token is configured to expire after 5 minutes.

Request Body

  • Type: form-data

Response

The response for this request can be documented as a JSON schema:

json
{
"type": "object",
"properties": {
"token": { "type": "string" },
"user": {
"type": "object",
"properties": {
"id": { "type": "string" },
"username": { "type": "string" },
"name": { "type": "string" },
"enable": { "type": "boolean" },
"open": { "type": "boolean" },
"role": { "type": "string" },
"merchant_id": { "type": "string" }
}
},
"version": { "type": "string" }
}
}

Body - formdata

API Key & SecretDescription
apiKeyMY_API_KEY
A key that can be used to authenticate
apiSecretMY_API_SECRET
A secret that can be used to authenticate

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,
"role": "USER",
"merchant_id": "acb14525-577b-46b5-b40f-861d78341ce2"
},
"version": "0.5.21"
}