创建或更新订单

详细字段参考以英文显示;字段名和 API 值保持不变。

POST
/api/order/upsert

请求

store_nameRequired existing store name.
orders[]Required nonempty order list.
orders[].order_numberRequired source order number.
orders[].statusawaiting, canceled or shipped.
orders[].items[]Order items; supply item_id or sku, quantity and applicable item values.
orders[].ship_to, bill_toV1 address objects.
orders[].order_date, ship_by_date, paid_dateExisting V1 date fields.
orders[].currency, shipping_amount, tax_amount, amount_paid, order_totalExisting V1 monetary fields.
orders[].payment_method, payment_status, requested_serviceOptional order details.
orders[].buyer_note, internal_note, dimension_unit, weight_unitOptional order metadata and units.
orders[].items[].item_id, variant_id, sku, quantity, name, image_urlItem identity and content; sku supplies item_id if absent.
orders[].items[].currency, shipping_amount, tax_amount, unit_priceItem monetary values.
orders[].items[].package_type, length, width, height, dimension_unit, weight, weight_unitItem 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.