Skip to main content

Invoice cancel

Endpoint
Endpoint Method
Authentication
/invoice/cancel POST yes
Authentication
Type
Auth type
Basic Login and password same as USAPI Login
Body request
{
  "platform": "ONMARKET",
  "invoice_id": "OM0003d0CS00009",
  "invoice_onmarket": "INV/ONM/20240124-002B0001",
  "buyer_username": "usernew1"
}
Properties
Properties of Data type Required Description
platform
string yes

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.
invoice_id
string yes invoice ID generated by USAPI
invoice_onmarket
string no1

Invoice ID generated by ONMARKET

 

1if status of the invoice is PAID, it will be refunded to buyer's balance from each store. So invoice_onmarket is required.

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"
}