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