---
title: Request Access Token - API NICEPAY Inquiry Virtual Account SNAP
slug: en/nicepay-api-snap-request-access-token-nicepay-inquiry-virtual-account
description: Information about Request Access Token - API NICEPAY Inquiry Virtual Account SNAP available on the NICEPAY system
image: https://archbee-image-uploads.s3.amazonaws.com/ZHvSjR5ZrsoxwKbJa3xmo/NY9lA2VBh9gnUo8BMOrzp_microsoftteams-image.png
icon: {"faIcon":"fa-solid fa-book"}
docTags: 
createdAt: 2025-06-09T08:33:52.973Z
---

# About Request Access Token - API NICEPAY Inquiry Virtual Account SNAP

***

This API with SNAP standards contains information uses on the Virtual Account payment method with the NICEPAY Inquiry Virtual Account (NIVA) feature for requesting a token to process the transaction.

# Request Access Token - API NICEPAY Inquiry Virtual Account SNAP

***

:::hint{type="warning"}
Before proceeding the integration process, Merchant needs to send the base URL (Merchant Domain) to NICEPAY's Integration Team through email ([integration@nicepay.co.id](mailto\:integration@nicepay.co.id)) so that Merchant can access the NIVA API.

After receiving the base URL, NICEPAY will provides the Merchant with a Public Key, so the Merchant can immediately proceed with the integration process.
:::

## Get Access Token

NICEPAY will generate an `access_token` for theMerchant through the API. The provided `access_token` will follow the Merchant's format and expires after 15 minutes.

| **API Endpoint** | `https://[merchant-domain]/api/v.1.0/access-token/b2b` |
| ---------------- | ------------------------------------------------------ |
| **Method**       | `POST`                                                 |
| **Description**  | To request access token for NIVA transaction&#xD;      |
| **Content-type** | `application/json`                                     |



## Request Access Token Header Parameter

| **Parameter**  | **Type** | **Required** | **Description**                   | **Example**                                                                                                                                                                                         |
| -------------- | -------- | ------------ | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Content-Type` | String   | Mandatory    | String Media Type of the Resource | `application/json`                                                                                                                                                                                  |
| `X-TIMESTAMP`  | String   | Mandatory    | NICEPAY Timezone                  | `YYYY-MM-DDTHH:MM:SS`<br />(2024-01-22T15:00:01+07:00)                                                                                                                                              |
| `X-CLIENT KEY` | String   | Mandatory    | Merchant ID                       | IONPAYTEST                                                                                                                                                                                          |
| `X-SIGNATURE`  | String   | Mandatory    | NICEPAY Signature                 | Generated by Partner/Merchant <br />created using asymmetric<br />signature SHA256withRSA algorithm<br />(`Private_Key`, `stringToSign`)<br />`stringToSign `= `client ID` + “`\|`” + `X-TIMESTAMP` |



## Request Access Token Body Parameter&#x20;

| **Parameter**    | **Type** | **Length** | **Required** | **Description** |
| ---------------- | -------- | ---------- | ------------ | --------------- |
| `grantType`&#xD; | String   | 8          | Mandatory    | Customer Name   |
| `additionalInfo` | String   | 17         | Mandatory    | Goods/Item Name |



## Request Access Token Response Parameter

| **Parameter**     | **Type** | **Length** | **Required** | **Description**          |
| ----------------- | -------- | ---------- | ------------ | ------------------------ |
| `responseCode`    | String   | 5          | Mandatory    | Response Code            |
| `responseMessage` | String   | 100        | Mandatory    | Response Message         |
| `accessToken`     | String   | 150        | Mandatory    | Access Token             |
| `tokenType`       | String   | 8          | Mandatory    | Type Token               |
| `expiresIn`       | String   | 17         | Mandatory    | Session Expiry in Second |
| `additionalInfo`  | String   | 17         | Mandatory    | Additional Information   |



## Sample Parameter

:::CodeblockTabs
JSON Request

```json
{
 "grantType": "client_credentials",
 "additionalInfo": {}
}
```

JSON Response

```json
{
 "responseCode": "2007300",
 "responseMessage": "Successful",
 "accessToken": "Xy8duZzAvv9bwDXxRxcb89tsuvk4MF4kx4lGfE4aCRVxR7XdERhbe1",
 "tokenType": "Bearer",
 "expiresIn": "900",
 "additionalInfo": {}
}
```
:::

