Skip to content

Cancel order (entire order or by individual line item)

API : /api/integration/orders/cancel.json

Method: PATCH

Request Header

keyvalue
X-pawdo-access-tokenAPI KEY

Request Body (JSON - raw)

keytyperequirednote
order_iduuidRequiredID of the order to cancel
lineitem_idsuuid[]OptionalList of line item IDs to cancel

Note

  • If lineitem_ids is provided: the system will only cancel the specified line items.
  • If not provided or an empty array [] is passed: the system will cancel the entire order.
  • The elements in lineitem_ids must be valid UUIDs; empty strings "" are not allowed.

Cancellation rules by order status

  • Orders that have not paid the fulfillment cost (fulfillment_cost_paid has no value): can be cancelled entirely or by individual line item as desired.
  • Orders that have paid the fulfillment cost: can only be cancelled entirely (partial cancellation is not allowed) — if lineitem_ids does not include all the remaining line items of the order, the API returns the error partial cancellation is not allowed for paid orders.
  • Orders in the pending status: cannot be cancelled right away, the API returns the error order is pending, please try again later.
  • Orders already in a cancelled status (cancel, cancel-produce, cancel-ship, cancel-shipout): the API returns the error order has already been cancelled.
  • Orders that have been paid but are in a status that does not allow cancellation (not one of error, paid, awaiting, processing): the API returns the error order cannot be cancelled in current status.

Example (Request)

json
{
  "order_id": "425ec1f5-****-48b0-9acc-4093811a8ced",
  "lineitem_ids": [
    "c10d3fff-****-488b-90ac-3714a74da0e7"
  ]
}

Example (Successful Response)

json
{
  "message": "order cancelled", 
  "status": true
}

Example (Error Response)

status codemessagenote
400invalid request bodybody is not in the correct format
400validation failedmissing order_id, or lineitem_ids contains an invalid uuid
404order not foundno order found for the given order_id
422order is pending, please try again laterorder is awaiting a fulfill request
422order has already been cancelledorder is already in a cancelled status
422order cannot be cancelled in current statusorder has been paid but is in a status that does not allow cancellation
422partial cancellation is not allowed for paid ordersorder has been paid, only full cancellation is allowed

Example error response (422):

json
{
  "message": "order is pending, please try again later",
  "status": false
}

If you encounter any issues related to the cancel order API, please contact the Pawdo support team via Facebook for assistance.