Skip to content

Giữ đơn, nhả giữ và huỷ ship ​

Dành cho chăm sóc khách hàng: giữ (hold) một đơn trong lúc người mua quyết định, rồi nhả giữ (release) hoặc huỷ. Ba route này áp dụng cho đơn từ mọi nguồn của store, giống các nút Hold / Resume / Cancel trong app seller, và trả về cùng một dạng: data = {order_id, order_number, order_code, result, hold, cancel_kind, refund_amount, items, cs_hold}.

Đơn đang ở giai đoạn nào: cs_hold ​

GET /orders/query.json và mọi response của các route này đều có cs_hold:

json
{
  "stage": "on_hold",
  "production_started": false,
  "can_hold": true,
  "can_cancel": true,
  "cancel_kind": "cancel",
  "hold": {
    "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
    "reason": "design",
    "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
    "note": "Buyer is sending a new photo",
    "source": "cs-hub",
    "requested_by": "[email protected]",
    "reference": "CS-1234",
    "until": "2026-11-20T00:00:00Z",
    "held_at": "2026-11-10T11:55:35.883986Z",
    "released_at": null
  }
}
Key
stagepre_production (chưa trừ tiền), on_hold, error, fulfilling (đã trừ tiền, chưa sản xuất), in_production, shipped, cancelled, external, unknown
can_holdCó thể giữ đơn ngay lúc này (đơn chưa bị trừ tiền).
production_startedItem đang hoặc đã được sản xuất.
can_cancel, cancel_kindCancel-ship lúc này có dùng được không, và sẽ làm gì: cancel (chưa sản xuất gì), cancel-produce (dừng sản xuất), cancel-ship (đã làm xong, sẽ không ship).
holdLần giữ đơn đang mở của bạn, hoặc null.

Luồng gợi ý: can_hold → cho phép Hold; nếu không thì can_cancel → cho phép Cancel (cancel_kind cho biết sẽ mất gì); nếu không nữa thì đơn đã ship và không làm gì được trong Pawdo.

Giữ đơn (hold) ​

POST {base_url}/api/integration/orders/hold.json

Field
order_id hoặc order_numberbắt buộc một trong haiorder_number được thử đúng như gửi, rồi thử có / không có dấu # ở đầu.
reasonbắt buộcdesign, variant, cancel, address, other, check, customer, agency, leader
note≤ 2000
requested_by≤ 255Ai yêu cầu (chữ tự do).
reference≤ 64Mã ticket của bạn.
untilRFC 3339Thời điểm bạn dự kiến nhả giữ. Chỉ để tham khảo: Pawdo không bao giờ tự nhả giữ.
source≤ 32Nhãn hệ thống của bạn; mặc định cs-hub.
bash
curl -X POST "{base_url}/api/integration/orders/hold.json" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"order_number": "DOCS-185527-H", "reason": "design", "note": "Buyer is sending a new photo", "requested_by": "[email protected]", "reference": "CS-1234", "until": "2026-11-20T00:00:00Z"}'
json
{
  "data": {
    "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
    "order_number": "DOCS-185527-H",
    "order_code": "PD290-9320",
    "result": "held",
    "hold": {
      "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
      "reason": "design",
      "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
      "note": "Buyer is sending a new photo",
      "source": "cs-hub",
      "requested_by": "[email protected]",
      "reference": "CS-1234",
      "until": "2026-11-20T00:00:00Z",
      "held_at": "2026-11-10T11:55:35.883986163Z",
      "released_at": null
    },
    "cs_hold": {
      "stage": "on_hold",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": {
        "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
        "reason": "design",
        "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
        "note": "Buyer is sending a new photo",
        "source": "cs-hub",
        "requested_by": "[email protected]",
        "reference": "CS-1234",
        "until": "2026-11-20T00:00:00Z",
        "held_at": "2026-11-10T11:55:35.883986Z",
        "released_at": null
      }
    }
  },
  "message": "order on hold",
  "status": true
}

Giữ một đơn đang bị giữ sẽ trả result: already_held và giữ nguyên lý do đầu tiên. Đơn đã bị trừ tiền thì không giữ được — lỗi 409 kèm cs_hold, và cách xử lý là cancel-ship:

json
{
  "data": {
    "order_id": "6321be4b-5079-4dbb-9d56-52a997129efc",
    "order_number": "#1002",
    "order_code": "PD290-9249",
    "hold": null,
    "cs_hold": {
      "stage": "in_production",
      "production_started": true,
      "can_hold": false,
      "can_cancel": true,
      "cancel_kind": "cancel-produce",
      "hold": null
    }
  },
  "error_code": "ALREADY_IN_PRODUCTION",
  "message": "the order is in production; it can no longer be held, only cancelled (cancel-ship)",
  "status": false
}

Nhả giữ (release) ​

POST {base_url}/api/integration/orders/release.json

Field
order_id hoặc order_numberbắt buộc một trong hai
outcomebắt buộccontinue, changed hoặc cancel
note, requested_by
outcomePawdo làm gìresult
continue / changedChạy tiếp đơn và xác thực lại; đơn được trừ tiền theo lịch.resumed
continue / changed, có người trong Pawdo cũng đang giữ đơnĐóng lần giữ của bạn; đơn vẫn bị giữ.released_kept
continue / changed, Pawdo đã gỡ giữ trước đóĐóng lần giữ của bạn.released_not_held
cancelĐóng lần giữ và huỷ đơn, như cancel-ship.cancelled

