# Access Token B2B2C

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

```
Service Code: 74
```

| Environment | Method | URL                                                     |
| ----------- | ------ | ------------------------------------------------------- |
| Development | POST   | <https://snapstag.finnet.co.id/v1.0/access-token/b2b2c> |
| Production  | POST   | <https://snap.finnet.co.id/v1.0/access-token/b2b2c>     |

### 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 authorization\_code & refresh\_token grant types.                                                                               |
| 2  | authCode     | String | M         | 1          | 256        | Authorization code obtained from the query parameter in the final webview redirect, after the customer authorises all of the consents. |
| 3  | refreshToken | String | O         | 1          | 512        | Refresh token obtained from response at the first B2B2C call using authorization\_code grant type.                                     |

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

```
{
  "grantType": "authorization_code",
  "authCode":"def50200e84f7fe6a6dc3c3a5c007a2afa824977ba5031b4080f79a2b8130e3
  f8947585ddd617d9c33f56d6406b1f0bec31ec65e94cfe6a4a58b4f54e015b346abadb866f1
  ad9f25784c7a5d04c565d15a3b47185316a5c8ca3f5acaaf4c86f495d8d87156ae5b87dd23c
  73609274e3979e79a28663ea36601c3d0975d71dc1cb34589ac27c02c89cea6f126cf253fd6
  616c9e672f952a155ecdf360f1aa496300a7fcd6a26cb213a2b89dfb5fb0856de4322fee732
  3573c896f4140978fc56c15a0f1b323b1dc54a8e6602b4a9fc7978258cdd73ed59ed0b01420
  e9b050a7b2510c4bf2e2dc7b3bdf19846981652bb37fe45e224dec43ad909cf3f7d70238205
  50f7ded824659f3b0cd407471260b858f785fdb81115ed36f4137e4dece045d1c9bafb21d91
  e4305ed0a87e97bb919fa518b89a841a6447fcc228b7946c2823dace3e5d955df7cc4f117ed
  c27580f5c670a2b5dd19d2d490d46cdd8ef6fbefe1fbca93ea045278fc4c65b4c72c42195b0
  692eb0845cbfeeb9366ea8180a39619a07a0652e831b2beef98a"
}
```

### 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          | 2048       | Generated authorization code exchange token.     |
| 4  | tokenType              | String                                                            | M         | 1          | 6          | Filled with Bearer type.                         |
| 5  | accessTokenExpiryTime  | String                                                            | M         | 1          | 25         | Access Token expiry time in ISO8601 format.      |
| 6  | refreshToken           | String                                                            | M         | 1          | 2048       | Generated token for refreshing the access token. |
| 7  | refreshTokenExpiryTime | String                                                            | M         | 1          | 25         | Refresh Token expiry time in ISO8601 format.     |

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

```
{
  "responseCode": "2007400",
  "responseMessage": "Request has been processed successfully",
  "accessToken":
  "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI5NzE5Mzk0ZC1hZjkxLTRmOWMtO
  WQxNi02YjYyMzNhNDU4ODkiLCJqdGkiOiJkODgyNGU4MGUwNjM5MjhiYTQzZTgxNzEwY2Q0YmU4
  OTlhYjhlMTVhZmEwODEyMGEyYzI3OWFkNzJmMGMxMWUxYWMwNTRiZjgyZDQ1YWUzNSIsImlhdCI
  6MTY2NjY4MTIzMi42NDE3ODQsIm5iZiI6MTY2NjY4MTIzMi42NDE3ODksImV4cCI6MTY5ODIxNz
  IzMi41MzA2ODksInN1YiI6IjYyODE5Nzc4MTc5MDIiLCJzY29wZXMiOltdfQ.aKOvws66NOQ-KT
  qPMvFIxgpHiGqYrFeS8KCtCm-k0eXS-2wA8C0QLL_JqVDopvaQofp0tGc_y68_KehkksJqbyje7
  TR9m7SQdJWO6meVud6AqPUQv0KY9rMN_FfohF8Z3B45SrgbRZAk-hzYNQRDcnrPwy4clD_QMUQh
  ic8PINOyBfguV1wIaGBXDkbMDKqONBU-xuXQLv5EsosbsqKSNq86B8sE8IO5yKC0O6JIK11Nvpz
  wG4fo4VP1DNuZ7uaHkF7Jv3RofLnj7uRsbxAS6r1qudHIq8O3romw40G474RciMGdiu2L5rB7_F
  iKwdVqNB-fARcg4O2OyC_8roGBh2jsA-92c6dANJIe03g2OQ_DoOTDpVx3Va2lGV04NXHlWOu3n
  fUgFSzorZNkWJj6w1DMtWtYq1xPVfR5r1O3Hwulri_MrgmcuQeiZA7jt9z-04iBSt0zehonjlDY
  NmrDM9zUYljc6vlIpOhpBEux0Su4w4BZNgozIKkmJ6O3VG-rLEOxcdl_-A4X42qE-mEqkPjQjFy
  Hx7xzTvE06q7KRmaQt2qMtGJVRiPes7HPt7eWLeTRfyJcw9uXqNwVpvyv52H1IptuhkA7jDIPJF
  IN1lRe6aa0m7vw8EKpXFc_uxn0aSqpBYA1wdN9eJtKRM9F8USS9chTywy4p7pYrBRTZ8Y",
  "tokenType": "Bearer",
  "accessTokenExpiryTime": "2023-10-25T07:00:32+00:00",
  "refreshToken":
  "def502001649fd620c475a48dba4609390d4bced557ec26bd39532abd1cde20f0fda8fbdd5
  5fa937892baa218bb29db83b1e9ee818f94f8680e40428a52aa76a0a7e896daa1ec6e45c3b1
  b1e4634e47bbea9c00c4b1533bcaf77f15027aaacec4347afdce981ac0ae04dcc4b40769025
  21d8960c4bac6f5491b02432db24bad7c8c03b58d9310eb445cb2bc4f2b1741e984f3a89abe
  acbc2738a866ebb9297564e2614a5d8e6630fd7d866776e1a6b84c2aee3d2c2f190f2b18b01
  d649fc5916eab0fa8ed99e91ac8443c37d373e44f05a9b516023a9027609dd99c6bfaac5967
  0e4d1a751a6c3bfb57fc58eb7b30b500a5ee1a3884c07b6d4c449614e3e0b55cc7f6b106b12
  cf7664823f7e972f31bc9106eb5a758dd1cb9fe7f434426af2b8b0654ec23cdcad0d18037d2
  a5f6e380b943e7cf0f5690d4e4d92ef8917f7728eeb739139e3b0d42d35c338bd73f38645b4
  b5c8ecdb5ffcf2520bb8586e355fe7bd3489720e6cbf7d7eb026da8f7e9b83d6280c0f384f7
  eab80193a3810d191a3b77afae2d290aece21cd8507a02e095b",
  "refreshTokenExpiryTime": "2023-10-25T07:00:32+00:00"
}
```


---

# 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-money/linkage/access-token-b2b2c.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.
