Invoice cancel
Endpoint
| Endpoint | Method |
Authentication |
| /invoice/cancel | POST | yes |
Authentication
| Type |
Token source |
Server |
| Bearer | {{USAPI}}/auth | USAPI |
Body request
{
"id"invoice_id": "OM0003d0CS00009",
"buyer_username": "usernew1"
}
| Properties |
Properties of | Data type | Required | Description |
| string | yes | invoice ID generated by USAPI | ||
|
buyer_username
|
string | no1 |
Username from buyer
1if status of the invoice is PAID, it will be refunded to buyer's balance. So buyer's username is required. |
Result example
200 OK (Invoice status is PAID)
{
"message": "REFUND IN PROCESS"
}
200 OK (Invoice status is PENDING)
{
"message": "INVOICE CANCELED"
}
Error example
400 Bad request
{
"message": "REFUND ALREADY IN PROCESS"
}
{
"message": "TRANSACTION IS ALREADY CANCELED"
}
{
"message": "EXPIRED INVOICE"
}
500 Internal server error
{
"message": "INTERNAL SERVER ERROR"
}