需要 write_draft_orders 权限点。
更多权限点使用信息,请参考:
POST https://{handle}.myshopline.com/admin/openapi/v20260301/orders/draft_orders.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
为用户创建一个草稿单。
请求头
  • Content-Type string required
    字段值固定为 application/json; charset=utf-8
  • Authorization string required
    资源的访问令牌。参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入。
    例子:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
请求体
  • draft_orderobject
    草稿单对象。
  • billing_addressobject
    用于邮寄账单发票的地址。
  • address1 string
    账单地址的第一行。通常是街道地址或邮政信箱编号等信息。
    最大长度限制:256
  • address2 string
    账单地址的第二行。通常是公寓、套房或单元等信息。
    最大长度限制:256
  • area string
    账单地址中的区或县。
    最大长度限制:64
  • area_code string
    账单地址中区或县的编码。
    例子: 510007
  • city string
    账单地址中的城市。
    最大长度限制:64
  • city_code string
    账单地址中城市的编码。
    例子: 510000
  • company string
    账单收件人的公司名称。
    最大长度限制:64
  • country string
    账单地址的国家或地区。
    最大长度限制:64
  • country_code string
    账单地址中国家或地区的二位国家码,遵循 ISO 3166-1 国际标准。
    例子: US
  • email string
    账单收件人的邮箱。
  • first_name string
    账单收件人的名。
    最大长度限制:64
  • last_name string
    账单收件人的姓。
    最大长度限制:64
  • phone string
    账单收件人的手机号码。
  • postcode string
    账单地址中的邮编信息。
  • province string
    账单地址中的省份。
  • province_code string
    账单地址中省份的编码,该编码可以是自定义编号或者为二位的 ISO 3166-2 国际编码。
    例子: 4220006
  • same_as_receiver boolean
    表示账单地址 billing_address 是否与收货地址 shipping_address 是一样的。
    • true: 相同
    • false: 不同
    默认值:true
  • calc_sku_stock_mode string required
    用于标识库存模式,有效枚举值包含:
    • not_limit: 无限库存
    • real: 真实库存
    • reserve_real: 预留库存与真实库存
    例子: string
  • customerobject
    买家信息。
  • area_code string
    手机区号。
    例子: +1
  • email string
    买家的邮箱地址。
  • first_name string
    买家的名。
    最大长度限制:64
  • id string required
    买家 ID。
    例子: string
  • last_name string
    买家的姓。
    最大长度限制:64
  • phone string
    买家的手机号。
    最大长度限制:32
  • discount_amount_ext string
    订单折扣金额。数值保留到小数点后两位。
  • discount_amount_ext_name string
    订单折扣说明。
    最大长度限制:64
  • discountable boolean
    Deprecated
    该字段自 API 版本 v20251201 起已废弃。
  • language_infoobject required
    语种信息。
  • customer_language string
    买家侧下单语种,优先使用此语种。
    例子: en
  • merchant_language string
    卖家侧下单语种,优先使用买家侧语种。
    例子: en
  • line_itemsobject[] required
    商品信息列表。
  • applied_discountobject
    商品折扣信息。
  • description string
    折扣说明。
  • title string
    Deprecated
    该字段自 API 版本 v20251201 起已废弃。
  • value long required
    折扣数额。当 value_typepercentage 时,此值最大默认100,最小为0。
  • value_type string required
    折扣类型。有效枚举值包含
    • fix_amount:固定金额
    • percentage:百分比
    例子: string
  • discountable boolean
    Deprecated
    该字段自 API 版本 v20251201 起已废弃。
  • gift_card boolean
    Deprecated
    该字段自 API 版本 v20251201 起已废弃。
  • price string
    商品售价。
  • product_id string required
    款式对应的商品的唯一标识 ID。
    例子: 16056761559984840457934011
  • product_source string required
    商品来源。有效枚举值包含:
    • main_site: 在线商店的商品
    • customize: 自定义商品
    例子: string
  • propertiesobject[]
    商品定制信息。
  • name string
    自定义属性名称。
  • show boolean
    定制信息是否可见。有效枚举值包含:
    • true: 可见
    • false: 不可见
  • type string
    定制信息类型。有效枚举值包含:
    • text:字符类型
    • picture:图片类型
    • link:链接类型
  • urls array
    URL 列表。
    • 如果 typepicture,可通过 urls 获取缩略图。
    • 如果 typelink,那么超链接为 urls 的第一个。
  • value string
    自定义属性值。
  • quantity integer required
    草稿单中的商品数量。
    取值范围:1-99999
  • requires_shipping boolean
    商品是否需要发货。
    • true: 需要发货
    • false: 不需要发货
    默认值:false
  • sku string
    商家定义的商品货号。
    最大长度限制:255
  • taxable boolean
    商品是否需要收税。
    • true: 需要收税
    • false: 不需要收税
    默认值:true
  • title string
    商品标题。
  • variant_id string required
    款式的唯一标识 ID。
    例子: 18056761559987524812644011
  • market_region_country_code string
    所在市场的国家或区域码。遵循 ISO 3166 国际标准。
    例子: US
  • note string
    草稿单备注。
    最大长度限制:1024
  • note_attributesobject[]
    草稿单附加信息。
  • name string
    附加属性的名称。
  • value string
    附加属性的值。
  • outer_id string
    客户端生成的唯一请求 ID,相同 ID 的请求只会被处理一次。
  • payment_termsobject
    付款信息。
  • pay_channel_id string required
    支付方式的唯一标识符 ID。
    例子: string
  • pay_status string
    付款状态。有效枚举值包含:
    • unpaid: 未支付
    • paid: 已支付
    默认:unpaid
  • payment_channel_name string
    支付渠道名称。
  • shipping_addressobject
    收件人的收货地址信息。
  • address1 string
    收货地址的第一行。通常是街道地址或邮政信箱编号等信息。
    最大长度限制:256
  • address2 string
    收货地址的第二行。通常是公寓、套房或单元等信息。
    最大长度限制:256
  • city string
    收货地址中的城市。
    最大长度限制:64
  • city_code string
    收货地址中城市的编码。
    例子: 510000
  • company string
    收件人的公司名称。
  • country string
    收货地址的国家或地区。
    最大长度限制:64
  • country_code string
    收货地址中国家或地区的二位国家码,遵循 ISO 3166-1 标准。
    例子: US
  • district string
    收货地址中的区或县。
    最大长度限制:64
  • district_code string
    收货地址中区或县的编码。
    例子: 510007
  • first_name string
    收件人的名。
  • last_name string
    收件人的姓。
  • phone string
    收件人的手机号码。
  • province string
    收货地址中的省份。
  • province_code string
    收货地址中省份的编码,该编码可以是自定义编号或者为二位的 ISO 3166-2 国际编码。
    例子: 4220006
  • zip string
    收货地址中的邮编信息。
    例子: 510036
  • shipping_linesobject
    物流信息。
    shipping_typesystem 时,须传入 delivery_id
    shipping_typecustom 时,须传入 titleprice
    当期望免运费时,shipping_type 须传 custom, 同时必须传入 titleprice,且 price 值须设置为 0
  • delivery_id string
    运费模板 ID。
  • price string
    自定义运费金额,数值保留到小数点后两位。
  • shipping_type string required
    物流类型。有效枚举值包含:
    • system: 系统物流
    • custom:自定义物流
    例子: string
  • title string
    物流承运商名称。
  • stock_reserved boolean required
    订单维度是否有保留商品标识。
    • true: 有保留商品标识
    • false: 无保留商品标识
  • stock_reserved_time long
    订单维度保留商品时间,格式为 13 位毫秒级时间戳。
    例子: 1667638652832
  • tags array
    订单标签列表,多个用英文逗号分隔。 最大个数限制:99
  • tax_exempt boolean
    该商品是否需要收税。
    • true: 需要收税
    • false: 不需要收税
