v1

latestOpenAPI 3.1.02026-07-26500375.1 KB

Generate Access Token (B2B) API

The following endpoint generate access token for SNAP transaction APIs

post/access-token/b2b

Headers

Content-Typestring required

Indicates the media type of the resource. value: application/json

X-TIMESTAMPstring required

Timestamp in ISO8601 format, Example: 2024-05-14T18:54:57+07:00

X-SIGNATUREstring required

Signature generated by encrypting HTTP method, relative path, access token, minified request body, and timestamp

X-CLIENT-KEYstring required

Client Key given by Durianpay upon completing registration.

Request body

grantTypestring required

Value: AUTHORIZATION_CODE

Response

200

responseCodestring
responseMessagestring
accessTokenstring
tokenTypestring
expiresInstring

Example response

{
  "responseCode": "2007300",
  "responseMessage": "Successful",
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJEdXJpYW4gTW9uZXkiLCJleHAiOjE3MTU1OTAwNTYsImlhdCI6MTcxNTU4OTE1NiwibWVyY2",
  "tokenType": "BearerToken",
  "expiresIn": "2024-05-13 08:47:36.452492159 +0000 UTC"
}