---
title: Request Access Token API - SNAP
slug: en/nicepay-api-snap-request-access-token
description: Information about Request Access Token API specific for SNAP provided by NICEPAY
image: https://archbee-image-uploads.s3.amazonaws.com/ZHvSjR5ZrsoxwKbJa3xmo/ISPusAHt9eVAxKDv5HYEW_rdrx9d8diazpgm07xfz2test-1.png
icon: {"faIcon":"fa-solid fa-fingerprint"}
docTags: 
createdAt: 2023-08-09T10:36:10.685Z
---

# About Request Access Token - SNAP

***

This part contains detail information related to access token API with SNAP standard uses on payment transactions, transaction status checking, and refund.



# Request Access Token API - SNAP

***

## Get Access Token

| **Service Code** | [API SNAP Service Code](docId:92feymrQs_iebHXrfgXUq)                                         |
| ---------------- | -------------------------------------------------------------------------------------------- |
| **API Endpoint** | [`/nicepay/v1.0/access-token/b2b`](https://dev.nicepay.co.id/nicepay/v1.0/access-token/b2b)  |
| **HTTP Method**  | **POST**                                                                                     |
| **Description**  | Request Token for Authentication&#xD;                                                        |
| **Content-type** | `application/json`                                                                           |

### API SNAP Service Code

| **Service Code** | **Reference API**                                                                                              |
| ---------------- | -------------------------------------------------------------------------------------------------------------- |
| `73`             | [E-Wallet - Access Token](docId:92feymrQs_iebHXrfgXUq)<br />[QRIS - Access Token](docId:92feymrQs_iebHXrfgXUq) |
| `11`             | [Balance Inquiry - API Payout (Disbursement) SNAP](docId\:PeVu8-VUTjjaP0dRKQci8)                               |
| `54`             | [Registration - API E-Wallet (Direct Debit) SNAP](docId\:U__7u4PnTx3_eSWeZ-94m)                                |
| `55`             | [Check Status Transaction - API E-Wallet (Direct Debit) SNAP](docId\:za7aN0HE8C3-2OiXvdlNa)                    |
| `58`             | [Refund Transaction - API E-Wallet (Direct Debit) SNAP](docId\:Y-cGH6ylEK9h3FgMdXuqZ)                          |
| `47`             | [Registration - API QRIS SNAP](docId\:FsuuZk9ZHP7pRzFCi32fm)                                                   |
| `51`             | [Check Status Transaction - API QRIS SNAP](docId\:a0i6Lo4dvBo6Ih5Ql6nDA)                                       |
| `78`             | [Refund Transaction - API QRIS SNAP](docId\:uZpKssMvaM0skERr1Fn9B)                                             |



## Get Header

### Request Access Token Header

| **Header Parameter Name** | **Type** | **Attribute** | **Content**                                                                                                                                                                                         |
| ------------------------- | -------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Content-Type`            | String   | Mandatory     | `Application/JSON`                                                                                                                                                                                  |
| `X-TIMESTAMP`             | String   | Mandatory     | `YYYY-MM-DDTHH:MM:SS`<br />(2022-03-21T10:11:40+07:00)                                                                                                                                              |
| `X-CLIENT KEY`            | String   | Mandatory     | NICEPAY Provided (`X-CLIENT `<br />`KEY` = `CLIENT_ID`)                                                                                                                                             |
| `X-SIGNATURE`             | String   | Mandatory     | 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**    | **Type** | **Required** | **Description**             |
| ---------------- | -------- | ------------ | --------------------------- |
| `grantType`      | String   | Mandatory    | Only “`client_credentials`” |
| `additionalInfo` | Object   | Optional     |                             |

### Response Parameter

| **BI Parameter**  | **NICEPAY Parameter** | **Type** | **Length** | **Required** | **Description**                                                                                                                        |
| ----------------- | --------------------- | -------- | ---------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| `responseCode`    | `responseCd`          | String   |            | Optional     | [General Response Code and Message - API SNAP](docId\:bJr4kjAmZCKnlN-5zRnvW)<br /><br />Error code to specify \{\{th}} error returned. |
| `responseMessage` | `responseMsg`         | String   |            | Optional     | Response Message<br /><br />Debug message to provide more                                                                              |
| `accessToken`     |                       | String   | 2048       | Mandatory    | A string representing authorization issued by Client uses to access protected resources                                                |
| `tokenType`       |                       |   String |            | Mandatory    | Token Type Value: “Bearer”                                                                                                             |
| `expiresIn`       |                       | String   |            | Mandatory    | Session expiry in seconds: `900` <br />(15 minutes)                                                                                    |

### Sample Parameter

:::CodeblockTabs
Sample Request

```json
//HEADER SECTION
Content-Type: application/json
X-SIGNATURE: aFHq5SNdWO5Pq2vwZk4ztd9Cu3OvblG6NezGwLX3GC2mRJorDHPeZpR3V+RXrPC8ojcyCwQy01FSipmA8YdQvz1hOth7aekXzhigYCRNS34EHYEoFGD1YMHVFRvxn2Fu8HAd6wTvPNy2X2rbUS3hWrJsfa5cHu8wKVb7zPCuxNc=
X-CLIENT-KEY : NORMALTEST
X-TIMESTAMP: 2024-12-31T10:11:40+07:00

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

Sample Response

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