状态码
更多状态码信息,参考 HTTP 状态码

响应头
  • traceId
    请求的全局唯一标识符。用于追踪请求在系统中的流转,以便于问题发生时进行定位和调试。
响应体
  • draft_orderobject
    草稿单对象。
  • billing_addressobject
    用于邮寄账单发票的地址。
  • address1 string
    账单地址的第一行。通常是街道地址或邮政信箱编号等信息。
    例子: 8899 Garfield Street
  • address2 string
    账单地址的第二行。通常是公寓、套房或单元等信息。
    例子: Apartment 5
  • area string
    账单地址中的区或县。
    例子: Panyu District
  • area_code string
    账单地址中区或县的编码。
    例子: 510007
  • city string
    账单地址中的城市。
    例子: Guangzhou City
  • city_code string
    账单地址中城市的编码。
    例子: 510000
  • company string
    账单收件人的公司名称。
    例子: Company Name
  • country string
    账单地址的国家或地区。
    例子: United States
  • country_code string
    账单地址中国家或地区的二位国家码,遵循 ISO 3166-1 国际标准。
    例子: US
  • email string
    账单收件人的邮箱。
    例子: test001@Gmail.com
  • first_name string
    账单收件人的名。
    例子: Tom
  • last_name string
    账单收件人的姓。
    例子: Washington
  • phone string
    账单收件人的手机号码。
    例子: 13903004000
  • province string
    账单地址中的省份。
    例子: New York State
  • province_code string
    地址中省份的编码,该编码是系统自定义编号。
    例子: 4220006
  • same_as_receiver boolean
    表示账单地址 billing_address 是否与收货地址 shipping_address 是一样的。
    • true: 相同
    • false: 不同
  • standard_province_code string
    账单地址中省份的编码,该编码为二位的 ISO 3166-2 国际编码,区别于 province_code 返参为自定义编码。
    例子: NY
  • zip string
    收货地址的邮政编号。
  • create_at long
    草稿单的创建时间,格式为 13 位毫秒级时间戳。
    例子: 1667638652832
  • currency string
    店铺币种。该字段值为三位币种码,遵循 ISO 4217 标准。
    例子: USD
  • customerobject
    买家信息。
  • area_code string
    手机区号。
    例子: +1
  • email string
    买家的邮箱地址。
    例子: test001@Gmail.com
  • first_name string
    买家的名。
    例子: Tom
  • id string
    买家ID。
    例子: 4201057495
  • last_name string
    买家的姓。
    例子: Washington
  • phone string
    买家的手机号。
    例子: 13903004000
  • discount_amount_ext string
    订单折扣金额。数值保留到小数点后两位。
    例子: 8.00
  • discount_amount_ext_name string
    订单折扣名称。
  • discount_amount_ext_setobject
    订单优惠金额信息。
  • presentment_moneyobject
    展示给买家的订单优惠金额信息。
  • amount string
    订单优惠金额。数值保留到小数点后两位。
    例子: 8.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的订单优惠金额信息。
  • amount string
    订单优惠金额。数值保留到小数点后两位。
    例子: 8.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • id string
    草稿单的唯一标识符 ID。
  • invoice_url string
    草稿单账单链接。
    例子: https://xxx.com/xxxx
  • line_itemsobject[]
    商品信息列表。
  • applied_discountobject
    商品自定义折扣信息。
  • amount string
    应用折扣后的金额。
    例子: 8.00
  • amount_setobject
    折扣金额的详细信息。
  • presentment_moneyobject
    展示给买家的商品折扣金额信息。
  • amount string
    商品折扣金额。数值保留到小数点后两位。
    例子: 8.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的商品折扣金额信息。
  • amount string
    商品折扣金额。数值保留到小数点后两位。
    例子: 8.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • before_amount string
    商品售价。
    例子: 8.00
  • before_amount_setobject
    商品售价信息。
  • presentment_moneyobject
    展示给买家的商品售价信息。
  • amount string
    商品售价金额。数值保留到小数点后两位。
    例子: 8.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的商品售价信息。
  • amount string
    商品售价金额。数值保留到小数点后两位。
    例子: 8.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • description string
    折扣说明。
  • title string
    Deprecated
    该字段自 API 版本 v20251201 起已废弃。
  • value long
    折扣数额。当折扣类型为 percentage 时,此值最大默认100,最小为0。
  • value_type string
    折扣类型。
    • fixed_amount: 固定金额
    • percentage: 百分比
  • gift_card boolean
    是否为礼品卡商品。
    • true: 是
    • false: 不是
  • id string
    商品行 ID,唯一确认一个商品行。
  • image_url string
    商品图片 URL。
    例子: https://xxx.com/xxxx
  • name string
    商品的 SKU 标题。
  • price string
    商品参加自定义折扣后的金额。数值保留到小数点后两位。
    例子: 2.00
  • price_setobject
    商品参加自定义折扣后的金额。
  • presentment_moneyobject
    展示给买家的商品自定义折扣后金额信息。
  • amount string
    商品自定义折扣后金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的商品自定义折扣后金额信息。
  • amount string
    商品自定义折扣后金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • product_id string
    商品的唯一标识符 ID。
    例子: 16056577393789045351043258
  • product_source string
    商品来源。有效枚举值包含:
    • main_site: 在线商店的商品
    • customize: 自定义商品。
  • propertiesobject[]
    商品定制信息列表。
  • name string
    自定义属性名称。
    例子: colors
  • show boolean
    定制信息是否可见。有效枚举值包含:
    • true: 可见
    • false: 不可见
  • type string
    定制信息类型。有效枚举值包含:
    • text:字符类型
    • picture:图片类型
    • link:链接类型
  • urls array
    URL 列表。
    • 如果 typepicture,可通过 urls 获取缩略图。
    • 如果 typelink,那么超链接为 urls 的第一个。
  • value string
    自定义属性值。
    例子: red
  • quantity integer
    商品数量。
  • requires_shipping boolean
    商品是否需要发货。
    • true: 需要发货
    • false: 不需要发货
  • sku string
    商家定义的商品货号。
  • tax_linesobject[]
    税费信息。
  • name string
    税费名称。
  • price string
    税费金额。
  • price_setobject
    金额信息。
  • presentment_moneyobject
    展示给买家的税费金额信息。
  • amount string
    税费金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的税费金额信息。
  • amount string
    税费金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • rate double
    税率。
  • type string
    税费类型。有效枚举值:
    • product_tax:商品税
    • shipping_tax:运费税
    • duty_tax:关税
    例子: shipping_tax
  • title string
    商品款式的标题。
  • variant_id string
    款式的唯一标识 ID。
  • variant_title string
    商品 SKU 标题。
  • logistics_price string
    运费总金额。
  • logistics_price_setobject
    运费总金额。
  • presentment_moneyobject
    展示给买家的运费总金额信息。
  • amount string
    运费总金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的运费总金额信息。
  • amount string
    运费总金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • logistics_tax string
    运费总税费。
  • logistics_tax_setobject
    运费总税费。
  • presentment_moneyobject
    展示给买家的运费总税费金额信息。
  • amount string
    运费总税费金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的运费总税费金额信息。
  • amount string
    运费总税费金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • market_name string
    市场名称。
  • market_region_country_code string
    市场下的国家或区域。遵循 ISO 3166 国际标准。
    例子: US
  • note string
    草稿单备注。
  • note_attributesobject[]
    草稿单附加信息。
  • name string
    附加属性的名称。
  • value string
    附加属性的值。
  • order_id string
    Deprecated
    该字段自 API 版本 v20251201 起已废弃。
  • payment_termsobject
    支付条款和付款信息。
  • created_at string
    支付条款创建时间。
    格式:ISO 8601
    例子: 2024-08-31T02:20:26+08:00
  • due_in_days integer
    在选定的付款条件模板中定义的发票日期和到期日之间的天数。当 payment_terms_type 类型为 NET 时提供。
  • id string
    支付条款的唯一识别 ID。
  • overdue boolean
    支付条款是否超时。
    • true: 超时
    • false: 未超时
  • pay_channel_id string
    支付渠道的 ID。
  • pay_status string
    支付状态。有效枚举值包括:
    • unpaid: 未支付
    • paid: 已支付
  • payment_channel_name string
    支付渠道名称。
  • payment_schedulesobject[]
    与付款条件相关联的一组时间表。
  • completed_at string
    记录支付完成的日期和时间。
  • due_at string
    支付条款到期的日期和时间。
    payment_terms_type 值为 FIXED 时,due_at 必有值。
    payment_terms_type 值为 NET 时,due_at 的值为 issued_atdue_in_days
    payment_terms_type 值为 FULFILLMENT 时,仅在订单发货时有值。
  • issued_at string
    支付条款生效的日期和时间。
    payment_terms_type 值为 FIXED 时,如果 issued_at 为空,则 issued_at 等于 due_at
    payment_terms_type 值为 NET 时,issued_at 一定有值。
    payment_terms_type 值为 FULFILLMENT 时,仅在订单发货时有值。
    payment_terms_type 值为 RECEIPT 时,仅在发送账单时有值。
    例子: 2024-08-31T02:20:26+08:00
  • payment_terms_name string
    付款条件模板的名称。
  • payment_terms_type string
    付款条件模板类型。有效枚举值:
    • FIXED: 指定日期前全额付款
    • FULFILLMENT: 订单发货时全额付款
    • RECEIPT: 发送账单时全额付款
    • NET: 净付款
  • updated_at string
    支付条款的更新时间。
    格式:ISO 8601
    例子: 2024-08-31T02:20:26+08:00
  • po_number string
    B2B场景在订单上记录的采购订单号。
  • presentment_currency_code string
    市场币种。
  • product_tax string
    商品总税费。
  • product_tax_setobject
    商品总税费,分别以买家币种金额和店铺币种金额展示。
  • presentment_moneyobject
    展示给买家的商品总税费金额信息。
  • amount string
    商品总税费金额。数值保留到小数点后两位。
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的商品总税费金额信息。
  • amount string
    商品总税费金额。数值保留到小数点后两位。
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • seller_id string
    商户 ID。
  • shipping_addressobject
    收件人的收货地址。
  • address1 string
    收货地址的第一行。通常是街道地址或邮政信箱编号等信息。
    例子: 8899 Garfield Street
  • address2 string
    收货地址的第二行。通常是公寓、套房或单元等信息。
    例子: Apartment 5
  • city string
    收货地址中的城市。
    例子: Guangzhou City
  • city_code string
    收货地址中城市的编码。
    例子: 510000
  • company string
    收件人的公司名称。
    例子: Company Name
  • country string
    收货地址的国家或地区。
    例子: China
  • country_code string
    收货地址中国家或地区的二位国家码,遵循 ISO 3166-1 国际标准。
    例子: US
  • district string
    收货地址中的区或县。
    例子: Panyu District
  • district_code string
    收货地址中区或县的编码。
    例子: 510007
  • first_name string
    收件人的名。
    例子: Tom
  • last_name string
    收件人的姓。
    例子: Washington
  • name string
    收件人的全名。
  • phone string
    收件人的手机号码。
    例子: 13903004000
  • province string
    收货地址中的省份。
    例子: Guangdong Province
  • province_code string
    地址中省份的编码,该编码是系统自定义编号。
    例子: 4220006
  • standard_province_code string
    地址中省份的编码,该编码为二位的 ISO 3166-2 国际编码,区别于 province_code 返参为自定义编码。
    例子: NY
  • zip string
    收货地址中的邮编信息。
    例子: 510036
  • shipping_linesobject
    物流信息。
    shipping_typesystem 时,须传入 delivery_id
    shipping_typecustom 时,须传入 titleprice
    当期望免运费时,shipping_type 须传 custom, 同时必须传入 titleprice,且 price 值须设置为 0
  • delivery_id string
    运费模板 ID。
  • price string
    物流运费。
  • price_setobject
    物流运费。
  • presentment_moneyobject
    展示给买家的物流运费金额信息。
  • amount string
    物流运费金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的物流运费金额信息。
  • amount string
    物流运费金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shipping_type string
    物流类型:
    • system: 系统物流
    • custom: 自定义物流
  • title string
    物流名称。
  • status integer
    草稿单状态。有效枚举值包含:
    • open: 处理中
    • completed: 已完成
  • stock_reserved boolean
    订单维度是否有保留商品标识。
    • true: 有保留商品标识
    • false: 无保留商品标识
  • stock_reserved_time long
    订单维度保留商品时间,格式为 13 位毫秒级时间戳。
    例子: 1669280400000
  • store_id string
    店铺的唯一标识符 ID。
  • tags array
    标签列表,多个标签间用英文逗号分隔。
  • tax_linesobject[]
    税费信息。
  • name string
    税费信息名称。
  • price string
    金额。
  • price_setobject
    税费信息。
  • presentment_moneyobject
    展示给买家的税费金额信息。
  • amount string
    税费金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的税费金额信息。
  • amount string
    税费金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • rate double
    税率。
  • type string
    税费类型。有效枚举值:
    • product_tax:商品税
    • shipping_tax:运费税
    • duty_tax:关税
  • total_duties_setobject
    总关税。
  • presentment_moneyobject
    展示给买家的总关税金额信息。
  • amount string
    总关税金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的总关税金额信息。
  • amount string
    总关税金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • total_line_items_price string
    当前草稿单商品总金额。
  • total_line_items_price_setobject
    当前草稿单商品总金额信息。
  • presentment_moneyobject
    展示给买家的当前草稿单商品总金额信息。
  • amount string
    当前草稿单商品总金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的当前草稿单商品总金额信息。
  • amount string
    当前草稿单商品总金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • total_price string
    当前草稿单总金额,为商品售价减去折扣,再加上税费与运费的总和。
  • total_price_setobject
    总金额。
  • presentment_moneyobject
    展示给买家的总金额信息。
  • amount string
    总金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • shop_moneyobject
    商家侧记录的总金额信息。
  • amount string
    总金额。数值保留到小数点后两位。
    例子: 2.00
  • currency_code string
    三位币种码,遵循 ISO 4217 标准。
    例子: CNY
  • update_at long
    草稿单的更新时间,格式为 13 位毫秒级时间戳。
    例子: 1667638652832
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20260301

