Skip to content

Cập nhật đơn hàng (Integration)

Chỉ cho phép cập nhật khi fulfillment_status thuộc một trong các trạng thái: on_hold, unfulfilled, payment_awaiting, ready

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

Method: PATCH

Request Header

keyvalue
X-pawdo-access-tokenAPI KEY

Path Params

keytyperequirednote
iduuidRequiredID của đơn hàng cần cập nhật

Request Body

  • Content-Type: application/json
keytyperequirednote
skip_verify_addressbooleanOptionalBỏ qua bước verify địa chỉ
shipping_addressobjectOptionalThông tin địa chỉ giao hàng
line_itemsarray objectOptionalDanh sách sản phẩm cần cập nhật

Chi tiết field

shipping_address

keytyperequirednote
namestringOptionalTên người nhận
emailstringOptionalEmail người nhận
phonestringOptionalSố điện thoại
address1stringOptionalĐịa chỉ 1
address2stringOptionalĐịa chỉ 2
citystringOptionalThành phố
statestringOptionalBang / tỉnh
countrystringOptionalQuốc gia
postal_codestringOptionalMã bưu điện
country_codestringOptionalMã quốc gia (ISO)
province_codestringOptionalMã bang / tỉnh
option_shipstringOptionalPhương thức vận chuyển
label_shipurlOptionalURL label shipping: : Bắt buộc cho option tiktok
taxnumberOptionalThuế

line_items(required)

keytyperequirednote
iduuidRequiredID của line item
skustringOptionalSKU từ hệ thống ngoài
system_skustringRequiredSKU nội bộ hệ thống
titlestringOptionalTên sản phẩm
notestringOptionalGhi chú
designsarray objectOptionalDanh sách thiết kế/mockup của line item, tối đa 15 phần tử. Mỗi phần tử gồm: key (string, định danh slot, ví dụ design1, design2...), design (url, optional — file thiết kế), mockup (url, optional — hình mockup)
quantitynumberRequiredSố lượng sản phẩm, min > 0 và max < 1000

Example (Request)

json
{
  "skip_verify_address": true,
  "shipping_address": {
    "tax": 1.2,
    "city": "Corryton",
    "name": "John Doe",
    "email": "[email protected]",
    "phone": "",
    "state": "Tennessee",
    "country": "United States",
    "address1": "6056 Whisper Ridge Lane",
    "address2": "1234 Whisper Ridge Lane",
    "label_ship": "https://example.pdf",
    "option_ship": "standard",
    "postal_code": "37721",
    "country_code": "US",
    "province_code": "TN"
  },
  "line_items": [
  
    {
      "id": "b6828234-82ec-47df-88f5-9bc9a81b6ba6",
      "sku": "",
      "system_sku": "QTR-XS2",
      "title": "no title",
      "note": "bom ne",
      "designs": [ 
        {
          "key": "design1", 
          "design": "https://example.com/design1.png",
          "mockup": "https://example.com/mockup1.png" 
        } 
      ],
      "quantity": 13
    }
  ]
}

Example (Response thành công)

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

Example (Response lỗi)

status codemessagenote
400order cannot be updated in its current fulfillment statusorder không thuộc 1 trong 4 trạng thái được phép update
400a requested lineitem is pending for update, cannot be updatedline item đang chờ validate lần update trước
400a requested lineitem is cancelled, cannot be updatedline item đã bị huỷ
404order not foundkhông tìm thấy order theo id (hoặc order không thuộc store của API key)
422invalid system sku: <giá trị>system_sku gửi lên không khớp SKU nào đang active

Nếu cần hỗ trợ thêm về thông tin hoặc cách sử dụng API, vui lòng liên hệ đội ngũ hỗ trợ Pawdo qua Facebook để được hỗ trợ.