Create New API Key and Secret
POST https://api-sandbox.letpay.io/access-key
This endpoint is used to create a new API key and secret.
The first pair of API keys must be generated by the main admin on the merchant dashboard. Access merchant/API Keys
Authorization
Header | Value |
---|---|
X-Auth-Token | MY_ACCESS_TOKEN |
Request Body
None
Response Body
The response will contain the newly generated API key and secret in the following format:
json
{
"api_key": "********",
"api_secret": "********"
}
Example Request
- 200 - Success
- 401 - Unauthorized
Example Request
200 - Authenticated
curl --location --request POST 'https://api-sandbox.letpay.io/access-key' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN'
Example Response
Header
Content-Type: application/json
Body
{
"api_key": "MY_API_KEY",
"api_secret": "MY_API_SECRET"
}
Example Request
401 - Unauthorized
curl --location 'https://api-sandbox.letpay.io/auth' \
--header 'X-Auth-Token: INVALID_ACCESS_TOKEN'
Example Response
Header
Content-Type: application/json
Body
{
"timestamp": "2024-01-15T19:23:27.248+0000",
"status": 401,
"error": "Unauthorized",
"message": "Access Denied",
"path": "/access-key"
}