ParamOptions

header required

Body

required
{
  "draft_order": {
    "billing_address": {
      "address1": null,
      "address2": null,
      "area": null,
      "area_code": "510007",
      "city": null,
      "city_code": "510000",
      "company": null,
      "country": null,
      "country_code": "US",
      "email": null,
      "first_name": null,
      "last_name": null,
      "phone": null,
      "postcode": null,
      "province": null,
      "province_code": "4220006",
      "same_as_receiver": null
    },
    "calc_sku_stock_mode": "string",
    "customer": {
      "area_code": "+1",
      "email": null,
      "first_name": null,
      "id": "string",
      "last_name": null,
      "phone": null
    },
    "discount_amount_ext": null,
    "discount_amount_ext_name": null,
    "discountable": null,
    "language_info": {
      "customer_language": "en",
      "merchant_language": "en"
    },
    "line_items": [
      {
        "applied_discount": {
          "description": null,
          "title": null,
          "value": 0,
          "value_type": "string"
        },
        "discountable": null,
        "gift_card": null,
        "price": null,
        "product_id": "16056761559984840457934011",
        "product_source": "string",
        "properties": [
          {
            "name": null,
            "show": null,
            "type": null,
            "urls": null,
            "value": null
          }
        ],
        "quantity": 0,
        "requires_shipping": null,
        "sku": null,
        "taxable": null,
        "title": null,
        "variant_id": "18056761559987524812644011"
      }
    ],
    "market_region_country_code": "US",
    "note": null,
    "note_attributes": [
      {
        "name": null,
        "value": null
      }
    ],
    "outer_id": null,
    "payment_terms": {
      "pay_channel_id": "string",
      "pay_status": null,
      "payment_channel_name": null
    },
    "shipping_address": {
      "address1": null,
      "address2": null,
      "city": null,
      "city_code": "510000",
      "company": null,
      "country": null,
      "country_code": "US",
      "district": null,
      "district_code": "510007",
      "first_name": null,
      "last_name": null,
      "phone": null,
      "province": null,
      "province_code": "4220006",
      "zip": "510036"
    },
    "shipping_lines": {
      "delivery_id": null,
      "price": null,
      "shipping_type": "string",
      "title": null
    },
    "stock_reserved": false,
    "stock_reserved_time": 1667638652832,
    "tags": null,
    "tax_exempt": null
  }
}

