Skip to content

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_addressThay toàn bộ địa chỉ: gửi đủ mọi field. option_ship phải hợp lệ.
skip_verify_addresstrue / 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.

HTTPmessageKhi nào
400a requested lineitem is pending for update, cannot be updatedMột line bạn gửi vẫn đang được xác thực lại: chờ vài giây
400order cannot be updated in its current fulfillment statusĐơn đã trừ tiền, đang sản xuất hoặc đã huỷ
400validation error, chi tiết trong errorVí dụ validation failed: quantity must be greater than 0
400unsupported shipping option
400a requested lineitem is cancelled, cannot be updated
404order not found
409order was not created via APIĐơn tạo từ CSV, Shopify… — hãy sửa trong app seller
422invalid system sku: NOPE-SKUHoặ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ợ.