Skip to content

Huỷ đơn hàng tạo qua API ​

PATCH {base_url}/api/integration/orders/cancel.json

Field
order_idbắt buộc
lineitem_idsCác line cần huỷ. Để trống: huỷ cả đơn.
  • Chưa trừ tiền: huỷ cả đơn hoặc một số line.
  • Đã trừ tiền (paid, error, awaiting, processing): chỉ huỷ được cả đơn. Số tiền đã trừ được hoàn vào số dư của store, kể cả với item đã sản xuất.
bash
curl -X PATCH "{base_url}/api/integration/orders/cancel.json" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"order_id": "d689c4d1-f3dc-4c3b-ba65-ceb494ac0cec", "lineitem_ids": ["aad33abd-01be-4953-bd81-ed408da7ff6d"]}'
json
{
  "message": "order cancelled",
  "status": true
}
HTTPmessageKhi nào
400validation failed, chi tiết trong errorThiếu order_id
404order not found
409order was not created via APIDùng cancel-ship
422order has already been cancelled
422order is pending, please try again laterĐơn đang được gửi sang sản xuất: thử lại sau một phút
422partial cancellation is not allowed for paid orders
422order cannot be cancelled in current statusĐã ship
500failed to cancel orderCũng xảy ra khi một phần tử của lineitem_ids không phải line của đơn, hoặc đã bị huỷ. Không có gì thay đổi.

Để huỷ bất kỳ đơn nào của store, có lý do và số tiền hoàn trong response, hãy dùng cancel-ship.


Nếu có bất kỳ vấn đề nào liên quan đến API, vui lòng liên hệ bộ phận support của Pawdo qua Facebook để được hỗ trợ.