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