建立或更新訂單
詳細欄位參考以英文顯示;欄位名稱和 API 值保持不變。
/api/order/upsert請求
store_name | Required existing store name. |
|---|---|
orders[] | Required nonempty order list. |
orders[].order_number | Required source order number. |
orders[].status | awaiting, canceled or shipped. |
orders[].items[] | Order items; supply item_id or sku, quantity and applicable item values. |
orders[].ship_to, bill_to | V1 address objects. |
orders[].order_date, ship_by_date, paid_date | Existing V1 date fields. |
orders[].currency, shipping_amount, tax_amount, amount_paid, order_total | Existing V1 monetary fields. |
orders[].payment_method, payment_status, requested_service | Optional order details. |
orders[].buyer_note, internal_note, dimension_unit, weight_unit | Optional order metadata and units. |
orders[].items[].item_id, variant_id, sku, quantity, name, image_url | Item identity and content; sku supplies item_id if absent. |
orders[].items[].currency, shipping_amount, tax_amount, unit_price | Item monetary values. |
orders[].items[].package_type, length, width, height, dimension_unit, weight, weight_unit | Item packaging values. |
{
"store_name": "<existing-store-name>",
"orders": [
{
"order_number": "ERP-1001",
"status": "awaiting",
"items": [
{
"item_id": "line-1",
"sku": "SKU-001",
"quantity": 1
}
]
}
]
}回傳結果
Requires an existing store_name and nonempty orders array. Each order needs order_number, status and items; accepted statuses are awaiting, canceled and shipped (other statuses are skipped by the checked controller). Each item needs item_id or sku; if item_id is absent, sku supplies it. The response is an array of order results. This existing import/upsert behavior is not V2 order CRUD or a separate fulfillment purchase.
V1 responses use the original endpoint-specific JSON structure. Do not wrap them in the V2 code/message/data envelope.
串接說明
Requires an existing store_name and nonempty orders array. Each order needs order_number, status and items; accepted statuses are awaiting, canceled and shipped (other statuses are skipped by the checked controller). Each item needs item_id or sku; if item_id is absent, sku supplies it. The response is an array of order results. This existing import/upsert behavior is not V2 order CRUD or a separate fulfillment purchase.