changed nghĩa là thay đổi của người mua đã được thực hiện trong Pawdo trước khi nhả giữ — bằng PATCH /orders/{id}.json với đơn tạo qua API, hoặc trong app seller. Nhả giữ thêm lần nữa trả already_released.

bash
curl -X POST "{base_url}/api/integration/orders/release.json" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e", "outcome": "continue", "note": "Buyer kept the design", "requested_by": "[email protected]"}'
json
{
  "data": {
    "order_id": "5cd24b56-a3f5-4d71-8105-61c5188cd24e",
    "order_number": "DOCS-185527-H",
    "order_code": "PD290-9320",
    "result": "resumed",
    "hold": {
      "id": "27932d01-3f3d-4324-ad61-8c7ccfcba7a0",
      "reason": "design",
      "reason_label": "Chờ khách xác nhận thiết kế / ảnh",
      "note": "Buyer is sending a new photo",
      "source": "cs-hub",
      "requested_by": "[email protected]",
      "reference": "CS-1234",
      "until": "2026-11-20T00:00:00Z",
      "held_at": "2026-11-10T11:55:35.883986Z",
      "released_at": "2026-11-10T11:55:35.920654194Z",
      "release_outcome": "continue",
      "release_note": "Buyer kept the design",
      "released_by": "[email protected]"
    },
    "cs_hold": {
      "stage": "pre_production",
      "production_started": false,
      "can_hold": true,
      "can_cancel": true,
      "cancel_kind": "cancel",
      "hold": null
    }
  },
  "message": "hold released",
  "status": true
}

Huỷ ship (cancel-ship) ​

POST {base_url}/api/integration/orders/cancel-ship.json

Huỷ bất kỳ đơn nào của store chưa được bàn giao cho hãng vận chuyển: Pawdo sẽ không giao đơn và hoàn phí fulfillment vào số dư của store — kể cả các item đã sản xuất.

Field
order_id hoặc order_numberbắt buộc một trong hai
reasonbắt buộcCùng các giá trị như hold.
note, requested_by, reference
bash
curl -X POST "{base_url}/api/integration/orders/cancel-ship.json" \
  -H "X-pawdo-access-token: $PAWDO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"order_id": "a2b05603-3d78-470f-bd3e-8bbe9f88acaa", "reason": "cancel", "requested_by": "[email protected]"}'
json
{
  "data": {
    "order_id": "a2b05603-3d78-470f-bd3e-8bbe9f88acaa",
    "order_number": "#1004",
    "order_code": "PD290-9313",
    "result": "cancelled",
    "hold": null,
    "cancel_kind": "cancel-produce",
    "refund_amount": 20,
    "items": [
      {
        "id": "05e9c08d-3fe9-4cc4-9a77-4f429c5511d0",
        "print_code": 2572833,
        "sku": "SOC-M",
        "status": "cancel-produce",
        "cancelled_at": "2026-11-10T11:55:36.326938Z"
      },
      {
        "id": "2a8cf2ca-447c-460a-a353-e23e1f06ceca",
        "print_code": 2572834,
        "sku": "GP-L1",
        "status": "cancel-produce",
        "cancelled_at": "2026-11-10T11:55:36.326938Z"
      }
    ],
    "cs_hold": {
      "stage": "cancelled",
      "production_started": false,
      "can_hold": false,
      "can_cancel": false,
      "cancel_kind": "",
      "hold": null
    }
  },
  "message": "order cancelled",
  "status": true
}

cancel_kind là việc đã làm; refund_amount là số tiền đã hoàn (không có khi chưa trừ tiền gì); items là từng đơn vị kèm trạng thái mới — cancel-produce (sẽ không sản xuất) hoặc cancel-ship (đã làm xong, sẽ không ship). Gọi lại trả already_cancelled và không hoàn thêm tiền.

Lỗi của ba route ​

HTTPerror_codeKhi nàodata
400BAD_REQUESTBody không phải JSON
404ORDER_NOT_FOUNDStore không có đơn này
409ALREADY_IN_PRODUCTIONHold: đơn đã bị trừ tiền hoặc đang sản xuấtcs_hold
409ALREADY_SHIPPEDHold hoặc cancel: đã bàn giao cho hãng vận chuyểncs_hold
409ORDER_CANCELLEDHold: đơn đã bị huỷcs_hold
409ORDER_EXTERNALĐơn được fulfill ngoài Pawdocs_hold
409NOT_HOLDABLEHold: đơn đang ở errorcs_hold
409NOT_ON_HOLDRelease: bạn chưa từng giữ đơn nàycs_hold
409ORDER_BUSYCancel: đơn đang được gửi sang sản xuất — thử lại sau một phútcs_hold
409NOT_CANCELLABLECancel: bị từ chối ở giai đoạn nàycs_hold
409AMBIGUOUS_ORDERorder_number khớp nhiều đơn — hãy gửi order_idorder_ids
422VALIDATION_FAILEDThiếu field hoặc field không hợp lệ, ví dụ validation failed: reason must be one of [design variant cancel address other check customer agency leader]
422NO_STORE_OWNERStore không có tài khoản chủ để thực hiện việc huỷ — liên hệ Pawdo
500Chưa có gì được ghi. Gửi lại an toàn.

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ợ.