跳到主要内容
版本:202201

创建订单

POST 

/openapi/2022-01/orders

商家可代替顾客创建订单。

请求

请求体

    line_items object[]必填

    List of products

  • Array [
  • variant_idstring必填
    product_idstring必填
    quantityint32必填

    Quantity of line item

  • ]
  • shipping_address object必填

    Shipping address

    first_namestring

    First name of consignee.

    last_namestring必填

    Last name of consignee.

    phonestring

    Phone number, for example: +86 150 1447 1143

    emailstring必填
    countrystring必填

    Country, for example: United States

    country_codestring必填

    Country code, for example: US

    provincestring必填

    Province, for example: New Mexico

    province_codestring必填

    Province Code, for example: NM

    areastring
    citystring必填

    City, for example: SAN JOSE

    addressstring必填

    Street address, for example: 1 Rue des Carrieres

    address1string

    Apartment/floor/room number, for example: Suite 1234

    zipstring

    ZIP code, for example: 87036

    companystring

    Company, for example: ABC Limited

    latitudefloat

    Latitude of the delivery address, for example: 22.54

    longitudefloat

    Longitude of the delivery address, for example: 114.06

    tagsstring[]
    默认值: ["Tags"]
    tax_totalstring必填

    Order tax, numeric string, for example: "9.99"

    currency_codestring必填

    Currency code of the order, e.g. "USD"

    discountstring

    Discount amount or percent for the order, discount amount cannot be greater than total price of line items, e.g. "10.00", "10%"

    notestring

    Note of the order

    payment_linestring

    Payment method of the order, If you fill in "COD" and the merchant switch on cod, it is cod payment method, else if the merchant switch off "cod" ,you fill in anything it will automatically fill in the default payment method configured by the merchant in the store's admin. if you create a completed payment order, where 'payment_line' refers to the final method of payment. if you create an unpaid order, where 'payment_line' is just a suggested method of payment, not the final method that goes through the checkout process.

    shipping_line object
    namestring必填

    Name of shipping line, for example: "Free Shipping"

    shipping_pricestring必填

    Shipping price, numeric string, for example: "10.00", "0"

    descstring

    Description of shipping line

    tagsstring[]

    Tags of the order

响应

200

