v1

latestOpenAPI 3.0.02026-07-26318168886.7 KB
Orders

Create Order

To create an order with open API<br>透過open API創建一筆新訂單

post/orders

Query parameters

include_fields[]string[]

Provide additional attributes in the response<br>結果添加哪些參數

fields[]string[]

Only return the provided fields in the responses<br>結果只包含輸入的參數<br> This parameter will override include_fields[]<br>此參數會覆蓋include_fields[]。

[
  "fields[]=id"
]

Request body

is_registering_as_memberboolean

Do you want to set the customer as a member?<br>是否要將此筆訂單顧客設為會員?<br>-<br>*Default: false

is_inventory_fulfillmentboolean

Do you want to deduct the inventory numbers after the order is created?<br>此筆訂單是否要扣掉庫存?<br>-<br>*Default:false

mail_notifyboolean

Do you want to notify the customer of the order creation by email ?<br>此筆訂單成立之後是否要通知顧客?<br>-<br>*Default:false

Example request

{
  "order": {
    "delivery_option_id": "58d3379401cda31bfb000000",
    "payment_method_id": "58d25b9d01cda3475300002d",
    "subtotal": 3699,
    "total": 3199,
    "items": [
      {
        "item_type": "Product",
        "item_id": "5adedc00e388094414000033",
        "variation_id": "66b09f05879c87001594d9b8",
        "item_price": 999,
        "quantity": 1,
        "total": 999
      }
    ],
    "customer_id": "5e0047dfc4101900263b1450",
    "customer_email": "flash@shopline.com",
    "customer_phone": "0910123456",
    "customer_phone_country_code": "852",
    "customer_name": "Flash",
    "customer_birthday": "1980-01-01",
    "customer_gender": "male",
    "expired_at": "2018-01-01 00:00:00",
    "confirmed_at": "2018-01-01 00:00:00",
    "auth_token_expired_at": "2018-01-01 00:00:00",
    "order_remarks": "For order memo",
    "created_from": "admin_openapi",
    "delivery_address": {
      "country_code": "TW",
      "country": "台灣",
      "city": "台北市",
      "district": "台北",
      "address_1": "光復北路11巷44號14樓",
      "address_2": "松山區",
      "recipient_name": "SHOPLINE"
    },
    "user_credit": 30,
    "member_point": 120,
    "opt_in_auto_reward": true
  },
  "is_registering_as_member": true,
  "is_inventory_fulfillment": true
}

Response

OK

idstring

Order ID<br>訂單ID

order_numberstring

Order Number<br>訂單號碼

system_order_numberstring

系统生成的訂單號

merchant_order_numberstring

店家自定義訂單號<br>(會根據rollout_key選擇用哪個order_number)

status'temp' | 'pending' | 'removed' | 'confirmed' | 'completed' | 'cancelled'

Order Status<br>訂單狀態<br> -<br> 網店訂單 Status allows:<br> temp 暫存狀態<br> pending 處理中<br> removed 已刪除<br> confirmed 已確認<br> completed 已完成<br> cancelled 已取消<br> <br> POS 訂單 Status allows:<br> confirmed 已確認<br> completed 已完成<br> cancelled 已取消<br>

is_guest_checkoutboolean

是否為訪客結帳

order_remarksstring

Order Remarks<br>訂單備註

customer_idstring

Cutomer ID<br>顧客ID

customer_namestring

Customer's Name<br>顧客姓名

customer_emailstring

Customer's Email<br>顧客Email

customer_phonestring

Customer's Phone<br>顧客電話

customer_phone_country_codestring

Customer's Phone Country Code<br>顧客電話國碼

currency_isostring

Currency ISO (ISO-4217)<br>ISO 4217 貨幣代碼

order_pointsinteger

Points used<br>會員點數使用

custom_dataobject[]

Customized Order Fields<br>客製化欄位<br>-<br>*欲使用此欄位請先至商店後台>訂單設定>自訂訂單欄位 進行設定

ref_order_idstring

For third party custom order id<br>可供儲存第三方訂單ID

ref_customer_idstring

For third party custom customer id<br>可供儲存第三方顧客ID

parent_order_idstring

Parent Order ID<br>拆單後之母訂單ID

child_order_idsstring[]

Child Order ID<br>拆單後之子訂單ID

split_atstring

Order Split Time<br>拆單時間

confirmed_atstring

Order Confirmed Time<br>訂單確認時間<br>(如尚未確認則顯示null)

updated_atstring

Order Updated Time<br>訂單更新時間<br>*UTC Time

created_atstring

Order Created Time<br>訂單創造日期<br>*UTC Time

edited_atstring

Order Edit Time<br>訂單修改日期<br>*UTC Time

completed_atstring

Order Completed Time<br>訂單完成日期<br>*UTC Time

skip_fulfillmentboolean

Is order skipping fulfillment?<br>訂單是否略過“扣減庫存”

ga_trackedboolean

Is tracked by GA?<br>是否使用GA追蹤

created_by'openapi' | 'admin' | 'shop' | 'shop_crm' | 'pos' | 'sc' | 'mc' | 'import'

Channel that created the order<br>建立訂單的渠道

agent_idstring nullable

Agent ID that created the order<br>代理建立訂單的操作者 ID<br> Only provided when include_fields contains 'agent_id'<br> 僅於include_fields傳入 'agent_id' 時提供

affiliate_dataobject

Affiliate Data<br>聯屬網絡營銷數據

default_warehouse_idstring

The default warehouse ID of the created_by_channel of the order. If the created_by_channel is blank, this field will be the default warehouse ID of the online channel.<br> 訂單 created_by_channel 預設的倉庫 ID。如果 created_by_channel 為空,則此欄位將是 online channel 的 default_warehouse_id。

type'general' | 'preorder' | 'return' | 'exchange'

Order type<br>訂單類型<br> The field is only available for POS orders (created_by: pos)<br> 此欄位僅適用於POS訂單 (created_by: pos) - general: 一般訂單<br> - preorder: 預訂單<br> - return: 退貨單<br> - exchange: 換貨單<br>

tagsstring[]

Order tags<br>商品標籤

inclusive_tax_infoobject

inclusive tax information<br>內含稅信息

product_subscription_periodinteger

Product Subscription Period<br>定期購期數

allow_customer_cancelboolean

Allow Customer Cancel<br>允許顧客取消訂單