# Access Token

### Technical Specification <a href="#technical-specification" id="technical-specification"></a>

| Environment | Method | URL                                                             |
| ----------- | ------ | --------------------------------------------------------------- |
| Development | POST   | <https://devo.finnet.co.id/pg/snap/oauth/v1.0/access-token/b2b> |
| Production  | POST   | <https://live.finnet.co.id/pg/snap/oauth/v1.0/access-token/b2b> |

### Body Request <a href="#body-request" id="body-request"></a>

| No | Name      | Type   | Mandatory | Min Length | Max Length | Description                            |
| -- | --------- | ------ | --------- | ---------- | ---------- | -------------------------------------- |
| 1  | grantType | String | M         | 1          | 18         | OAuth2 client\_credentials grant type. |

#### Sample Request <a href="#sample-request" id="sample-request"></a>

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

### Body Response <a href="#body-response" id="body-response"></a>

| No | Name            | Type                                                              | Mandatory | Min Length | Max Length | Description                         |
| -- | --------------- | ----------------------------------------------------------------- | --------- | ---------- | ---------- | ----------------------------------- |
| 1  | responseCode    | [Enum](/api-reference/appendix/enumeration/response-code-list.md) | M         | 1          | 7          | BI SNAP Response Code.              |
| 2  | responseMessage | String                                                            | M         | 1          | 150        | BI SNAP Response Message.           |
| 3  | accessToken     | String                                                            | M         | 1          | 3000       | Generated client credentials token. |
| 4  | tokenType       | String                                                            | M         | 1          | 6          | Filled with Bearer type.            |
| 5  | expiresIn       | String                                                            | M         | 1          | 5          | Token expiry in seconds             |

#### Sample Response <a href="#sample-response" id="sample-response"></a>

```
{
    "responseMessage": "Request has been processed successfully",
    "responseCode": "2007300",
    "accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI5NzE5Mzk0ZC1hZjkxLTRmOWMtOWQxNi02YjYyMzNhNDU4ODkiLCJqdGkiOiIxY2ExMjAyYmVhNjk5ODhlZThkNGY3MDVmNDRlYzg4NGE5ZWRmNDg0NjU5MGFhNDhmOGE1M2M1OGNjNzdhODVlMjU3OTA4MTdiMjYzZDBhZSIsImlhdCI6MTY2NTY0ODMwNS4zNjU0NTcsIm5iZiI6MTY2NTY0ODMwNS4zNjU0NiwiZXhwIjoxNjk3MTg0MzA1LjM1NDEzMywic3ViIjoiIiwic2NvcGVzIjpbInJlcXVlc3QiXX0.jMRB8qIZTcne5xk-GxV2rb-YQRtoE30TQ40szzyGHWlU1qrzjjszmyIxdCxG6OIQr9tIDGw1VunbZ4gZt5mtMRU9pImmMgEjOS7e8hYaoWDKuTBsNnxf62rZO4tXVbPKtTkuFaxYF2BNFpIqd9Z6qpe_zrrwfXSeVlgTE6XkPFrEgo3LPmhb0hZ_Ul-ur-FyAn9Rpqr-rC218bdkqwhrYoKagC5YLXEVbtHJlhTn3BTMIxbNqvXJV3tox832EI9eFiSWN7prvfUB8l0q-kvgUrIoa1i1LlNj_uiOX9j_917n4uF_AeG5leaDf4hZY3MmmFABzZ69BdARPrAXMDxqqSiCMhyYar9fyjVyYBlvXCJbROnJXaaR8bD9M2SWcb4hMMGC1TjHdo2Pv5sWv0KBOMSWpR3QQxUS4cryDrqql_wO57s1F1QvlbdB1D9jdHo-xLIFwuytX6nqVGno_6sOLweSXYl7Pz8A4-Fxqzt657IiWZ5AzhuZxRQj1LRzEHzE85NWJ0viXCkVDChUbZWl-RXn6KbBYwRAV-KJZjouxf4z63urOBoch0ajddSixA-TSK0fSOJrl1LfbFLJJNsItGDg1ONW5zXd7-tuGaxx-EYHfskc0OLog8FdlgecDOjNzHnfVPyI4gzFFq1QszumBMGJcPAcNGflJhP0MImq3To",
    "tokenType": "Bearer",
    "expiresIn": 900
}
```

## POST /oauth/v1.0/access-token/b2b

> Access Token B2B Copy

```json
{"openapi":"3.1.0","info":{"title":"SNAP","version":"1.0.0"},"servers":[{"url":"https://snapstag.finnet.co.id","description":"SNAP Development"}],"security":[],"paths":{"/oauth/v1.0/access-token/b2b":{"post":{"summary":"Access Token B2B Copy","deprecated":false,"description":"","tags":[],"parameters":[{"name":"X-TIMESTAMP","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"X-CLIENT-KEY","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"X-SIGNATURE","in":"header","description":"","required":true,"schema":{"type":"string"}},{"name":"Accept","in":"header","description":"","schema":{"type":"string"}},{"name":"Content-Type","in":"header","description":"","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"grantType":{"type":"string"}},"required":["grantType"]}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{}}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.finpay.id/api-reference/finpay-pg/snap/qris/access-token.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
