编辑草稿单
PUT https://{handle}.myshopline.com/admin/openapi/v20260301/orders/draft_orders.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handle 是 open001 。对一个草稿单的内容进行编辑,可以编辑商品、收货地址等信息。
请求头
- 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支付账单地址的第一行。通常是街道地址或邮政信箱编号等信息。 最大长度限制:255address2 string支付账单地址的第二行。通常是公寓、套房或单元等信息。 最大长度限制:255area string支付账单地址中的行政区名称。area_code string支付账单地址中的行政区编码,自定义编号。city string支付账单地址的城市。city_code string支付账单地址中城市的编码。company string支付账单地址的国家/地区。country string支付账单地址的国家/地区。country_code string支付账单地址的国家/地区编码。 遵循 ISO 3166-1 (alpha 2) 国际标准的二位国家或区域码,用于识别市场所在的国家或地区。email string买家邮箱。first_name string买家的名。last_name string买家的姓。phone string买家的手机号。province string支付账单地址中 州/省的名称。province_code string支付账单地址中省份的编码,该编码可以是自定义编号或者为二位的 ISO 3166-2 国际编码。same_as_receiver boolean该地址是否与收货信息相同。 •true: 相同 •false: 不同zip string支付账单地址的邮编信息。calc_sku_stock_mode string required计算库存模式。 •not_limit : 无限库存 •real : 真实库存 •reserve_real : 预留库存 + 真实库存例子:stringcustomerobject
买家信息。area_code string买家联系地址的区号。email string买家邮箱。first_name string买家的名。id string required买家的唯一标识符 ID。例子:stringlast_name string买家的姓。phone string买家的手机号。discount_amount_ext string订单优惠金额,精度 2 的 double 类型的字符串。 例如,12.41。discount_amount_ext_name string订单优惠名称。 最大长度限制:64discountable boolean是否叠加营销优惠。 •true: 叠加 •false: 不叠加id string required草稿单号。例子:stringlanguage_infoobject
语言信息。customer_language string买家侧下单语种,优先使用此语种。merchant_language string卖家侧下单语种,优先使用买家侧语种。line_itemsobject[] required
商品信息列表。applied_discountobject
商品折扣信息description string折扣描述。title string折扣名称。value long折扣值数额。当折扣类型为 DISCOUNT_AMOUNT_PERCENTAGE 时,此值最大默认100,最小为0。value_type string折扣类型。有效枚举值包含: · fixed_amount:固定金额 · percentage:百分比discountable boolean是否使用在线商店营销活动。 •true: 使用 •false: 不使用gift_card boolean是否为礼品卡商品。 •true: 是 •false: 不是id string订单商品行 ID,商品行的唯一标识符。price string商品售价,精度2的double类型的字符串,eg:"12.41"。product_id string required商品 ID。例子:stringproduct_source string required商品来源。 •main_site: 主站商品 •customize: 自定义商品例子:stringpropertiesobject[]
商品定制信息。name string自定义属性名称。show boolean是否要在前端展示。 •true: 展示 •false: 不展示type string商品属性类型。有效枚举值: ● text:文本类型 ● picture:图片类型 ● link:链接类型urls arrayURL 资源列表。value string自定义属性值。quantity integer required商品数量。 取值范围:0-120requires_shipping boolean是否需要发货。 •true: 需要 •false: 不需要sku string商家定义的商品货号,最大长度限制:255。title string商品名称。variant_id string required商品 SKU 序列号。例子:stringmarket_region_country_code string市场国家。note string草稿单备注。note_attributesobject[]
附加信息。name string附加信息的名称。value string附加信息的值。outer_id string操作的唯一标识,同一个 id 只能执行一次操作 。payment_termsobject
付款信息。pay_channel_id string required支付方式的唯一标识符 ID。例子:stringpay_status string付款状态。 •unpaid: 支付 •paid: 未支付payment_channel_name string支付渠道名称。shipping_addressobject
买家的收货地址信息。address1 string收货地址的第一行。通常是街道地址或邮政信箱编号等信息。address2 string收货地址的第二行。通常是公寓、套房或单元等信息。city string收货地址址中城市名称。city_code string收货地址中城市的编码。company string收货地址中收货人的公司名称country string收获地址中的国家或地区。country_code string收获地址的国家/地区编码。 遵循 ISO 3166-1 (alpha 2) 国际标准的二位国家或区域码,用于识别市场所在的国家或地区。district string收货地址中的行政区名称。district_code string收货地址中区的编码,自定义编号。first_name string买家的名。last_name string买家的姓。phone string买家的联系电话。province string收货地址中州/省的名称。province_code string收货地址中省份/州的编码,该编码可以是自定义编号或者为二位的 ISO 3166-2 国际编码。zip string收货地址邮政编号。shipping_linesobject
物流信息。delivery_id string送货方式ID、运费模板ID。price string物流运费,精度2的double类型的字符串。shipping_type string required物流类型。有效枚举值包含: · system:系统物流 · custom:自定义物流 当物流为系统物流时只需要传 delivery_id,当物流类型伟自定义物流时传 title 和 price 字段例子:stringtitle string物流名称。stock_reserved boolean required订单维度是否有库存预留标识。 •true: 是 •false: 否stock_reserved_time long订单维度库存预预留时间。tags array草稿单标签,多个标签间用逗号分隔。tax_exempt string该商品是否需要收税。 •true: 需要收税 •false: 不需要收税
状态码
- 200
- 401
- 429
更多状态码信息参考 HTTP 状态码。
响应头
traceId
请求的全局唯一标识符。用于追踪请求在系统中的流转,以便于问题发生时进行定位和调试。
响应 体
draft_orderobject
草稿单对象。billing_addressobject
账单地址信息。address1 string支付账单地址的第一行。通常是街道地址或邮政信箱编号等信息。 最大长度限制:255address2 string支付账单地址的第二行。通常是公寓、套房或单元等信息。 最大长度限制:255area string支付账单地址中的行政区名称。area_code string支付账单地址中的行政区编码,自定义编号。city string支付账单地址的城市。city_code string支付账单地址中城市的编码。company string支付账单地址的国家/地区。country string支付账单地址的国家/地区。country_code string支付账单地址的国家/地区编码。 遵循 ISO 3166-1 (alpha 2) 国际标准的二位国家或区域码,用于识别市场所在的国家或地区。email string买家的邮箱。first_name string买家的名。last_name string买家的姓。phone string买家的手机号。province string支付账单地址中州/省的名称。province_code string支付账单地址的国家/地区编码。 遵循 ISO 3166-1 (alpha 2) 国际标准的二位国家或区域码,用于识别市场所在的国家或地区。same_as_receiver boolean该地址是否与收货信息相同。 •true: 相同 •false: 不同 默认值:falsestandard_province_code string账单地址中省份的编码,该编码为二位的 ISO 3166-2 国际编码,区别于province_code返参为自定义编码。zip string收货地址的邮政编号。create_time long草稿单的创建时间。格式:ISO 8601。 例子:2021-08-31T02:20:26+08:00currency string店铺币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY 。customerobject
买家信息。area_code string买家联系地址的区号。email string买家邮箱。first_name string买家的名。id string买家的唯一标识符 ID。last_name string买家的姓。phone string买 家的手机号。discount_amount_ext string订单优惠金额,精度 2 的 double 类型的字符串。 例如,12.41。discount_amount_ext_name string订单优惠名称。discount_amount_ext_setobject
订单优惠金额,分别以买家币种金额和店铺币种金额展示。presentment_moneyobject
买家侧金额。amount string卖家收款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shop_moneyobject
卖家侧金额。amount string卖家收款金额。数值保留到小数点后两位。currency_code string卖家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY 。id string草稿单的唯一标识符 ID。invoice_url string发票链接。line_itemsobject[]
商品信息列表。applied_discountobject
商品自定义折扣信息。amount string折扣金额,精度 2 的double类型的字符串。 例如:12.41amount_setobject
折扣金额的详细信息,分别以买家币种金额和店铺币种金额展示。presentment_moneyobject
买家侧金额。amount string买家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shop_moneyobject
卖家侧金额。amount string卖家收款金额。数值保留到小数点后两位。currency_code string卖家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。before_amount string商品售价,精度2的double类型的字符串,eg:"12.41"before_amount_setobject
商品原售价信息,分别以买家币种金额和店铺币种金额展示。presentment_moneyobject
买家侧金额。amount string买家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shop_moneyobject
卖家侧金额。amount string卖家收款金额。数值保留到小数点后两位。currency_code string卖家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。description string折扣描述。title string折扣名称。value long折扣数额。当折 扣类型为 percentage 时,此值最大默认100,最小为0。value_type string折扣类型。 •fixed_amount: 固定金额 •percentage: 百分比gift_card boolean是否为礼品卡商品。 •true: 是 •false: 不是id string商品行 ID, 唯一确认一个商品行。image_url string商品图片。price string商品参加自定义折扣后的金额。price_setobject
商品参加自定义折扣后的金额,分别以买家币种金额和店铺币种金额展示。presentment_moneyobject
买家侧金额。amount string买家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shop_moneyobject
卖家侧金额。amount string卖家收款金额。数值保留到小数点后两位。currency_code string卖家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。product_id string商品 SPU 序列号。product_source string商品来源。 •main_site: 主站 商品 •customize: 自定义商品。propertiesobject[]
商品定制信息。name string自定义属性名称。show boolean是否要在前端展示。 •true: 展示 •false: 不展示type string属性类型: ● text:文本类型 ● picture:图片类型 ● link:超链接类型urls arrayurl 资源列表。value string自定义属性值。quantity integer商品数量。 取值范围:0-120requires_shipping boolean是否需要实物发货。 •true: 需要 •false: 不需要 默认值:falsesku string商品的 SKU 序列号,商品款式的唯一标识 ID。 最大长度限制:64tax_linesobject[]
税费信息。name string税费名称。price string税费金额。price_setobject
金额信息。presentment_moneyobject
买家侧金额。amount string买家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shop_moneyobject
卖家侧金额。amount string卖家收款金额。数值保留到小数点后两位。currency_code string卖家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。rate double税率。如果税率为 2%,请传入 0.02。该信息只做展示作用。 Example: 0.02type string税费类型。用于区分商品税和运费税。 product_tax:商品税 shipping_tax:运费税title string商品标题。variant_id string商品 sku 序列号。variant_title string商品 sku 标题。logistics_price string运费总金额。logistics_price_setobject
运费总金额(多币种)。presentment_moneyobject
买家侧金额。amount string买家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shop_moneyobject
卖家侧金额。amount string买家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。logistics_tax string运费总税费。logistics_tax_setobject
运费总税费(多币种)。presentment_moneyobject
买家侧金额。amount string买家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shop_moneyobject
卖家侧金额。amount string卖家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。market_name string市场名称。market_region_country_code string市场国家。note string草稿单备注。note_attributesobject[]
草稿单附加信息。name string附加信息的名称。value string附加信息的值。payment_termsobject
支付条款和付款信息。created_at string支付条款的创建时间。格式:ISO 8601。 例子:2021-08-31T02:20:26+08:00due_in_days integer在选定的付款条件模板中定义的发票日期和到期日之间的天数。id string支付条款的唯一识别 ID。overdue boolean支付条款是否超时。 •true: 超时 •false: 未超时pay_channel_id string支付渠道的 ID。pay_status string支付单状态。已支付 paid 草稿单生成订单后,该状态不会同步订单的支付状态。 •unpaid: 支付 •paid: 未支付payment_channel_name string支付渠道名称。payment_schedulesobject[]
与付款条件相关联的一组时间表。completed_at string购买完成的日期和时间。最初返回 null,并在捕获付款时更新。due_at string付款到期的日期和时间。 根据 issued_at 和 due_in_days 计算。如果类型固定,则根据自定义的固定日期计算。issued_at string付款条件启动的日期和时间。 格式:ISO 8601。 Example: 2021-08-31T02:20:26+08:00payment_terms_name string用于创建付款条件的付款条件模板的名称。payment_terms_type string用于创建付款条件的付款条件模板类型: •FIXED: 商家指定日期 •FULFILLMENT: 完成发货日期 •NET: 固定条件日期 •RECEIPT: 发送账单日期 •UNKNOWN: 未知类型updated_at string支付条款的更新时间。 格式:ISO 8601。 Example: 2021-08-31T02:20:26+08:00po_number stringB2B 场景在订单上记录的采购订单号。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。shipping_addressobject
收货地址。address1 string收货人详细地址的第一行。通常是街道地址或邮政信箱编号等信息。address2 string收货人详细地址的第二行。通常是公寓、套房或单元等信息。city string收货地址中的城市名称。city_code string收货地址中城市的编码,自定义编号。company string收货人的公司名称country string收货地址的国家/地区。country_code string收货地址中国家的二位国家码,遵循 ISO 3611-1 国际标准,例如 US。district string收货地址中的行政区名称。district_code string收货地址中区的编码,自定义编号。first_name string买家的名。last_name string买家的姓。phone string买家的联系电话。province string收货地址中州/省的名称。province_code string收货地址中省份/州的编码,该编码可以是自定义编号或者为二位的 ISO 3166-2 国际编码。standard_province_code string地址中省份的编码,该编码为二位的 ISO 3166-2 国际编码,区别于province_code返参为自定义编码。zip string收货地址邮政编号。shipping_linesobject
物流信息。delivery_id string送货方式ID、运费模板ID。price long物流运费,精度2的double类型的字符串。price_setobject
物流运费(多币种)。presentment_moneyobject
买家侧金额。amount string买家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shop_moneyobject
卖家侧金额。amount string卖家付款金额。数值保留到小数点后两位。currency_code string卖家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shipping_type string物流类型: •system : 系统物流 •custom : 自定义物流title string物流名称。status integer草稿单状态: •completed •openstock_reserved boolean订单维度是否有库存预留标识。 •true: 是 •false: 否stock_reserved_time long订单维度库存预预留时间。store_id string店铺的唯一标识符 ID。tags array草稿单标签,多个标签间用逗号分隔,店铺维度最大支持99个标签。tax_linesobject[]
税费信息。name string税费信息名称。price string金额。price_setobject
价格信息。presentment_moneyobject
买家侧金额。amount string买家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shop_moneyobject
卖家侧金额。amount string卖家付款金额。数值保留到小数点后两位。currency_code string卖家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。rate double税率。type string税费类型。用于区分商品税和运费税。 · product_tax:商品税 · shipping_tax:运费税total_duties_setobject
总关税。presentment_moneyobject
买家侧金额。amount string买家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shop_moneyobject
卖家侧金额。amount string卖家付款金额。数值保留到小数点后两位。currency_code string卖家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。total_line_items_price string当前草稿单商品总金额。total_line_items_price_setobject
商品总金额。presentment_moneyobject
买家侧金额。amount string买家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shop_moneyobject
卖家侧金额。amount string卖家付款金额。数值保留到小数点后两位。currency_code string卖家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。total_price string当前草稿单总金额,商品售价-折扣+税费+运费。total_price_setobject
草稿单总金额,分别以买家币种金额和店铺币种金额展示。presentment_moneyobject
买家侧金额。amount string买家付款金额。数值保留到小数点后两位。currency_code string买家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。shop_moneyobject
卖家侧金额。amount string卖家付款金额。数值保留到小数点后两位。currency_code string卖家侧币种。该字段值为三位币种码,遵循 ISO 4217 标准,例如 CNY。update_time long草稿单的更新时间。 格式:ISO 8601。 Example: 2021-08-31T02:20:26+08:00
API Explorer
调试台
这篇文章对你有帮助吗?