Language

curl --request POST \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20260301/orders/draft_orders.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
创建草稿单
Request
{
"draft_order": {
"billing_address": {
"address1": "Address 1",
"address2": "Address 2",
"area": "Livermore Valley",
"area_code": "*****300",
"city": "New York",
"city_code": "510000",
"company": "ABC",
"country": "USA",
"country_code": "US",
"email": "*********@example.com",
"first_name": "T**",
"last_name": "W****",
"name": "T** W****",
"phone": "139****1234",
"postcode": "94550",
"province": "California",
"province_code": "4200006",
"same_as_receiver": "true",
"zip": "94550"
},
"calc_sku_stock_mode": "not_limit",
"customer": {
"area_code": "+86",
"email": "*********@example.com",
"first_name": "T**",
"id": "********495",
"last_name": "W*****",
"phone": "139****1234"
},
"discount_amount_ext": "1.00",
"discountable": true,
"language_info": {
"customer_language": "en",
"merchant_language": "en"
},
"line_items": {
"applied_discount": {
"description": "ABC",
"title": "ABC",
"value": "5",
"value_type": "percentage"
},
"gift_card": "false",
"name": "ABC",
"price": "8.00",
"product_id": "***************934011",
"product_source": "main_site",
"properties": {
"name": "ABC",
"show": "false",
"type": "text",
"urls": [
"https://www.url.com"
],
"value": "ABC"
},
"quantity": "1",
"requires_shipping": "true",
"sku": "***************7644011",
"taxable": "true",
"title": "ABC",
"variant_id": "*************44011"
},
"market_region_country_code": "US",
"note": "ABC",
"note_attributes": {
"name": "ABC",
"value": "ABC"
},
"outer_id": "**********37820034",
"payment_terms": {
"pay_channel_id": "**********6272824",
"pay_status": "paid",
"payment_channel_name": "PayPal"
},
"shipping_address": {
"address1": "Address 1",
"address2": "Address 2",
"city": "New York",
"city_code": "510000",
"company": "ABC",
"country": "USA",
"country_code": "US",
"district": "Livermore Valley",
"district_code": "*****300",
"first_name": "T**",
"last_name": "W****",
"name": "T** W****",
"phone": "139****1234",
"province": "California",
"province_code": "4200006",
"zip": "94550"
},
"shipping_lines": {
"delivery_id": "**********6122774",
"price": "1.00",
"shipping_type": "system",
"title": "ABC"
},
"stock_reserved": "true",
"stock_reserved_time": "2021-08-16T08:27:57+00:00",
"tax_exempt": "false"
}
}
Response
{
"draft_order": {
"billing_address": {
"address1": "Address 1",
"address2": "Address 2",
"area": "Livermore Valley",
"area_code": "*****300",
"city": "New York",
"city_code": "510000",
"company": "ABC",
"country": "USA",
"country_code": "US",
"email": "*********@example.com",
"first_name": "T**",
"last_name": "W****",
"name": "T** W****",
"phone": "139****1234",
"province": "California",
"province_code": "4200006",
"same_as_receiver": "true",
"standard_province_code": "US",
"zip": "94550"
},
"create_at": "2022-11-04T10:18:46+00:00",
"currency": "USD",
"customer": {
"area_code": "+86",
"created_at": "2022-11-04T10:18:46+00:00",
"email": "*********@example.com",
"first_name": "T**",
"id": "********495",
"last_name": "W*****",
"phone": "139****1234"
},
"discount_amount_ext": "1.00",
"discount_amount_ext_name": "ABC",
"discount_amount_ext_set": {
"presentment_money": {
"amount": "8.00",
"currency_code": "USD"
},
"shop_money": {
"amount": "8.00",
"currency_code": "USD"
}
},
"gift_card": "false",
"id": "***************0823856",
"image_url": "www.example.com",
"invoice_url": "www.example.com",
"line_items": {
"applied_discount": {
"amount": "1.00",
"amount_set": {
"presentment_money": {
"amount": "8.88",
"currency_code": "USD"
},
"shop_money": {
"amount": "8.88",
"currency_code": "USD"
}
},
"before_amount": "1.00",
"before_amount_set": {
"presentment_money": {
"amount": "8.88",
"currency_code": "USD"
},
"shop_money": {
"amount": "8.88",
"currency_code": "USD"
}
},
"description": "ABC",
"title": "ABC",
"value": "5",
"value_type": "fixed_amount"
}
},
"logistics_price": "1.00",
"logistics_price_set": {
"presentment_money": {
"amount": "8.00",
"currency_code": "USD"
},
"shop_money": {
"amount": "8.00",
"currency_code": "USD"
}
},
"logistics_tax": "2.00",
"logistics_tax_set": {
"presentment_money": {
"amount": "8.00",
"currency_code": "USD"
},
"shop_money": {
"amount": "8.00",
"currency_code": "USD"
}
},
"market_name": "ABC",
"market_region_country_code": "US",
"name": "ABC",
"note": "ABC",
"note_attributes": {
"name": "ABC",
"value": "ABC"
},
"order_id": "**********076529630",
"payment_terms": {
"created_at": "2022-11-04T10:18:46+00:00",
"due_in_days": "5",
"id": "***************096553",
"overdue": "true",
"pay_channel_id": "***************53153",
"pay_status": "paid",
"payment_channel_name": "PayPal",
"payment_schedules": {
"completed_at": "2022-11-04T10:18:46+00:00",
"due_at": "2022-11-05T10:18:46+00:00",
"issued_at": "2022-11-06T10:18:46+00:00"
},
"payment_terms_name": "ABC",
"payment_terms_type": "NET",
"updated_at": "2022-11-04T10:18:46+00:00"
},
"po_number": "*************07162913",
"presentment_currency_code": "USD",
"price": "1.00",
"price_set": {
"presentment_money": {
"amount": "8.00",
"currency_code": "USD"
},
"shop_money": {
"amount": "8.00",
"currency_code": "USD"
}
},
"product_id": "*****************51043258",
"product_source": "customize",
"product_tax": "1.00",
"product_tax_set": {
"presentment_money": {
"amount": "8.00",
"currency_code": "USD"
},
"shop_money": {
"amount": "8.00",
"currency_code": "USD"
}
},
"properties": {
"name": "ABC",
"show": "true",
"type": "text",
"urls": [
"https://www.url.com"
],
"value": "ABC"
},
"quantity": "1",
"requires_shipping": "true",
"seller_id": "***************21415968",
"shipping_address": {
"address1": "Address 1",
"address2": "Address 2",
"city": "New York",
"city_code": "510000",
"company": "ABC",
"country": "USA",
"country_code": "US",
"district": "Livermore Valley",
"district_code": "*****300",
"first_name": "T**",
"last_name": "W****",
"name": "T** W****",
"phone": "139****1234",
"province": "California",
"province_code": "4200006",
"standard_province_code": "US",
"zip": "94550"
},
"shipping_lines": {
"delivery_id": "**********6122774",
"price": "1.00",
"price_set": {
"presentment_money": {
"amount": "8.00",
"currency_code": "USD"
},
"shop_money": {
"amount": "8.00",
"currency_code": "USD"
}
},
"shipping_type": "system",
"title": "ABC"
},
"sku": "*****************644011",
"status": "open",
"stock_reserved": "false",
"stock_reserved_time": "2022-11-05T10:18:46+00:00",
"store_id": "**************62105031",
"tags": "ABC",
"tax_lines": {
"name": "ABC",
"price": "1.00",
"price_set": {
"presentment_money": {
"amount": "8.00",
"currency_code": "USD"
},
"shop_money": {
"amount": "8.00",
"currency_code": "USD"
}
},
"rate": "0.02",
"type": "duty_tax"
},
"title": "ABC",
"total_duties_set": {
"presentment_money": {
"amount": "8.00",
"currency_code": "USD"
},
"shop_money": {
"amount": "8.00",
"currency_code": "USD"
}
},
"total_line_items_price": "8.00",
"total_line_items_price_set": {
"presentment_money": {
"amount": "8.00",
"currency_code": "USD"
},
"shop_money": {
"amount": "8.00",
"currency_code": "USD"
}
},
"total_price": "10.00",
"total_price_set": {
"presentment_money": {
"amount": "8.00",
"currency_code": "USD"
},
"shop_money": {
"amount": "8.00",
"currency_code": "USD"
}
},
"update_at": "2022-11-04T10:18:46+00:00",
"variant_id": "*****************644011",
"variant_title": "ABC"
}
}
这篇文章对你有帮助吗?