创建草稿单
POST https://{handle}.myshopline.com/admin/openapi/v20220601/orders/draft_orders.json
handle
:店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com
的店铺,其 handle
是 open001
。保存草稿单
请求头
- Content-Type required字段值固定为
application/json; charset=utf-8
- Authorization string required资源的访问令牌。请参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入Example:
Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
请求体
draft_orderobject
草稿单对象billing_addressobject
支付账单地址address1 string支付账单收件人详细地址(最大255个字符)address2 string支付账单收件人详细地址附加area string支付账单收件人区县(最大64个字符)area_code string支付账单收件人区县编码city string支付账单收件人城市(最大64个字符)city_code string支付账单收件人城市编码company string公司名称country string支付账单收件人国家(最大64个字符)country_code string支付账单收件人国家编码email string支付账单收件人邮箱(最大64个字符)first_name string支付账单收件人名(最大64个字符)last_name string支付账单收件人姓(最大64个字符)phone string支付账单收件人手机(最大32个字符)postcode string支付账单收件人邮编province string支付账单收件人省(最大64个字符)province_code string支付账单收件人省编码same_as_receiver boolean是否与收货信息相同(相同下面参数可以不传)calc_sku_stock_mode string required计算库存模式:not_limit,无限库存;real,真实库存;reserve_real:预留库存+真实库存Example:not_limit
customerobject
买家信息area_code string手机号区码email string用户邮箱id string required用户idphone string用户手机号discount_amount_ext string订单优惠金额精度2的double类型的字符串,eg:"12.41"discount_amount_ext_name string订单优惠名称(最大64个字符)language_infoobject required
语言信息customer_language string买家侧下单语种(优先使用此语种)merchant_language string卖家侧下单语种(优先使用买家侧语种)line_itemsobject[] required
商品信息列表applied_discountobject
商品折扣信息description string折扣描述title string折扣名称value long required折扣数额,折扣值,当折扣类型为DISCOUNT_AMOUNT_PERCENTAGE时,此值最大默认100,最小为0value_type string required折扣类型:fixed_amount(固定金额)、percentage(百分比)gift_card boolean是否为礼品卡商品:true、falseExample:true
price string商品售价,精度2的double类型的字符串,eg:"12.41"product_id string required商品spu序列号Example:16056577393789045351043258
product_source string required商品来源 main_site主站商品、customize自定义商品Example:main_site
quantity integer required商品数量Example:1
title string商品名称variant_id string required商品sku序列号Example:18056577393793239655103258
note string草稿单备注Example:客户想要尽快发货
note_attributesobject[]
附加信息name string名称value string值outer_id string操作唯一标识,同一个id只能执行一次操作payment_termsobject
付款信息pay_channel_id string required支付方式idpay_status string required付款状态(paid、unpaid) 默认unpaidpayment_channel_name string支付渠道名称shipping_addressobject
收货人地址信息address1 string详细地址信息1,用作补充信息(最大255个字符)Example:8899 Garfield Street
address2 string详细地址信息2,用作补充信息(最大255个字符)Example:Apartment 5
city string收货人城市名称(最大64个字符)Example:Riverside
city_code string收货人城市编码Example:4200006
company string公司名称(最大255个字符)country string收货人国家名称(最大64个字符)Example:美国
country_code string国家或地区,请参考国家代码Example:US
district string收货人区县名称(最大64个字符)district_code string行政区编码,自定义编号Example:4200006
first_name string收货人名(最大64个字符)Example:Tom
last_name string收货人姓(最大64个字符)Example:Washington
phone string收货人联系方式(最大32个字符)Example:13100000000
province string收货人省(最大64个字符)Example:加利福尼亚州
province_code string收货人省编码Example:4200006
zip string邮编(最大64个字符)Example:92503
shipping_linesobject
物流信息delivery_id string送货方式ID、运费模板IDprice string自定义运费,精度2的double类型的字符串,eg:"12.41"Example:12.41
shipping_type string required物流类型 system-系统物流;custom-自定义物流。当物流为系统物流时只需要传delivery_id,当物流类型伟自定义物流时传title和price字段Example:system
title string配送名称stock_reserved boolean required订单维度库存预留标识:true、flaseExample:true
stock_reserved_time long订单维度库存预预留时间Example:1669280400000
tags array标签列表Example: ``
响应
- 200
- 401
- 429
更多状态码信息请参考 HTTP 状态码
响应头
traceId
traceId
响应体
draft_orderobject
草稿单对象billing_addressobject
账单地址信息address1 string详细地址信息1,用作补充信息Example:8899 Garfield Street
address2 string详细地址信息2,用作补充信息Example:Apartment 5
area string行政区名称Example:4200006
area_code string行政区编码,自定义编号city string城市名称Example:Riverside
city_code string城市编码,自定义编号Example:4200006
company string公司名称Example:SHOPLINE
country string国家或是地区名称Example:美国
country_code string国家或是地区编码,两位的编码缩写(ISO-3166-1)Example:US
email string用户邮箱Example:test@shoplineapp.com
first_name string用户 名Example:Tom
last_name string用户 姓Example:Washington
phone string联系电话Example:13100000000
province string州或是省名称Example:加利福尼亚州
province_code string州或是省编码,自定义编号Example:4200006
same_as_receiver boolean是否和收货地址相同Example:true
zip string收货地址邮政编号Example:92503
create_at long创建时间,时间戳格式Example:1667638652832
currency string店铺币种Example:USD
customerobject
买家信息area_code string联系方式 区号email string用户邮箱id string用户idphone string用户手机号discount_amount_ext string订单优惠金额,精度2的double类型的字符串,eg:"12.41"discount_amount_ext_name string订单优惠名称id string草稿单号Example:2505659131831930856670
invoice_url stringinvoice链接line_itemsobject[]
商品信息列表applied_discountobject
商品自定义折扣信息amount string折扣金额,精度2的double类型的字符串,eg:"12.41"Example:1.00
before_amount string商品售价,精度2的double类型的字符串,eg:"12.41"Example:3.00
description string折扣描述Example:满两件减5元
title string折扣名称Example:满减
value long折扣数额,折扣值,当折扣类型为DISCOUNT_AMOUNT_PERCENTAGE时,此值最大默认100,最小为0Example:1
value_type string折扣类型:fixed_amount(固定金额)、percentage(百分比)Example:fixed_amount
gift_card boolean是否为礼品卡商品:true、falseExample:true
id string商品行id, 唯一确认一个商品行name stringsku标题,同titleprice string商品参加自定义折扣后的金额Example:2.00
product_id string商品spu序列号Example:16056577393789045351043258
product_source string商品来源 main_site主站商品、customize自定义商品Example:main_site
quantity integer商品数量Example:1
requires_shipping boolean是否需要实物运输发货:true、falseExample:true
sku string商品码,barCodetitle string商品标题variant_id string商品sku序列号Example:18056577393793239655103258
variant_title string商sku标题logistics_price string运费总金额Example:2.00
logistics_tax string运费总税费Example:2.00
note string草稿单备注Example:客户想要尽快发货
note_attributesobject[]
附加信息name string名称value string值order_id string由当前草稿单生成的订单单号Example:21056577640603870897253153
payment_termsobject
付款信息pay_channel_id string支付渠道IDpay_status string支付单状态:未支付unpaid、已支付paid 草稿单生成订单后,该状态不会同步订单的支付状态Example:unpaid
payment_channel_name string支付渠道名称product_tax string商品总税费Example:2.00
seller_id string商户idshipping_addressobject
收货地址address1 string详细地址信息1,用作补充信息Example:8899 Garfield Street
address2 string详细地址信息2,用作补充信息Example:Apartment 5
city string城市名称Example:Riverside
city_code string城市编码,自定义编号Example:4200006
company string公司名称country string国家或是地区名称Example:美国
country_code string国家或是地区编码,两位的编码缩写(ISO-3166-1)Example:US
district string行政区名称district_code string行政区编码,自定义编号Example:4200006
first_name string名Example:Tom
last_name string姓Example:Washington
name string全名Example:Tom Washington
phone string联系电话Example:13100000000
province string州或是省名称Example:加利福尼亚州
province_code string州或是省编码,自定义编号Example:4200006
zip string收货地址邮政编号Example:92503
shipping_linesobject
物流信息delivery_id string送货方式ID、运费模板IDprice string物流运费,精度2的double类型的字符串Example:12.41
shipping_type string物流类型 system-系统物流;custom-自定义物流Example:system
title string物流名称status integer草稿单状态(completed、open)stock_reserved boolean订单维度库存预留标识:true、flaseExample:true
stock_reserved_time long订单维度库存预预留时间Example:1669280400000
store_id string店铺idtags array草稿单标签,多个标签间用逗号分隔,店铺维度最大支持99个标签Example:shine,bili
total_line_items_price string当前草稿单商品总金额Example:2.00
total_price string当前草稿单总金额,商品售价-折扣+税费+运费Example:2.00
update_at long更新时间,时间戳格式Example:1667638652832
API Explorer
调试台
这篇文章对你有帮助吗?
Error loading component.