数据结构
    order object
    idstring
    示例: 633130-00000005
    notestring
    示例: note
    numberstring
    示例: 00000005
    financial_statusstring
    示例: waiting
    statusstring
    示例: opened
    cancel_reason
    payment_methodstring
    示例: none
    fulfillment_statusstring
    示例: initialled
    discount_codestring
    示例: bk:5bed44bd-5bee-44b8-97e4-96307341d9fb
    discount_applicationsstring
    示例: [{"type":"discount_code","code":"bk:5bed44bd-5bee-44b8-97e4-96307341d9fb","discount_id":"c9d74464-ffa1-4464-9197-1a1640419ab4","discount_amount":10,"entitled_product_list":[{"product_id":"a1a88be0-a1d4-47e4-a2f2-ba6e131cf447","variant_id":"88e68830-4ef5-4125-bf7d-aef8047176b2","price":"10.10","quantity":1,"compare_at_price":"12.10","inventory_tracking":false,"inventory_quantity":0,"spu":"T-M","collection_ids":null}],"value_type":"fixed_amount","target_type":"line_item","target_selection":"all","discount_type":"fixed_amount","title":"666","price_rule_id":"53293dc7-a234-44ee-bcab-c165a78b28e7"}]
    customer_notestring
    示例:
    landing_sitestring
    示例:
    buyer_accepts_marketingboolean
    默认值: true
    示例: false
    currencystring
    示例: USD
    total_pricestring
    示例: 15.20
    total_discountstring
    示例: 10.00
    total_taxstring
    示例: 10.10
    total_shippingstring
    示例: 5.00
    sub_totalstring
    示例: 10.10
    code_discount_totalstring
    示例: 10.00
    line_item_discount_totalstring
    示例: 0.00
    tagsstring
    示例: Test tag,openapi
    created_atstring
    示例: 2024-04-19T08:09:04Z
    updated_atstring
    示例: 2024-04-19T08:09:06Z
    canceled_at
    customer_deleted_at
    deleted_at
    placed_at
    total_refund_pricestring
    示例: 0.00
    total_refund_taxstring
    示例: 0.00
    total_refund_discountstring
    示例: 0.00
    refund_status
    total_tip_receivedstring
    示例: 0.00
    browser_ipstring
    示例: 183.15.177.205
    sourcestring
    示例:
    last_landing_urlstring
    示例:
    email_statusstring
    示例: waiting
    recovery_statusstring
    示例: waiting
    total_paidstring
    示例: 0.00
    source_name object
    datastring
    示例:
    created_atstring
    示例:
    last_referrer_show object
    datastring
    示例:
    created_atstring
    示例:
    shipping_line object
    namestring
    示例: test
    customer object
    idstring
    示例: 2dd957e3-2051-4cdf-8584-9c0046b4d1ae
    emailstring
    first_namestring
    示例: ryan
    last_namestring
    示例: zhang
    phonestring
    示例: 19873264342
    created_atstring
    示例: 2024-04-18T09:29:24Z
    updated_atstring
    示例: 2024-04-19T08:09:04Z
    orders_countinteger
    默认值: 0
    示例: 0
    total_spentstring
    示例:
    shipping_address object
    first_namestring
    示例: Ryan
    last_namestring
    示例: Zhang
    address1string
    示例: 1 Rue des Carrieres
    address2string
    示例: Suite 1234
    phonestring
    示例: 19873264342
    citystring
    示例: 北京
    zipstring
    示例: 87036
    provincestring
    示例: Beijing
    countrystring
    示例: China mainland
    companystring
    示例: ABC Limited
    latitudestring
    示例: 22.540000
    longitudestring
    示例: 114.060000
    namestring
    示例: Ryan Zhang
    country_codestring
    示例: CN
    province_codestring
    示例: CN-BJ
    phone_area_codestring
    示例:
    emailstring
    areastring
    示例: Bay area
    extra_info
    billing_address
    payment_line
    payment_lines
    line_items object[]
  • Array [
  • idstring
    示例: 21d66bba-06a7-4bac-a9e5-02b0e42e8062
    product_idstring
    示例: a1a88be0-a1d4-47e4-a2f2-ba6e131cf447
    variant_idstring
    示例: 88e68830-4ef5-4125-bf7d-aef8047176b2
    variant_titlestring
    示例: S-blue-T
    product_titlestring
    示例: shirt
    product_handlestring
    示例: shirt
    quantityinteger
    默认值: 0
    示例: 1
    notestring
    示例:
    fulfillment_statusstring
    示例: waiting
    skustring
    示例: T-M-S-blue-T-A001004
    weight_unitstring
    示例: kg
    vendorstring
    示例: shoplazza
    product_urlstring
    示例: /products/shirt
    compare_at_pricestring
    示例: 12.10
    imagestring
    示例: //img.staticdj.com/ccf0794c594bad32a320eea0d6bfe40c.jpeg
    pricestring
    示例: 10.10
    totalstring
    示例: 10.10
    weightstring
    示例: 1.10
    properties object[]
  • Array [
  • namestring
    示例: size
    valuestring
    示例: S
  • ]
  • custom_properties
    refund_quantityinteger
    默认值: 0
    示例: 0
    refund_totalstring
    示例: 0.00
    base_pricestring
    示例: 10.10
    discount_applicationsstring
    示例:
    duty_pricestring
    示例: 0.00
    tax_pricestring
    示例: 0.00
  • ]
  • fulfillments object[]
  • Array [
  • object
  • ]
  • gift_card_totalstring
    示例: 0.00
    shipping_tax_totalstring
    示例: 0.00
    product_tax_includedboolean
    默认值: true
    示例: false
    refer_infostring
    示例: {"default_payment":"bogus_gateway","inventory_deduction":"order_created","ip":"183.15.177.205","source":"back","user_agent":"Apifox/1.0.0 (https://apifox.com)"}
    additional_totalstring
    示例: 0.00
    additional_prices object[]
  • Array [
  • object
  • ]
  • logistics_codestring
    示例:
    config object
    page_typestring
    示例: three_step
    requires_shippingboolean
    默认值: true
    示例: false
    checkout_business_typeinteger
    默认值: 0
    示例: 0
    product_tax_includedboolean
    默认值: true
    示例: false
    checkout_template_typeinteger
    默认值: 0
    示例: 0
    market_setting
    invoice_urlstring
    示例: https://zhangsenjun-shoplazza.stg.myshoplaza.com/checkout/633130-00000005?key=087ea25dea0be6c1ceab312119ed26