完成草稿单
PUT https://{handle}.myshopline.com/admin/openapi/v20260301/orders/draft_orders/:id/complete.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handle 是 open001 。使用指定草稿单的信息,生成一个订单。草稿单需要有必要的信息才可以用于生成订单。
路径参数
- id string required草稿单号Example:
2505751787769346133516
请求头
- Content-Type string required字段值固定为
application/json; charset=utf-8。 - Authorization string required资源的访问令牌。参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入。Example:
Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
状态码
- 200
- 401
- 429
更多状态码信息参考 HTTP 状态码。
响应头
traceId
请求的全局唯一标识符。用于追踪请求在系统中的流转,以便于问题发生时进行定位和调试。
响应体
draft_orderobject
草稿单billing_addressobject
账单地址信息address1 string详细地址信息1,用作补充信息Example:8899 Garfield Streetaddress2 string详细地址信息2,用作补充信息Example:Apartment 5area string行政区名称Example:East townarea_code string行政区编码,自定义编号Example:4200006city string城市名称Example:Riversidecity_code string城市编码,自定义编号Example:4200006company string公司名称Example:SHOPLINEcountry string国家或是地区名称Example:美国country_code string国家或是地区编码,两位的编码缩写(ISO-3166-1)Example:USemail string用户邮箱Example:test@shoplineapp.comfirst_name string用户 名Example:Tomlast_name string用户 姓Example:Washingtonphone string联系电话Example:13100000000province string州或是省名称Example:加利福尼亚州province_code string州或是省编码,自定义编号Example:4200006same_as_receiver boolean是否与收货信息相同:true、falseExample:truestandard_province_code string账单地址中省份的编码,该编码为二位的 ISO 3166-2 国际编码,区别于province_code返参为自定义编码。street_name string街道名称Example:Streetstreet_number string街道编码,自定义编号Example:4200006zip string收货地址邮政编号Example:92503companyobject
公司信息id string公司idExample:1005619945158043247856location_id string地点idExample:3005619945158043247856tax_registration_id string税号Example:213213create_at long创建时间,时间戳格式Example:1667638652832currency string店铺币种Example:USDcustomerobject
买家信息area_code string联系方式 区号Example:0000email string用户邮箱Example:xxx@gmail.comfirst_name string用户的名Example:Xiaoliuid string用户idExample:2200000611last_name string用户的姓Example:Wangphone string用户手机号Example:1888888888888discount_amount_ext string订单优惠金额,精度2的double类型的字符串,eg:"12.41"Example:12.41discount_amount_ext_name string订单优惠名称Example:Order Discount namediscount_amount_ext_setobject
订单优惠金额,多币种信息presentment_moneyobject
买家侧金额信息amount string金额Example:8.00currency_code string币种Example:USDshop_moneyobject
卖家侧金额信息amount string金额Example:8.00currency_code string币种Example:USDid string草稿单号Example:2505659131831930856670invoice_url stringinvoice链接Example:https://xxxxx.myshopline.com/invoices/xxxx?secret=xxxxline_itemsobject[]
商品信息列表applied_discountobject
商品自定义折扣信息amount string折扣金额,精度2的double类型的字符串,eg:"12.41"Example:1.00amount_setobject
折扣金额,多币种信息presentment_moneyobject
买家侧金额信息amount string金额Example:8.00currency_code string币种Example:USDshop_moneyobject
卖家侧金额信息amount string金额Example:8.00currency_code string币种Example:USDbefore_amount string商品售价,精度2的double类型的字符串,eg:"12.41"Example:3.00before_amount_setobject
折扣前商品售价,多币种信息presentment_moneyobject
买家侧金额信息amount string金额Example:8.00currency_code string币种Example:USDshop_moneyobject
卖家侧金额信息amount string金额Example:8.00currency_code string币种Example:USDdescription string折扣描述Example:满两件减5元title string折扣名称Example:满减value long折扣数额,折扣值,当折扣类型为DISCOUNT_AMOUNT_PERCENTAGE时,此值最大默认100,最小为0Example:1value_type string折扣类型:fixed_amount(固定金额)、percentage(百分比)Example:fixed_amountgift_card boolean是否为礼品卡商品:true、falseExample:trueid string商品行id, 唯一确认一个商品行Example:123123image_url string商品图片Example:http://www.abc.com/123price string商品参加自定义折扣后的金额Example:2.00price_setobject
商品参加自定义折扣后的金额,多币种信息presentment_moneyobject
买家侧金额信息amount string金额Example:8.00currency_code string币种Example:USDshop_moneyobject
卖家侧金额信息amount string金额Example:8.00currency_code string币种Example:USDproduct_id string商品spu序列号Example:16056577393789045351043258product_source string商品来源 main_site主站商品、customize自定义商品Example:main_sitequantity integer商品数量Example:1requires_shipping boolean是否需要实物运输发货:true、falseExample:truetax_linesobject[]
税费name string标题Example:taxprice string税费(店铺币种金额),精度2Example:8.00price_setobject
税费多币种信息presentment_moneyobject
买家侧金额amount string金额Example:8.00currency_code string币种Example:USDshop_moneyobject
卖家侧金额amount string金额Example:8.00currency_code string币种Example:USDrate double税率Example:1type string类型Example:shipping_taxtitle string商品标题Example:Product titlevariant_id string商品sku序列号Example:18056577393793239655103258variant_title string商sku标题Example:Commercial sku titlenote string草稿单备注Example:客户想要尽快发货note_attributesobject[]
附加信息name string名称Example:xxxxvalue string值Example:2order_id string由当前草稿单生成的订单单号Example:21056577640603870897253153payment_termsobject
支付条款和付款信息created_at string创建时间Example:2024-06-05 08:00:00due_in_days integer当条款类型为NET时提供,多少天后未付款则到期Example:2id string唯一识别该支付条款的idExample:6497210673894431747overdue boolean支付条款是否超时:true/falseExample:truepay_channel_id string支付渠道IDExample:5341701129888599091pay_status string支付单状态:未支付unpaid、已支付paid 草稿单生成订单后,该状态不会同步订单的支付状态Example:unpaidpayment_channel_name string支付渠道名称Example:Custom payment --uploadfilepayment_schedulesobject[]
与付款条件相关联的一组时间表completed_at string付款完成时间Example:2024-06-05 08:00:00due_at string预计付款时间Example:2024-06-05 08:00:00issued_at string付款条件启动的时间。当为FIXED时,为保存时间(若草稿单成单,则订单继承草稿单时间) ;当为FULFILLMENT/RECEIPT时,为条件生效时间;当为NET时,则为保存时间(若草稿单成单,则订单继承草稿单时间)Example:2024-06-05 08:00:00payment_terms_name string用于创建付款条件的付款条件模板的名称Example:Due on receiptpayment_terms_type string用于创建付款条件的付款条件模板类型: FIXED:商家指定日期 FULFILLMENT:完成发货日期 NET:固定条件日期 RECEIPT:发送账单日期 UNKNOWN:未知类型Example:RECEIPTupdated_at string更新时间Example:2024-06-05 08:00:00po_number stringB2B场景在订单上记录的采购订单号seller_id string商户idExample:160123123shipping_addressobject
物流信息address1 string详细地址信息1,用作补充信息Example:8899 Garfield Streetaddress2 string详细地址信息2,用作补充信息Example:Apartment 5city string城市名称Example:Riversidecity_code string城市编码,自定义编号Example:4200006company string公司名称Example:Company Namecountry string国家或是地区名称Example:美国country_code string国家或是地区编码,两位的编码缩写(ISO-3166-1)Example:USdelivery_store_code string门店编码,自定义编号Example:4200006delivery_store_name string门店名称Example:Store namedistrict string行政区名称Example:Administrative region namedistrict_code string行政区编码,自定义编号Example:4200006first_name string名Example:Tomlast_name string姓Example:Washingtonphone string联系电话Example:13100000000province string省份Example:Californiaprovince_code string省份编码Example:4200006standard_province_code string地址中省份的编码,该编码为二位的 ISO 3166-2 国际编码,区别于province_code返参为自定义编码。street_name string街道名称Example:Streetstreet_number string街道编码,自定义编号Example:4200006zip string收货地址邮政编号Example:92503shipping_linesobject
物流信息delivery_id string送货方式ID、运费模板IDExample:109012039908express_type_source string物流类型 system-系统物流;custom-自定义物流Example:systemprice string物流运费,精度2的double类型的字符串Example:12.41price_setobject
物流运费,多币种信息presentment_moneyobject
买家侧金额信息amount string金额Example:8.00currency_code string币种Example:USDshop_moneyobject
卖家侧金额信息amount string金额Example:8.00currency_code string币种Example:USDtitle string运费模板名称Example:Shipping template namestatus string草稿单状态:open 、 completeExample:openstock_reserved boolean订单维度库存预留标识:true、flaseExample:truestock_reserved_time long订单维度库存预预留时间Example:1669280400000subtotal_price string订单金额,精度2的double类型的字符串,eg:"12.41"Example:12.41tags array草稿单标签,多个标签间用逗号分隔,店铺维度最大支持99个标签Example:["shine,bili"]tax_linesobject[]
税费信息name string名字Example:TAXprice string金额Example:8.00price_setobject
价格信息presentment_moneyobject
买家侧金额amount string金额Example:8.00currency_code string币种Example:USDshop_moneyobject
卖家侧金额amount string金额Example:8.00currency_code string币种Example:USDrate double税率Example:1type string类型Example:shipping_taxtotal_discounts string总折扣金额,精度2的double类型的字符串,eg:"12.41"Example:12.41total_duties_setobject
总关税presentment_moneyobject
买家侧金额信息amount string金额Example:8.88currency_code string币种Example:USDshop_moneyobject
卖家侧金额信息amount string金额Example:8.88currency_code string币种Example:USDtotal_line_items_price string当前草稿单商品总金额Example:2.00total_line_items_price_setobject
当前草稿单商品总金额,多币种信息presentment_moneyobject
买家侧金额信息amount string金额Example:8.88currency_code string币种Example:USDshop_moneyobject
卖家侧金额信息amount string金额Example:8.88currency_code string币种Example:USDtotal_tax string总税费,精度2的double类型的字符串,eg:"12.41"Example:12.41total_tax_setobject
总税费,多币种信息presentment_moneyobject
买家侧金额信息amount string金额Example:8.88currency_code string币种Example:USDshop_moneyobject
卖家侧金额信息amount string金额Example:8.88currency_code string币种Example:USDupdate_at long更新时间,时间戳格式Example:1667638652832
API Explorer
调试台
这篇文章对你有帮助吗?