479 lines
11 KiB
Markdown
479 lines
11 KiB
Markdown
# Doom CC Loan on App API
|
||
|
||
## 1. `POST /api/v1/cc-loan-on-app/onboarding`
|
||
|
||
**Erangel route:** `POST /v3-cc-loan-on-app-onboarding`
|
||
|
||
<details>
|
||
<summary>Request Body</summary>
|
||
|
||
```json
|
||
{
|
||
"card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0"
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
<details>
|
||
<summary>Response Body</summary>
|
||
|
||
```json
|
||
{
|
||
"code": "00",
|
||
"description": "success",
|
||
"data": {
|
||
"admin_fee_note": {
|
||
"description": "1% dari total pinjaman (min. Rp200.000)",
|
||
"title": "Ketentuan Biaya Admin"
|
||
},
|
||
"eligible": true,
|
||
"eligible_note": "Pinjaman baru belum bisa diajukan karena masih ada proses yang berlangsung.",
|
||
"list": [
|
||
{
|
||
"account_image_name": "britama_bisnis",
|
||
"account_image_path": "http://asset-host/account/britama_bisnis.png",
|
||
"account_name": "BRItama Bisnis",
|
||
"account_no": "029012345678901",
|
||
"account_string": "0290 **** **** 112",
|
||
"admin_fee_string": "Rp200.000",
|
||
"amount_string": "Rp3.200.000",
|
||
"card_image_name": "bri_easy_card",
|
||
"card_image_path": "http://asset-host/card/bri_easy_card.png",
|
||
"card_name": "Agung Harsono",
|
||
"card_no": "2003 **** **** 4302",
|
||
"card_product_type": "Easy Card",
|
||
"interest_rate_string": "0% per bulan",
|
||
"monthly_payment_string": "Rp1.015.000",
|
||
"progress": [
|
||
{
|
||
"status_title": "Pengajuan dalam Analisis",
|
||
"status_time": "09 Feb 2026, 09:41 WIB",
|
||
"order": 1,
|
||
"current": true
|
||
},
|
||
{
|
||
"status_title": "Pengajuan Disetujui",
|
||
"status_time": "",
|
||
"order": 2,
|
||
"current": false
|
||
}
|
||
],
|
||
"request_time": "09 February 2026, 09:41:02 WIB",
|
||
"seq_no": 1,
|
||
"sla_note": "Proses pengajuan 1x24 jam kerja. Kamu akan diberi notifikasi saat pencairan disetujui.",
|
||
"status": "PROCESSING",
|
||
"term_string": "3x Cicilan",
|
||
"ticket_no": "TKT001"
|
||
}
|
||
],
|
||
"scheme": [
|
||
{
|
||
"title": "3x Cicilan",
|
||
"description": "0%"
|
||
},
|
||
{
|
||
"title": "6 Bulan",
|
||
"description": "0,5%"
|
||
},
|
||
],
|
||
"slider_texts": [
|
||
{
|
||
"title": "Pinjaman Fleksibel",
|
||
"description": "Pinjaman dana minimal 1 juta hingga 75 juta atau 50% dari sisa limit kartu kredit.",
|
||
"image_path": "http://asset-host/example.png"
|
||
},
|
||
{
|
||
"title": "Pinjaman Fleksibel",
|
||
"description": "Pinjaman dana minimal 1 juta hingga 75 juta atau 50% dari sisa limit kartu kredit.",
|
||
"image_path": "http://asset-host/example.png"
|
||
},
|
||
{
|
||
"title": "Pinjaman Fleksibel",
|
||
"description": "Pinjaman dana minimal 1 juta hingga 75 juta atau 50% dari sisa limit kartu kredit.",
|
||
"image_path": "http://asset-host/example.png"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
### Error Codes
|
||
|
||
| Code | When |
|
||
|---|---|
|
||
| `00` | `success` – also returned when user has no CC (CC list empty from Eredar). |
|
||
| `TV` | Vikendi timeout (Eredar call) |
|
||
| `NA` | Not authorized (Eredar call) |
|
||
| `TB` | Static param DB read failure |
|
||
| `TBR` | Brigate timeout on `GetLoaStatusFromBrigate` |
|
||
|
||
---
|
||
|
||
## 2. `POST /api/v1/cc-loan-on-app/form`
|
||
|
||
**Erangel route:** `POST /v3-cc-loan-on-app-form`
|
||
|
||
<details>
|
||
<summary>Request Body</summary>
|
||
|
||
```json
|
||
{
|
||
"card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0"
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
<details>
|
||
<summary>Response Body</summary>
|
||
|
||
```json
|
||
{
|
||
"code": "00",
|
||
"description": "success",
|
||
"data": {
|
||
"account_list": [
|
||
{
|
||
"account": "123451234512345",
|
||
"account_string": "1234 5123 4512 345",
|
||
"alias": "Alias-supedi",
|
||
"currency": "IDR",
|
||
"default": 1,
|
||
"image_name": "karti.png",
|
||
"image_path": "http://.../karti.png",
|
||
"name": "supedi",
|
||
"product_type": "karti"
|
||
}
|
||
],
|
||
"balance_string": "Rp20.000.000,00",
|
||
"cc_image_slim": "http://.../card/jcb_platinum_slim.png",
|
||
"loan_multiplier": 100000,
|
||
"loan_multiplier_string": "Rp100.000",
|
||
"maximum_loan": 20000000,
|
||
"maximum_loan_string": "Rp20.000.000",
|
||
"minimum_loan": 1000000,
|
||
"minimum_loan_string": "Rp1.000.000",
|
||
"product_type": "Jcb Platinum",
|
||
"simulation": [
|
||
{
|
||
"admin_fee": 200000,
|
||
"admin_fee_string": "Rp200.000",
|
||
"interest_rate": 0.5,
|
||
"interest_rate_amount": 50000,
|
||
"interest_rate_amount_string": "Rp50.000",
|
||
"interest_rate_string": "0.5%",
|
||
"monthly_payment": 1700000,
|
||
"monthly_payment_string": "Rp1.700.000",
|
||
"simulation_code": "...",
|
||
"term": 3,
|
||
"term_code": "123",
|
||
"term_string": "3x Cicilan"
|
||
}
|
||
],
|
||
"tnc_text": "text"
|
||
}
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
### Error Codes
|
||
|
||
| Code | When |
|
||
|---|---|
|
||
| `00` | Success |
|
||
| `SM` | User is in safety mode (`form.go:37`) |
|
||
| `CNF` | Credit card not found (`form.go:100`) |
|
||
| `TV` | Vikendi timeout (Eredar, parameter, account list) |
|
||
| `TB` | Database timeout (static param) |
|
||
| `TBR` | Brigate timeout (`GetProgramTermFromBrigate`) |
|
||
| `EH` | Error handling (account alias/validation fan-in errors) |
|
||
|
||
---
|
||
|
||
## 3. `POST /api/v1/cc-loan-on-app/term`
|
||
|
||
**Erangel route:** `POST /v3-cc-loan-on-app-term`
|
||
|
||
<details>
|
||
<summary>Response Body</summary>
|
||
|
||
```json
|
||
{
|
||
"card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0",
|
||
"amount": 5000
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
<details>
|
||
<summary>Response Body</summary>
|
||
|
||
```json
|
||
{
|
||
"code": "00",
|
||
"description": "success",
|
||
"data": {
|
||
"simulation": [
|
||
{
|
||
"admin_fee": 200000,
|
||
"admin_fee_string": "Rp200.000",
|
||
"interest_rate": 0.5,
|
||
"interest_rate_amount": 50000,
|
||
"interest_rate_amount_string": "Rp50.000",
|
||
"interest_rate_string": "0.5%",
|
||
"monthly_payment": 1700000,
|
||
"monthly_payment_string": "Rp1.700.000",
|
||
"simulation_code": "...",
|
||
"term": 3,
|
||
"term_code": "123",
|
||
"term_string": "3x Cicilan"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
### Error Codes
|
||
|
||
| Code | When |
|
||
|---|---|
|
||
| `00` | Success |
|
||
| `TBR` | Brigate timeout (`GetLoaSimulationtFromBrigate`) |
|
||
|
||
---
|
||
|
||
## 4. `POST /api/v1/cc-loan-on-app/confirm`
|
||
|
||
**Erangel route:** `POST /v3-cc-loan-on-app-confirm`
|
||
|
||
<details>
|
||
<summary>Request Body</summary>
|
||
|
||
```json
|
||
{
|
||
"card_token": "f104d035a92652987b8c82dd91cb13aa1f403d686dcbc3844d261cc8416de9b0",
|
||
"amount": 5000000,
|
||
"simulation_code": "...",
|
||
"account_no": "123451234512345",
|
||
"account_name": "BRItama Bisnis",
|
||
"term": 3,
|
||
"interest_rate": 0.5,
|
||
"monthly_payment": 1700000,
|
||
"admin_fee": 50000
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
<details>
|
||
<summary>Response Body</summary>
|
||
|
||
```json
|
||
{
|
||
"code": "00",
|
||
"description": "success",
|
||
"data": {
|
||
"account_name": "BRItama Bisnis",
|
||
"account_no": "123451234512345",
|
||
"admin_fee": 50000,
|
||
"admin_fee_string": "Rp50.000",
|
||
"amount_string": "Rp5.000.000",
|
||
"interest_rate": 0.5,
|
||
"interest_rate_amount": 50000,
|
||
"interest_rate_amount_string": "Rp50.000",
|
||
"interest_rate_string": "0,5%",
|
||
"monthly_payment": 1700000,
|
||
"monthly_payment_string": "Rp1.700.000",
|
||
"reference_number": "123456789154",
|
||
"term": 3,
|
||
"term_string": "3x Cicilan"
|
||
}
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
### Error Codes
|
||
|
||
| Code | When |
|
||
|---|---|
|
||
| `00` | Success — loan context saved to Redis |
|
||
| `NA` | `account_no` not in user's financial accounts |
|
||
| `TB` | Database/Redis timeout (failed to save loan context) |
|
||
| `EH` | Error handling (validation fan-in errors, e.g. invalid `simulation_code` for the chosen `card_token`) |
|
||
|
||
---
|
||
|
||
## 5. `POST /api/v1/cc-loan-on-app/send-otp`
|
||
|
||
**Erangel route:** `POST /v3-cc-loan-on-app-send-otp`
|
||
|
||
<details>
|
||
<summary>Request Body</summary>
|
||
|
||
```json
|
||
{
|
||
"otp_type": "WA",
|
||
"reference_number": "123456789154"
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
<details>
|
||
<summary>Response Body</summary>
|
||
|
||
```json
|
||
{
|
||
"code": "00",
|
||
"description": "success",
|
||
"data": {
|
||
"cellphone_number": "0812****1234",
|
||
"duration_sec": 300,
|
||
"server_id": "abc123"
|
||
}
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
### Error Codes
|
||
|
||
| Code | When |
|
||
|---|---|
|
||
| `00` | Success |
|
||
| `TV` | Vikendi timeout (fetching user phone number) |
|
||
| `TC` | Cipher/OTP timeout |
|
||
| `TR` | Redis timeout (cipher) |
|
||
| `TK` | Kafka timeout — OTP SMS/WA delivery failed |
|
||
| `EX` | `reference_number` not found or expired in Redis (no loan context from `/confirm`) |
|
||
|
||
---
|
||
|
||
## 6. `POST /api/v1/cc-loan-on-app/submit-otp`
|
||
|
||
**Erangel route:** `POST /v3-cc-loan-on-app-submit-otp`
|
||
|
||
<details>
|
||
<summary>Request Body</summary>
|
||
|
||
```json
|
||
{
|
||
"server_id": "abc123",
|
||
"otp": "123456",
|
||
"otp_type": "WA",
|
||
"reference_number": "123456789154"
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
<details>
|
||
<summary>Response Body</summary>
|
||
|
||
```json
|
||
{
|
||
"code": "00",
|
||
"description": "success",
|
||
"data": {
|
||
"reference_number": "987654321098"
|
||
}
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
### Error Codes
|
||
|
||
| Code | When |
|
||
|---|---|
|
||
| `00` | OTP valid |
|
||
| `NV` | Invalid OTP |
|
||
| `TMT` | Too many wrong-OTP attempts |
|
||
| `EX` | OTP not exist or expired, or `reference_number` not found in Redis |
|
||
| `TC` | Cipher/OTP validation timeout |
|
||
| `TR` | Redis timeout (cipher) |
|
||
|
||
---
|
||
|
||
## 7. `POST /api/v1/cc-loan-on-app/submit`
|
||
|
||
**Erangel route:** `POST /v3-cc-loan-on-app-submit`
|
||
|
||
<details>
|
||
<summary>Request Body</summary>
|
||
|
||
```json
|
||
{
|
||
"pin": "123456",
|
||
"reference_number": "987654321098"
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
<details>
|
||
<summary>Response Body</summary>
|
||
|
||
```json
|
||
{
|
||
"code": "00",
|
||
"description": "success",
|
||
"data": {
|
||
"account_image_name": "britama_bisnis",
|
||
"account_image_path": "http://asset-host/account/britama_bisnis.png",
|
||
"account_name": "BRItama Bisnis",
|
||
"account_no": "029012345678901",
|
||
"account_string": "0290 **** **** 112",
|
||
"admin_fee_string": "Rp200.000",
|
||
"amount_string": "Rp3.200.000",
|
||
"card_image_name": "bri_easy_card",
|
||
"card_image_path": "http://asset-host/card/bri_easy_card.png",
|
||
"card_name": "Agung Harsono",
|
||
"card_no": "2003 **** **** 4302",
|
||
"card_product_type": "Easy Card",
|
||
"interest_rate_string": "0% per bulan",
|
||
"monthly_payment_string": "Rp1.015.000",
|
||
"progress": [
|
||
{
|
||
"status_title": "Pengajuan dalam Analisis",
|
||
"status_time": "09 Feb 2026, 09:41 WIB",
|
||
"order": 1,
|
||
"current": true
|
||
},
|
||
{
|
||
"status_title": "Pengajuan Disetujui",
|
||
"status_time": "",
|
||
"order": 2,
|
||
"current": false
|
||
}
|
||
],
|
||
"request_time": "09 February 2026, 09:41:02 WIB",
|
||
"seq_no": 1,
|
||
"sla_note": "Proses pengajuan 1x24 jam kerja. Kamu akan diberi notifikasi saat pencairan disetujui.",
|
||
"status": "PROCESSING",
|
||
"term_string": "3x Cicilan",
|
||
"ticket_no": "TKT001"
|
||
}
|
||
}
|
||
```
|
||
|
||
</details>
|
||
|
||
### Error Codes
|
||
|
||
| Code | When |
|
||
|---|---|
|
||
| `00` | Success |
|
||
| `NA` | `account_no` not in user's financial accounts (`submit.go:44`) |
|
||
| `TBR` | Brigate `LoaSubmitToBrigate` failed |
|
||
| `TB` | DB insert failed (`InsertLoanOnAppToDB`) or `GetLoaStatusFromBrigate` DB error |
|
||
|
||
--- |