# XENDIT/TRANSACTION

# Payout

Payout related transactions

# Payout request for buyer and seller

<div drawio-diagram="66"><img src="https://documentation.onindonesia.id/uploads/images/drawio/2024-02/drawing-3-1708932005.png" alt=""/></div>

##### Notes

- There is additional fee Rp 2.500 in [this page](https://www.xendit.co/en-id/pricing/?utm_source=google&utm_medium=cpc&utm_campaign=BKWS-Exact-ID-EN&utm_content=onboarding&utm_term=xendit%20pricing&gclid=Cj0KCQiAw6yuBhDrARIsACf94RUCuOcFXMmocbjeh-8r39r8ZdgH0_wNvL09ga8gcmrneNkHvLn8kqcaAuGREALw_wcB), but at the time we test, there is no additional cuts to recipient nor from xendit.

##### Endpoint

<table border="1" id="bkmrk-endpoint-method-auth" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 20.0279%;"></col><col style="width: 20.0279%;"></col><col style="width: 40.0558%;"></col><col style="width: 20.0279%;"></col></colgroup><tbody><tr><td>**Endpoint**</td><td>**Source**</td><td>**Method**  
</td><td>**Authentication**</td></tr><tr><td><div><div><div><div>/payout/request</div></div></div></div></td><td><div><div><div><div>USAPI</div></div></div></div></td><td>POST</td><td>Yes</td></tr></tbody></table>

##### Authentication

<table border="1" id="bkmrk-endpoint-method-serv" style="border-collapse: collapse; width: 100%; height: 59.757px;"><colgroup><col style="width: 29.5467%;"></col><col style="width: 45.5054%;"></col><col style="width: 24.9617%;"></col></colgroup><tbody><tr style="height: 29.8785px;"><td style="height: 29.8785px;">**Type**  
</td><td style="height: 29.8785px;">**Token source**  
</td><td style="height: 29.8785px;">**Usage**  
</td></tr><tr style="height: 29.8785px;"><td style="height: 29.8785px;">Bearer</td><td style="height: 29.8785px;">argon2id encryption

vlskdfgn&gt;iow358u2rlwnfe!@23q58qwegdf

</td><td style="height: 29.8785px;">"Bearer &lt;string&gt;"

</td></tr></tbody></table>

##### Body request

```json
{
  "username": <string>,
  "amount": <integer>,
  "platform" : <string>,
  "bank_channel": <string>,
  "bank_account_name": <string>,
  "bank_account_number": <string>
}
```

<table border="1" id="bkmrk-properties-propertie" style="border-collapse: collapse; width: 100%; height: 60.5938px;"><colgroup><col style="width: 22.7478%;"></col><col style="width: 14.8295%;"></col><col style="width: 15.3276%;"></col><col style="width: 11.0012%;"></col><col style="width: 36.0939%;"></col></colgroup><tbody><tr style="height: 30.7969px;"><td style="height: 30.7969px;">**Properties**  
</td><td style="height: 30.7969px;">**Properties of**</td><td style="height: 30.7969px;">**Data type**</td><td style="height: 30.7969px;">**Required**</td><td>**notes**</td></tr><tr><td>username</td><td>  
</td><td>string</td><td>yes</td><td>Username affiliated for payout from USAPI</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">amount</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">integer</td><td style="height: 29.7969px;">yes</td><td>minimum amount is 50000</td></tr><tr><td>platform</td><td>  
</td><td>string</td><td>yes</td><td>Platform lists:  
<div><div>- ONDELIVERY
- ONMARKET

</div></div></td></tr><tr><td>bank\_channel</td><td>  
</td><td>string</td><td>yes</td><td>ID of Bank channel. Click the provided link for the list

[Bank List Link](https://documentation.onindonesia.id/books/xendittransaction/page/bank-list "Bank List Link")

</td></tr><tr><td>bank\_account\_name</td><td>  
</td><td>string</td><td>yes</td><td>Bank account holder name.</td></tr><tr><td>bank\_account\_number</td><td>  
</td><td>string</td><td>yes</td><td>Bank account number.</td></tr></tbody></table>

<details id="bkmrk-request-example-body"><summary>Request example</summary>

  
```json
{
    "username": "usernew1",
    "amount": 60000,
    "platform": "ONMARKET",
    "bank_channel": "ID_BCA",
    "bank_account_name": "TEST",
    "bank_account_number": "000000"
}
```

</details><details id="bkmrk-result-example-body-"><summary>Result example</summary>

<p class="callout info">200 (OK)</p>

```javascript
{
    "message": "PAYOUT PROCESSED"
}
```

</details><details id="bkmrk-error-example-body-r"><summary>Error example</summary>

<p class="callout danger">400 Bad Request</p>

<p class="callout warning">User balance is less than requested amount</p>

```json
{
    "message": "Insufficient Fund"
}
```

<p class="callout warning">Requested amount is less than minimum amount</p>

```json
{
    "message": "must be >= 10000"
}
```

<p class="callout warning">Parameter(s) required</p>

```json
{
    "message": "Must have required property <parameter>"
}
```

<p class="callout warning"><span style="color: rgb(232, 92, 91);">500 </span><span style="color: rgb(232, 92, 91);">Internal Server Error</span>  
</p>

```json
{
    "message": "Internal Error"
}
```

</details>

# Invoice

Invoice for xendit transaction

# Invoice checkout

#### Flowchart

<div drawio-diagram="63"><img src="https://documentation.onindonesia.id/uploads/images/drawio/2024-01/drawing-3-1706671729.png" alt=""/></div>

##### Source:  
[https://cahskuy.stoplight.io/docs/OND/3c78799259e69-payment-checkout](https://cahskuy.stoplight.io/docs/OND/3c78799259e69-payment-checkout)  


Reference:  
[Transaction Flowchart](https://documentation.onindonesia.id/books/getting-started/page/transaction-flowchart)

##### Endpoint

<table border="1" id="bkmrk-endpoint-method-auth" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><tbody><tr><td>**Endpoint**</td><td>**Method**  
</td><td>**Authentication**</td></tr><tr><td><div><div>/payment-checkout</div></div></td><td>POST</td><td>Yes</td></tr></tbody></table>

##### Authentication

<table border="1" id="bkmrk-endpoint-method-serv" style="border-collapse: collapse; width: 100%; height: 59.757px;"><colgroup><col style="width: 29.5426%;"></col><col style="width: 27.3177%;"></col><col style="width: 21.508%;"></col><col style="width: 21.508%;"></col></colgroup><tbody><tr style="height: 29.8785px;"><td style="height: 29.8785px;">**Type**  
</td><td style="height: 29.8785px;">**Token source**  
</td><td style="height: 29.8785px;">**Server**  
</td><td>**Description**</td></tr><tr style="height: 29.8785px;"><td style="height: 29.8785px;">Bearer</td><td style="height: 29.8785px;">{{usapi}}/auth</td><td style="height: 29.8785px;">USAPI</td><td>Buyer's auth</td></tr></tbody></table>

##### Body request example

```json
{
    "total_amount": 40000,
    "service": "ONMARKET",
    "source": "XENDIT",
    "transaction": [
        {
            "amount": 10000,
            "freight_charge": 5000,
            "insurance_amount": 100,
            "commission_onmarket": 1000,
            "seller_username": "testing123",
            "invoice_onmarket": "INV/ONM/20240124-002B0001"
        },
        {
            "amount": 20000,
            "freight_charge": 5000,
            "insurance_amount": 100,
            "commission_onmarket": 1000,
            "seller_username": "testing12345",
            "invoice_onmarket": "INV/ONM/20240124-002B0002"
        }
    ]
}
```

<table border="1" id="bkmrk-properties-propertie" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 21.0136%;"></col><col style="width: 12.2373%;"></col><col style="width: 14.4609%;"></col><col style="width: 8.40681%;"></col><col style="width: 43.8813%;"></col></colgroup><tbody><tr><td>**Properties**  
</td><td>**Properties of**</td><td>**Data type**</td><td>**Required**</td><td>**Description**</td></tr><tr><td>total\_amount</td><td>  
</td><td>integer</td><td>yes</td><td>Total nominal amount for the invoice.</td></tr><tr><td>service</td><td>  
</td><td>string</td><td>yes</td><td>ONINDONESIA services.  
Possible values:

- ONDELIVERY means the source of the transaction comes from ondelivery.
- ONTICKET means the source of the transaction comes from onticket.
- ONMARKET means the source of the transaction comes from onmarket.

</td></tr><tr><td>source</td><td>  
</td><td>string</td><td>yes</td><td>A way that users pay for a product or service. Possible values: XENDIT, BALANCE, QRIS.</td></tr><tr><td>transaction</td><td> </td><td>array&lt;object&gt;</td><td>yes</td><td>List of transactions.</td></tr><tr><td>amount</td><td>transaction</td><td>integer</td><td>yes</td><td>Amount of transaction for each store (do not include freight charge and insurance as they'll put in other parameter).</td></tr><tr><td>freight\_charge</td><td>transaction</td><td>integer</td><td>yes</td><td>Amount of freight charge for each store.</td></tr><tr><td>insurance\_amount</td><td>transaction</td><td>integer</td><td>no</td><td>Amount of insurance for each store.</td></tr><tr><td>seller\_username</td><td>transaction</td><td>string</td><td>yes</td><td>Seller ONMARKET username</td></tr><tr><td>invoice\_onmarket</td><td>transaction</td><td>string</td><td>yes</td><td>Invoice ID generated by ONMARKET</td></tr><tr><td>commission\_onmarket</td><td>transaction</td><td>integer</td><td>yes</td><td>Commission amount charged to seller</td></tr></tbody></table>

<details id="bkmrk-result-example-body-"><summary>Response example</summary>

<p class="callout info">200 (OK)</p>

<p class="callout info">Example response for ONMARKET</p>

```json
{
    "payment_url": "https://checkout-staging.xendit.co/latest/65ba1b78f603539c068ef753",
    "invoice": "ONM0001N11V0000x",
    "xendit_invoice": "65ba1b78f603539c068ef753",
    "expired_at": "2024-01-31T12:05:44.155Z",
    "transaction": [
        {
            "invoice_onmarket": "INV/ONM/20240124-002B0001",
            "status": "PENDING"
        },
        {
            "invoice_onmarket": "INV/ONM/20240124-002B0002",
            "status": "PENDING"
        }
    ]
}
```

<table border="1" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 16.9448%;"></col><col style="width: 14.6341%;"></col><col style="width: 15.7895%;"></col><col style="width: 52.6316%;"></col></colgroup><tbody><tr><td>**Properties**  
</td><td>**Properties of**</td><td>**Data type**</td><td>**Description**</td></tr><tr><td>xendit\_invoice</td><td>  
</td><td>string</td><td>invoice ID generated by XENDIT and translated by USAPI</td></tr><tr><td>payment\_url</td><td>  
</td><td>string</td><td>Public URL for this invoice

</td></tr><tr><td>expired\_at</td><td>  
</td><td>timestampz</td><td>ISO date and time that the invoice expires.

</td></tr><tr><td>transaction</td><td>  
</td><td>array&lt;object&gt;</td><td>List of transactions

</td></tr><tr><td>invoice</td><td>transaction</td><td>string</td><td>Invoice ID generated by USAPI

</td></tr><tr><td>status</td><td>transaction</td><td>string</td><td>Status showing whether the invoice has been paid

Possible values:

- PENDING means the invoice has been successfully created but yet to be paid
- PAID means the invoice has been paid
- EXPIRED means the invoice expired before your customer paid

</td></tr></tbody></table>

<p class="callout info">Example for response ONMARKET with source QRIS</p>

```json
{
    "invoice": "ONM00001N14U00001",
    "xendit_invoice": "qr_7807d58a-3d60-4425-92f9-23d6717701f6",
    "qr_string": "00020101021226570011ID.DANA.WWW011893600915060486424802096048642480303UKE51440014ID.CO.QRIS.WWW0215ID20243148326170303UKE52048999530336054031005802ID5925PT OnIndonesia Sistem Tek6015Kota Jakarta Ut61051424062720115NT2YP2fE3fetkbx60490011ID.DANA.WWW0425MER2021071400774509608641050116304DE92",
    "amount": 100,
    "expired_at": "2024-04-30T05:00:52.643Z"
}
```

</details><details id="bkmrk-error-example-body-r"><summary>Error response</summary>

<p class="callout danger">400 Bad Request</p>

> Some parameters may contain invalid values or some parameters are not present.

```json
{
    "message": "Invalid JSON Format"
}
```

> Balance is not enough for doing transaction

```json
{
    "message": "Insufficient balance"
}
```

<p class="callout danger">401 Unauthorized</p>

> Authentication header is not valid or missing

```json
{
    "message": "Auth Error"
}
```

<p class="callout danger">500 Internal server error</p>

> Internal server error

```json
{
    "message": "Internal server error"
}
```

</details>

# Get invoice

##### Flowchart

<div drawio-diagram="65"><img src="https://documentation.onindonesia.id/uploads/images/drawio/2024-02/drawing-3-1706868356.png" alt=""/></div>

##### Endpoint

<table border="1" id="bkmrk-endpoint-method-auth" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><tbody><tr><td>**Endpoint**</td><td>**Method**  
</td><td>**Authentication**</td></tr><tr><td>/invoice/detail</td><td>GET</td><td>yes</td></tr></tbody></table>

##### Authentication

<table border="1" id="bkmrk-endpoint-method-serv" style="border-collapse: collapse; width: 100%; height: 59.75px;"><colgroup><col style="width: 29.5467%;"></col><col style="width: 45.5054%;"></col><col style="width: 24.9617%;"></col></colgroup><tbody><tr style="height: 29.875px;"><td style="height: 29.875px;">**Type**  
</td><td style="height: 29.875px;">**Token source**  
</td><td style="height: 29.875px;">**Server**  
</td></tr><tr style="height: 29.875px;"><td style="height: 29.875px;">Bearer</td><td style="height: 29.875px;">{{USAPI}}/auth</td><td style="height: 29.875px;">USAPI</td></tr></tbody></table>

##### Param request

<table border="1" id="bkmrk-properties-propertie" style="border-collapse: collapse; width: 100%; height: 59.5938px;"><colgroup><col style="width: 34.7245%;"></col><col style="width: 29.676%;"></col><col style="width: 35.5995%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Properties**  
</td><td style="height: 29.7969px;">**Required**</td><td style="height: 29.7969px;">**Description**</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">invoice</td><td style="height: 29.7969px;">yes</td><td style="height: 29.7969px;">invoice ID generated by USAPI</td></tr><tr><td><div><div>waybill_number</div></div></td><td>yes</td><td>Waybill Number generated by OSAS</td></tr></tbody></table>

Notes: Choose one of param request

link example:

demousapi.onindonesia.id/invoice/detail?invoice=OD0001N12D0000b

or

demousapi.onindonesia.id/invoice/detail?waybill\_number=OND132456A123

<details id="bkmrk-result-example-body-"><summary>Result example</summary>

<p class="callout info">200 OK</p>

```json
{
    "id": "21",
    "username": "usernew1",
    "type": "ONMARKET CHECKOUT",
    "amount": 10000,
    "xendit_invoice": "658bee8b8013d711637b9a7b",
    "invoice": "OM0001N0CR0000f",
    "status": "PAID",
    "src": "XENDIT",
    "xendit_url": "https://checkout-staging.xendit.co/web/658bee8b8013d711637b9a7b",
    "expired_at": "2023-12-27T11:29:47.812Z",
    "createdAt": "2023-12-27T09:29:48.025Z",
    "updatedAt": "2023-12-27T09:30:00.052Z"
}
```

</details><details id="bkmrk-error-example-body-r"><summary>Error example</summary>

<p class="callout danger">400 Bad request</p>

```json
{
    "message": "Invoice not found"
}
```

<p class="callout danger">401 Unauthorized</p>

```json
{
    "message": "Auth Error"
}
```

<p class="callout danger">500 Internal server error</p>

```json
{
    "message": "Internal Error"
}
```

</details>

# Invoice cancel

##### Endpoint

<table border="1" id="bkmrk-endpoint-method-auth" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><tbody><tr><td>**Endpoint**</td><td>**Method**  
</td><td>**Authentication**</td></tr><tr><td>/invoice/cancel</td><td>POST</td><td>yes</td></tr></tbody></table>

##### Authentication

<table border="1" id="bkmrk-endpoint-method-serv" style="border-collapse: collapse; width: 100%; height: 59.757px;"><colgroup><col style="width: 39.3078%;"></col><col style="width: 60.6922%;"></col></colgroup><tbody><tr style="height: 29.8785px;"><td style="height: 29.8785px;">**Type**  
</td><td style="height: 29.8785px;">**Auth type**  
</td></tr><tr style="height: 29.8785px;"><td style="height: 29.8785px;">Basic</td><td style="height: 29.8785px;">Login and password same as USAPI Login</td></tr></tbody></table>

##### Body request

```json
{
  "platform": "ONMARKET",
  "invoice_id": "OM0003d0CS00009",
  "invoice_onmarket": "INV/ONM/20240124-002B0001",
  "buyer_username": "usernew1"
}
```

<table border="1" id="bkmrk-properties-propertie" style="border-collapse: collapse; width: 100%; height: 142.422px;"><colgroup><col style="width: 18.7886%;"></col><col style="width: 18.7886%;"></col><col style="width: 11.1248%;"></col><col style="width: 9.88875%;"></col><col style="width: 41.4091%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Properties**  
</td><td style="height: 29.7969px;">**Properties of**</td><td style="height: 29.7969px;">**Data type**</td><td style="height: 29.7969px;">**Required**</td><td style="height: 29.7969px;">**Description**</td></tr><tr><td>platform</td><td>  
</td><td>string</td><td>yes</td><td>ONINDONESIA services.  
Possible values:

- ONDELIVERY means the source of the transaction comes from ondelivery.
- ONTICKET means the source of the transaction comes from onticket.
- ONMARKET means the source of the transaction comes from onmarket.

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">invoice\_id</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">yes</td><td style="height: 29.7969px;">invoice ID generated by USAPI</td></tr><tr><td>invoice\_onmarket</td><td>  
</td><td>string</td><td>no<sup>1</sup></td><td>Invoice ID generated by ONMARKET

<sup>1</sup>if status of the invoice is PAID, it will be refunded to buyer's balance from each store. So invoice\_onmarket is required.

</td></tr><tr style="height: 82.8281px;"><td style="height: 82.8281px;"><div><div>buyer_username</div></div></td><td style="height: 82.8281px;">  
</td><td style="height: 82.8281px;">string</td><td style="height: 82.8281px;">no<sup>1</sup></td><td style="height: 82.8281px;">Username from buyer

<sup>1</sup>if status of the invoice is PAID, it will be refunded to buyer's balance. So buyer's username is required.

</td></tr></tbody></table>

<details id="bkmrk-result-example-body-"><summary>Result example</summary>

<p class="callout info">200 OK (Invoice status is PAID)</p>

```json
{
  "message": "REFUND IN PROCESS"
}
```

<p class="callout info">200 OK (Invoice status is PENDING)</p>

```json
{
  "message": "INVOICE CANCELED"
}
```

</details><details id="bkmrk-error-example-body-r"><summary>Error example</summary>

<p class="callout danger">400 Bad request</p>

```json
{
    "message": "REFUND ALREADY IN PROCESS"
}
```

```json
{
    "message": "TRANSACTION IS ALREADY CANCELED"
}
```

```json
{
    "message": "EXPIRED INVOICE"
}
```

<p class="callout danger">500 Internal server error</p>

```json
{
    "message": "INTERNAL SERVER ERROR"
}
```

</details>

# Invoice done/completed

##### Update log:

April 24th, 2024

Change Auth from Bearer to Basic

##### Endpoint

<table border="1" id="bkmrk-endpoint-method-auth" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><tbody><tr><td>**Endpoint**</td><td>**Method**  
</td><td>**Authentication**</td></tr><tr><td>/invoice/done</td><td>POST</td><td>yes</td></tr></tbody></table>

##### Authentication

<table border="1" id="bkmrk-endpoint-method-serv" style="border-collapse: collapse; width: 100%; height: 59.757px;"><colgroup><col style="width: 29.5467%;"></col><col style="width: 45.5054%;"></col><col style="width: 24.9617%;"></col></colgroup><tbody><tr style="height: 29.8785px;"><td style="height: 29.8785px;">**Type**  
</td><td style="height: 29.8785px;">**Token source**  
</td><td style="height: 29.8785px;">**Server**  
</td></tr><tr style="height: 29.8785px;"><td style="height: 29.8785px;">Basic</td><td style="height: 29.8785px;">Login and password same as USAPI Login</td><td style="height: 29.8785px;">USAPI</td></tr></tbody></table>

##### Body request

```json
{
  "platform": "ONMARKET",
  "invoice_id": "OM0003d0CS00009",
  "invoice_onmarket": "INV/ONM/20240124-002B0001"
}
```

<table border="1" id="bkmrk-properties-propertie" style="border-collapse: collapse; width: 100%; height: 142.422px;"><colgroup><col style="width: 18.7886%;"></col><col style="width: 18.7886%;"></col><col style="width: 11.1248%;"></col><col style="width: 9.88875%;"></col><col style="width: 41.4091%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Properties**  
</td><td style="height: 29.7969px;">**Properties of**</td><td style="height: 29.7969px;">**Data type**</td><td style="height: 29.7969px;">**Required**</td><td style="height: 29.7969px;">**Description**</td></tr><tr><td>platform</td><td>  
</td><td>string</td><td>yes</td><td>ONINDONESIA services.  
Possible values:

- ONDELIVERY means the source of the transaction comes from ondelivery.
- ONTICKET means the source of the transaction comes from onticket.
- ONMARKET means the source of the transaction comes from onmarket.

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">invoice\_id</td><td style="height: 29.7969px;">  
</td><td style="height: 29.7969px;">string</td><td style="height: 29.7969px;">yes</td><td style="height: 29.7969px;">invoice ID generated by USAPI</td></tr><tr><td>invoice\_onmarket</td><td>  
</td><td>string</td><td>no<sup>1</sup></td><td>Invoice ID generated by ONMARKET

<sup>1</sup>if status of the invoice is PAID, it will be refunded to buyer's balance from each store. So invoice\_onmarket is required.

</td></tr></tbody></table>

<details id="bkmrk-result-example-body-"><summary>Result example</summary>

<p class="callout info">200 OK (Invoice status is PAID)</p>

```json
{
  "message": "TRANSACTION IS COMPLETED"
}
```

</details><details id="bkmrk-error-example-body-r"><summary>Error example</summary>

<p class="callout danger">400 Bad request</p>

```json
{
    "message": "REFUND ALREADY IN PROCESS"
}
```

```json
{
    "message": "TRANSACTION IS ALREADY CANCELED"
}
```

```json
{
    "message": "EXPIRED INVOICE"
}
```

```json
{
    "message": "TRANSACTION IS ALREADY COMPLETED"
}
```

<p class="callout danger">500 Internal server error</p>

```json
{
    "message": "INTERNAL SERVER ERROR"
}
```

</details>

# Balance

Balance related process including get, increment and decrement.

# Get balance

##### Endpoint

<table border="1" id="bkmrk-endpoint-method-auth" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><tbody><tr><td>**Endpoint**</td><td>**Method**  
</td><td>**Authentication**</td></tr><tr><td>/balance</td><td>GET</td><td>yes</td></tr></tbody></table>

##### Authentication

<table border="1" id="bkmrk-endpoint-method-serv" style="border-collapse: collapse; width: 100%; height: 59.757px;"><colgroup><col style="width: 29.5467%;"></col><col style="width: 45.5054%;"></col><col style="width: 24.9617%;"></col></colgroup><tbody><tr style="height: 29.8785px;"><td style="height: 29.8785px;">**Type**  
</td><td style="height: 29.8785px;">**Token source**  
</td><td style="height: 29.8785px;">**Server**  
</td></tr><tr style="height: 29.8785px;"><td style="height: 29.8785px;">Bearer</td><td style="height: 29.8785px;">{{USAPI}}/auth

</td><td style="height: 29.8785px;">usapi.onindonesia.id

demousapi.onindonesia.id

</td></tr></tbody></table>

#####   


<details id="bkmrk-result-example-body-"><summary>Result example</summary>

<p class="callout info">200 OK</p>

```json
{
    "balance": 40000
}
```

</details><details id="bkmrk-error-example-body-r"><summary>Error example</summary>

<p class="callout danger">401 Unauthorized</p>

```json
{
    "message": "Auth Error"
}
```

</details>

# Bank List

##### Endpoint

<table border="1" id="bkmrk-endpoint-method-auth" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><tbody><tr><td>**Endpoint**</td><td>**Method**  
</td><td>**Authentication**</td></tr><tr><td><div><div>/bank/list</div></div></td><td>POST</td><td>no</td></tr></tbody></table>

##### Authentication

<table border="1" id="bkmrk-endpoint-method-serv" style="border-collapse: collapse; width: 100%; height: 59.757px;"><colgroup><col style="width: 29.5467%;"></col><col style="width: 45.5054%;"></col><col style="width: 24.9617%;"></col></colgroup><tbody><tr style="height: 29.8785px;"><td style="height: 29.8785px;">**Type**  
</td><td style="height: 29.8785px;">**Token source**  
</td><td style="height: 29.8785px;">**Server**  
</td></tr><tr style="height: 29.8785px;"><td style="height: 29.8785px;">none</td><td style="height: 29.8785px;"> </td><td style="height: 29.8785px;"> </td></tr></tbody></table>

##### Body request

```json
{
    "bank_name": <string>,
    "channel_type": <string>
}
```

<table border="1" id="bkmrk-properties-propertie" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 18.7886%;"></col><col style="width: 18.7886%;"></col><col style="width: 11.1248%;"></col><col style="width: 9.91942%;"></col><col style="width: 41.3785%;"></col></colgroup><tbody><tr><td>**Properties**  
</td><td>**Properties of**</td><td>**Data type**</td><td>**Required**</td><td>**Description**</td></tr><tr><td>bank\_name</td><td>  
</td><td>string</td><td>yes</td><td>Name of the bank</td></tr><tr><td>channel\_type</td><td>  
</td><td>string</td><td>yes</td><td>Bank channel type.

Available types:

1. <div>Bank</div>
2. <div><div>E-Wallet</div></div>

</td></tr></tbody></table>

<details id="bkmrk-result-example-body-"><summary>Result example</summary>

<p class="callout info">200 (OK)</p>

```javascript
[
    {
        "id": 22,
        "bank_channel": "ID_BOC",
        "description": "Bank of China (BOC)",
        "type": "Bank",
        "currency": "IDR",
        "alias": null
    }
]
```

</details><details id="bkmrk-error-example-body-r"><summary>Error example</summary>

<p class="callout danger">Body request example</p>

```javascript
insert code here
```

</details>