创建订单
POST https://{handle}.myshopline.com/admin/openapi/v20260901/orders.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handle 是 open001 。创建订单。
请求头
- Content-Type string required字段值固定为
application/json; charset=utf-8。 - Authorization string required资源的访问令牌。参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入。例子:
Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA
请求体
orderobject required
订单信息。buyer_note string买家留言。例子:messagefulfillment_status string订单的发货状态。有效枚举值包含:unshipped:未发货shipped:已发货
默认值:unshipped注意:传入枚举值的准确性会进行强校验,如果枚举值校验不通过,则订单会创建失败,会报错fulfillment_status is invalid。line_itemsobject[] required
订单商品快照信息列表。title string商品标题。例子:beautiful skirtlocation_id string商品库存地点 ID。例子:5445886274929439997propertiesobject[]
商品定制信息列表。value string自定义属性值例子:attribute valuename string自定义属性名称例子:attribute nameshow boolean定制信息是否可见:true:可见false:不可见 默认值:false
type string定制信息类型。有效枚举值包含:text:字符类型picture:图片类型link:链接类型
urls arrayURL 资源列表。- 如果
type是picture,可通过urls获取渲染出缩略图。 - 如果
type是link,那么超链接为urls的第一个。
例子:["[\"https://www.url.com\"]"]quantity long商品数量。例子:1taxable boolean该商品是否需要收税。true:需要收税false:不需要收税
默认值:truevariant_id string分配给库存中某一特定商品的唯一编码。例子:18056761559987524812644011discount_priceobject
商品自定义折扣明细。amount string折扣金额。数值保留到小数点后两位。例子:1.00title string折扣名称。例子:Discount nameprice string商品售价,数值保留到小数点后两位。例子:3.25product_id string款式对应商品的唯一标识 ID。例子:16056761559984840457934011requires_shipping boolean表明商品是否需要运输。true:需要运输false:不需要运输
shipping_line_title string商品行匹配的运费方案标题。在传入shipping_lines情况下,当前字段必传。tax_lineobject
自定义商品税费信息。price string税费金额。商品实际收税以此字段金额为准,传入的rate税费仅做展示作用。例子:3.25rate string税率,以小数形式表示,数值保留到小数点后四位。如果税率为2%,该值为0.0200。该信息只做展示作用。title string税费说明标题。该信息只做展示作用。例子:Tax nameprice_infoobject required
价格信息。taxes_included boolean该订单是否包含税费金额。true:包含税费金额false:不包含税费金额
total_shipping_price string运费,以店铺币种展示。数值保留到小数点后两位。例子:8.00current_extra_total_discounts string订单折扣金额,不包含折扣码优惠。数值保留到小数点后两位。例子:8.00shipping_addressobject
收货地址信息。area string收货地址中的区或县。最大长度限制:64例子:Panyu Districtarea_code string收货地址中区或县的编码。例子:510006latitude string收货地址所在的纬度。例子:43phone string收件人的手机号码。例子:13903004000city_code string收货地址中城市的编码。例子:510000longitude string收货地址所在的经度。例子:34province string收货地址中的州或省份。例子:Guangdong Provinceaddress2 string收货地址的第二行。通常是公寓、套房或单元等信息。最大长度限制:255例子:Apartment 5city string收货地址中的城市。