Cập nhật đơn hàng
PATCH {base_url}/api/integration/orders/{id}.json
Chỉ áp dụng cho đơn tạo qua API này, khi fulfillment_status là unfulfilled, on_hold, payment_awaiting hoặc ready. Chỉ gửi phần thay đổi:
| Field | |
|---|---|
shipping_address | Thay toàn bộ địa chỉ: gửi đủ mọi field. option_ship phải hợp lệ. |
skip_verify_address | true / false. Đặt lại false thì địa chỉ được xác thực lại. |
line_items[] | Bắt buộc id (của line), system_sku và quantity (1–999); sku, title, note, designs thay giá trị đang lưu — line gửi lên mà không có note sẽ mất ghi chú. Các line của một combo phải được gửi cùng nhau, cùng số lượng. |
bash
curl -X PATCH "{base_url}/api/integration/orders/f4a795d5-8c5b-4c33-a987-b5640f87857b.json" \
-H "X-pawdo-access-token: $PAWDO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"shipping_address": {"name": "Jane Doe", "option_ship": "standard", "address1": "1600 Amphitheatre Pkwy", "address2": "Building 40", "city": "Mountain View", "state": "California", "province_code": "CA", "country": "United States", "country_code": "US", "postal_code": "94043", "email": "[email protected]", "phone": "+1 650-253-0000"}, "line_items": [{"id": "ea7e9a40-7aa4-47ca-aed0-7891401565e6", "system_sku": "QTN-S", "quantity": 2, "note": "two please"}]}'json
{
"message": "order updated",
"status": true
}Các line đã sửa ở trạng thái pending cho tới khi Pawdo xác thực lại (vài giây); đơn đang ready sẽ đi lại bước xác thực và được trừ tiền sau, theo giá mới.
| HTTP | message | Khi nào |
|---|---|---|
| 400 | a requested lineitem is pending for update, cannot be updated | Một line bạn gửi vẫn đang được xác thực lại: chờ vài giây |
| 400 | order cannot be updated in its current fulfillment status | Đơn đã trừ tiền, đang sản xuất hoặc đã huỷ |
| 400 | validation error, chi tiết trong error | Ví dụ validation failed: quantity must be greater than 0 |
| 400 | unsupported shipping option | |
| 400 | a requested lineitem is cancelled, cannot be updated | |
| 404 | order not found | |
| 409 | order was not created via API | Đơn tạo từ CSV, Shopify… — hãy sửa trong app seller |
| 422 | invalid system sku: NOPE-SKU | Hoặc: một line của combo bị sửa tách khỏi combo |
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ợ.