Access Token B2B & B2B2C - Account Binding API E-Wallet (Direct Debit) SNAP
About Access Token B2B & B2B2C - Account Binding API E-Wallet (Direct Debit) SNAP
This part contains detail information related to API access token needs with SNAP standardization used to proceed the process related to B2B and B2B2C.
Access Token B2B - Account Binding API E-Wallet (Direct Debit) SNAP
Visit the Account Binding - API E-Wallet (Direct Debit) SNAP page to know the flow how to obtain an access token during the account binding process.
Access Token B2B used by the Merchant to initiate transaction process with NICEPAY system.
Service Code | 73 |
|---|---|
API Endpoint | /nicepay/v1.0/access-token/b2b |
Method | POST |
Description | Get Access Token B2B Specification |

Request Header Parameter for Access Token B2B - Account Binding API E-Wallet (Direct Debit) SNAP
Parameter | Type | Length | Mandatory | Description |
|---|---|---|---|---|
Content-Type | String | Variable | Mandatory | Application/Json |
X-TIMESTAMP | String | Variable | Mandatory | yyyy-MM-ddTHH:mm:ss.SSSTZD (2022-03-21T10š40+07:00) |
X-CLIENT-KEY | String | Variable | Mandatory | NICEPAY Credential Client ID |
X-SIGNATURE | String | Variable | Mandatory | X-SIGNATURE: created using asymmetric signature SHA256withRSA algorithm (Private_Key, stringToSign) stringToSign = client ID + ā|ā + X-TIMESTAMP |

Request Body Parameter for Access Token B2B - Account Binding API E-Wallet (Direct Debit) SNAP
Parameter | Type | Length | Mandatory | Description |
|---|---|---|---|---|
grantType | String | Variable | Mandatory | Grant Type Value: āclient_credentialsā |
additionalInfo | JSON Object | Variable | Mandatory | Additional Information |

Response Header Parameter for Access Token B2B - Account Binding API E-Wallet (Direct Debit) SNAP
Parameter | Type | Length | Mandatory | Description |
|---|---|---|---|---|
Content-Type | String | Variable | Mandatory | Content type, value always application/json |
X-TIMESTAMP | String | Variable | Mandatory | Transaction date time, in format YYYY-MMDDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time) |

Response Body Parameter for Access Token B2B - Account Binding API E-Wallet (Direct Debit) SNAP
Parameter | Type | Length | Mandatory | Description |
|---|---|---|---|---|
responseCode | String | Variable | Mandatory | Refer to response code list |
responseMessage | String | Variable | Mandatory | Debug message to provide more information |
accessToken | String | 2048 | Mandatory | Token Authorization that NICEPAY used for Shopee Pay API Services |
tokenType | String | Variable | Mandatory | Token Type Value: āBearerā |
expiresIn | String | 3 | Mandatory | Token Validate Time |

Sample Parameter for Access Token B2B - Account Binding API E-Wallet (Direct Debit) SNAP
Request Parameter
Response Parameter
{
"responseCode": "2007300",
"responseMessage": "Successful",
"accessToken": "Xy8duZzAvv9bwDXxRxcb89tsuvk4MF4kx4lGfE4aCRVxR7XdERhbe1",
"tokenType": "Bearer",
"expiresIn": "900"
}
Access Token B2B2C - Account Binding API E-Wallet (Direct Debit) SNAP
Access Token B2B2C used by the Merchant to initiate the Customer transaction process using a linked account with NICEPAY system.
Service Code | 74 |
|---|---|
API Endpoint | /nicepay/api/v1.0/access-token/b2b2c |
Method | POST |
Description | Get Access Token B2B2C Specification |

Request Header Parameter for Access Token B2B2C - Account Binding API E-Wallet (Direct Debit) SNAP
Parameter | Type | Length | Mandatory | Description |
|---|---|---|---|---|
Content-Type | String | Variable | Mandatory | Application/Json |
X-TIMESTAMP | String | Variable | Mandatory | yyyy-MM-ddTHH:mm:ss.SSSTZD (2022-03-21T10š40+07:00) |
X-CLIENT-KEY | String | Variable | Mandatory | NICEPAY Credential Client ID |
X-SIGNATURE | String | Variable | Mandatory | X-SIGNATURE: created using asymmetric signature SHA256withRSA algorithm (Private_Key, stringToSign) stringToSign = client ID + ā|ā + X-TIMESTAMP |

