Looking for ePay classic docs? Go to docs.epay.dk
ePay documentationDocsePay documentation
Partner

Request Merchant Access Token

OpenAPI Spec

Test this endpoint live

Open the same request directly in API Explorer.

Open in API Explorer

Server URL

POST
/public/api/v1/partner/accounts/{accountId}/access-token

To access the ePay API on behalf of a merchant under your partner profile, partners must create a access token for the merchant before sending requests. An access token expires after 8 hours.

Access token requests are cached in one hour, so any subsequent access token requests for the same merchant and environment may return the same token as previously requested, within the cache period.

The returned access token is used in-place of the merchant API key in the Authorization header.

Path Parameters

accountIdstring
Required
Format:
uuid

Header Parameters

Authorizationstring
Required

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

environmentstring
Required

The environment for which to create an access token. This can be either test or live. The created access token will only have access to the respective environment for the merchant account.

Possible values:
"test""live"
Example:
"live"

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/public/api/v1/partner/accounts/497f6eca-6276-4993-bfeb-53cbbbba6f08/access-token" \  -H "Authorization: string" \  -H "Content-Type: application/json" \  -d '{    "environment": "live"  }'
{  "expiresAt": "2030-07-29T15:51:28.071Z",  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0N..."}
{  "errorCode": "SERVER_ERROR",  "message": "An unexpected system error"}
{  "errorCode": "VALIDATION_ERROR",  "message": "Input validation errors",  "errors": {    "amount": [      "[required]: Is a required non-nullable field",      "[int]: Must be an integer",      "[min:0]: Must be greater than 0",      "[max:999999999]: Must be less than 999999999"    ]  }}
{  "errorCode": "SERVER_ERROR",  "message": "An unexpected system error"}