Access Token B2B2C

B2B2C Access Token is a service used to obtain access tokens in the Business-to-Business-to-Consumer (B2B2C) model. By using the B2B2C token, access to services or customer data can be carried out securely and efficiently while ensuring consumer data confidentiality.
Type Value
Service Code
74
Name
API Access Token B2B2C
HTTP Method
POST

Flow

You send the required parameters to make a request, and Espay will respond in JSON format.

API URL

Environment URL
Sandbox
Port of HTTPS (443)
https://sandbox-api.espay.id/apidirectdebit/v1.0/access-token/b2b2c
Production
Port of HTTPS (443)
https://api.espay.id/apidirectdebit/v1.0/access-token/b2b2c

Headers

Name Type Mandatory Description
Content-Type
String
Y
Content of your request body.

Example:
application/json
X-TIMESTAMP
String
Y
Customer's current local date and time.

Format:
yyyy-MM-ddThh:mi:ssTZD (ISO 8601)

Example:
2024-03-14T07:49:28+07:00
X-CLIENT-KEY
String
Y
Client Key from Espay team.
X-SIGNATURE
String
Y
Code used to validate transactions. Learn Signature Asymmetric
Y: Yes, O: Optional, C: Conditional

Request Parameters

Parameter Type Mandatory Description
grantType
String (64)
Y
Token request type.

Format:
  • AUTHORIZATION_CODE
  • REFRESH_TOKEN
authCode
String (64)
C
accountToken from Account Binding service. Mandatory if grantType = AUTHORIZATION_Code

Learn Account Binding
additionalInfo
Object
  productCode
String (16)
Y
Product code. Click here

Example:
SALDOMUDIRECTDEBIT
Y: Yes, O: Optional, C: Conditional

Response Parameters

Parameter Type Mandatory Description
responseCode
String (7)
Y
Response Code.

Format:
HTTP Code + Service Code + Error Code

Example:
200+74+00 = 2000400.
responseMessage
String (150)
Y
Response description.
tokenType
String (64)
Y
Token type.

Format:
  • Bearer
  • Mac
accessToken
String (128)
Y
Access token.
accessTokenExpiryTime
String (25)
Y
Access token expiration time.
refreshToken
String (128)
C
Refresh token.
refreshTokenExpiryTime
String (25)
O
Refresh token expiration time.
Y: Yes, O: Optional, C: Conditional

Try It!

Anda bisa coba masukkan data sesuai dengan input yang telah disediakan. Setelah itu Anda submit dan lihat hasilnya!

Request

Value

Response































Sample Headers

Content-Type: application/json
X-TIMESTAMP:2024-03-14T07:49:28+07:00
X-SIGNATURE:jaCUbDOSIjFcDaZ1rO0aCczJrWSfV0wAXVi/zOLlOLOIVH00gucOSOnHpKTARwpnn6qB08Vi8VJviNhIQh1q6zVJAwdhxnHRlwNFa28IVFTtSmD4nXPWT3LsuYuFPNDGJ59/MgKMVjwIofYvq2dwOHoDi9rnyT3nPl7N2bRdIQceQlD6sITcqdEbRUlm+zTFB2MxNy4vFaEZz1LU8fsENp+giMNqxR26DsNcRj1K8JBXO6nY8q2m3jmTmiduXK5VZXxt/5v6bp+OlYCwJhn3hmdZD1zwC3Hu6qZcCIhO6IVe0ThSCfsaCdye9o/Ew6VdMWbTtQUoR983mq6MubLmzg==
X-EXTERNAL-ID:d3be5aec-155b-4b46-bfee-3fd55363d0f4
X-PARTNER-ID:SGWYESSISHOP
CHANNEL-ID:ESPAY
             















Sample Request

{
    "grantType":"AUTHORIZATION_CODE",
    "authCode":"ESP2412170203585gErmF5ax0RvyV5mN", 
    "additionalInfo":{
        "productCode":"SALDOMUDIRECTDEBIT"
        }
}
             














Sample Response

{
    "responseCode": "2007400",
    "responseMessage": "Successful",
    "tokenType": "Bearer",
    "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwaG9uZV9udW1iZXIiOiI2Mjg1MTU2NTAzMDY1IiwicGFydG5lcl9jb2RlIjoic2FtcGxlLWNsaWVudC1pZCIsInN1Yl9tZXJjaGFudGlkIjoiUEVUVFlDQVNIIiwidG9rZW5fdHlwZSI6IkFMTF9UWVBFIiwiZXhwIjoxODkyMTg2NDI0fQ.XN-nTDvpO6ojwrTsXlM64ZrTHC9ecIeFtjuutcYRuvo",
    "accessTokenExpiryTime": "2029-12-17T07:20:24+00:00",
    "refreshToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwaG9uZV9udW1iZXIiOiI2Mjg1MTU2NTAzMDY1IiwicGFydG5lcl9jb2RlIjoic2FtcGxlLWNsaWVudC1pZCIsInRva2VuX3R5cGUiOiJBTExfVFlQRSIsImV4cCI6MTg5MjYxODQyNH0.ktp4uGWMboYCm_WTtGDRYhZ5S2wIZudtowf1QplhGl4",
    "refreshTokenExpiryTime": "2029-12-22T07:20:24+00:00"
}

              




CURL


......    





Scroll to Top