# 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>