Request Body Parameter for Access Token B2B2C - Account Binding API E-Wallet (Direct Debit) SNAP
Parameter | Type | Length | Mandatory | Description |
|---|---|---|---|---|
grantType | String | 32 | Mandatory | Apply token request key type, can be AUTHORIZATION_CODE or REFRESH_TOKEN |
authCode | String | 256 | Conditional | The authorization code received after the User provides the consent. Mandatory if grantType = AUTHORIZATION_CODE |
refreshToken | String | 512 | Conditional | Refresh token to get a new accessToken where the User doesn't need to provide the consent again. Mandatory if grantType = REFRESH_TOKEN. Refresh Token should be less than access token validity and will be manage by the PJPās application to generate a new access_token. |
additionalInfo | JSON Object | Variable | Mandatory | Additional information |
partnerReferenceNo | String | 40 | Mandatory | Merchant transaction identifier from NICEPAY |
mitraCd | String | 4 | Mandatory | NICEPAY Mitra Code AstraPay : ASTR AlloBank : ALLO |

Response Header Parameter for Access Token B2B2C - Account Binding API E-Wallet (Direct Debit) SNAP
Parameter | Type | Length | Mandatory | Description |
|---|---|---|---|---|
Content-Type | String | Variable | Mandatory | Content type, value always application/json |
X-TIMESTAMP | String | Variable | Mandatory | Transaction date time, in format YYYY-MMDDTHH:mm:ss+07:00. Time must be in GMT+7 (Jakarta time) |

Response Body Parameter for Access Token B2B2C - Account Binding API E-Wallet (Direct Debit) SNAP
Parameter | Type | Length | Mandatory | Description |
|---|---|---|---|---|
responseCode | String | 7 | Mandatory | Refer to response code list |
responseMessage | String | 40 | Mandatory | Debug message to provide more information |
accessToken | String | 50 | Mandatory | Authorization in the form of a string given to the user and used to access protected resources |
tokenType | String | 50 | Mandatory | Bearer Token |
accessTokenExpiryTime | String | 50 | Mandatory | Access token valid time will be 15 days format ISO8601 |
refreshToken | String | 50 | Mandatory | Random string used by the user to get a new accessToken to access user data by format UUID |
refreshTokenExpiryTime | String | 50 | Mandatory | Time for the refreshToken to expire |
additionalInfo | JSON Object | Variable | Mandatory | Additional information |
partnerReferenceNo | String | 40 | Mandatory | Merchant transaction identifier from NICEPAY |
referenceNo | String | 40 | Mandatory | NICEPAY Transaction ID |
mitraCd | String | 4 | Mandatory | NICEPAY Mitra Code AstraPay : ASTR Allo Bank : ALLO |

Sample Parameter for Access Token B2B2C - Account Binding API E-Wallet (Direct Debit) SNAP
Request Parameter
curl -X POST \
'https://dev.nicepay.co.id/nicepay/v1.0/access-token/b2bc' \
-H 'Content-Type: application/json' \
-H 'X-SIGNATURE: aFHq5SNdWO5Pq2vwZk4ztd9Cu3OvblG6NezGwLX3GC2mRJorDHPeZpR3V+RXrPC8ojcyCwQy01FSipmA8YdQvz1hOth7aekXzhigYCRNS34EHYEoFGD1YMHVFRvxn2Fu8HAd6wTvPNy2X2rbUS3hWrJsfa5cHu8wKVb7zPCuxNc=' \
-H 'X-CLIENT-KEY: IONPAYTEST' \
-H 'X-TIMESTAMP: 2024-01-31T10:11:40+07:00' \
-d '{"grantType":"AUTHORIZATION_CODE","authCode":"3p8Uuq0dkDBPagBvbFIo1QodNzZaJJXXITpL9mFRsWAS","refreshToken":"3911773a-d3ac-4b4f-8a6c-406c21d6883d","additionalInfo":{"partnerReferenceNo":"202208121451526358","mitraCd":"ASTR"}}'Response Parameter
{
"grantType": "AUTHORIZATION_CODE",
"authCode": "3p8Uuq0dkDBPagBvbFIo1QodNzZaJJXXITpL9mFRsWAS",
"refreshToken": "3911773a-d3ac-4b4f-8a6c-406c21d6883d",
"additionalInfo": {
"partnerReferenceNo": "202208121451526358",
"mitraCd": "ASTR"
}
}