Access Token B2B
Endpoint ini menerbitkan access token yang dipakai untuk seluruh request partner.
Service Info
| Item | Value |
|---|
HTTP Method | POST |
Service Code | 01 |
Base URL | URL yang diberikan saat aktivasi |
Path | /openapi/v1.0/access-token/b2b |
Header
| Header | Tipe | Wajib | Deskripsi |
|---|
Content-Type | String | Ya | application/json |
X-CLIENT-KEY | String | Ya | client_id partner |
X-TIMESTAMP | String | Ya | yyyy-MM-ddTHH:mm:ss+07:00 |
X-SIGNATURE | String | Ya | RSA-SHA256(clientId|X-TIMESTAMP) |
Body
| Parameter | Tipe | Wajib | Deskripsi |
|---|
grantType | String | Ya | Nilai: client_credentials |
Request Sample
{
"grantType": "client_credentials"
}
Response Structure
| Parameter | Tipe | Deskripsi |
|---|
responseCode | String | Kode response |
responseMessage | String | Pesan response |
accessToken | String | Token untuk setiap request partner |
tokenType | String | Bearer |
expiresIn | String | 900 detik |
additionalInfo | Object | Informasi tambahan, saat ini kosong |
Response Sample
{
"responseCode": "2000100",
"responseMessage": "Successful",
"accessToken": "<accessToken>",
"tokenType": "Bearer",
"expiresIn": "900",
"additionalInfo": {}
}
Response Codes
| Response Code | Message | Deskripsi |
|---|
2000100 | Successful | Token berhasil dibuat |
4000100 | Bad Request | Request body tidak valid |
4000101 | Invalid Field Format | Format field tidak valid |
4000102 | Invalid Mandatory Field | Header wajib tidak ada |
4010100 | Unauthorized | Signature salah atau client tidak dikenal |
4030100 | Forbidden | Akses ditolak |
4290100 | Too Many Requests | Batas request terlampaui |
5000101 | Internal Server Error | Error server |
Cara membuat signature dijelaskan di Signature Generation.