订单创建
事件分组 | 事件标识 |
---|---|
orders | orders/create |
当发订单创建成功后,你会接到此通知。
关于如何订阅 Webhooks 及收到 Webhook 后该如何进行响应,请参考 Webhook 概述。
请求头
- X-Shopline-Topic string required事件操作标识Example:
orders/edited
- X-Shopline-Hmac-Sha256 string required签名Example:
XWmrwMey6OsLMeiZKwP4FppHH3cmAiiJJAweH5Jo4bM=
- X-Shopline-Shop-Domain string required店铺域名Example:
shophub.myshopline.com
- X-Shopline-Shop-Id string required店铺idExample:
1610418123456
- X-Shopline-Merchant-Id string required商户IDExample:
2000001234
- X-Shopline-API-Version string required版本号Example:
v20210901
- X-Shopline-Webhook-Id string required消息IDExample:
b54557e48a5fbf7d70bcd043
请求体
- adjust_price stringPOS 交易场景下因金额四舍五入带来的差额金额,用店铺币种。Example:
8.00
adjust_price_setobject
POS 交易场景下因金额四舍五入带来的差额金额,分别以买家币种和卖家币种展示。billing_addressobject
用于邮寄账单发票的地址。address1 string账单地址的第一行。通常是街道地址或邮政信箱编号等信息。Example:Address 1
address2 string账单地址的第二行。通常是公寓、套房或单元等信息。Example:Address 2
city string账单地址中的城市。Example:New York
company string账单收件人的公司名称。Example:new company
country string账单地址中的国家或地区。Example:USA
first_name string账单收件人的名。Example:Tom
last_name string账单收件人的姓。Example:Washington
name string账单收件人的全名。Example:Tom Washington
phone string账单收件人的手机号码。Example:19872653123
province string账单地址中的州或省份。Example:California
zip string账单地址的邮编信息。Example:65432
- browser_ip string买家下单时的浏览器 IP 地址。Example:
157.119.232.35
- buyer_note string买家备注。Example:
Notes
- cancel_reason string卖家取消订单的原因。Example:
I don't want to buy it.
- cancelled_at string订单取消时间。格式:ISO 8601。例子:
2021-08-31T02:20:26+08:00
Example:2012-05-01T14:22:25-04:00
- cart_token string购物车数据的唯一标识。Example:
c2c4a58186b9d96395d7e6b5c2969577
- checkout_id string弃单 ID。Example:
2404785166526352972864
- checkout_token string弃单数据的唯一标识。Example:
c2c4a58186b9d96395d7e6b5c2969577
client_detailsobject
客户端信息。browser_ip string买家下单时的浏览器 IP 地址。Example:157.119.232.35
session_hash string会员会话加密信息。Example:90c6724a-cf0d-4517-bd61-5c2727c2f886
user_agent string客户端代理。Example:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Sa
uuid string用户未注册前的唯一标识。Example:11111223
companyobject
买家所在的公司信息。id string公司 ID。Example:1005619945158043247856
location_id string地点 ID。Example:3005619945158043247856
tax_registration_id string税号。Example:213213
- contract_seq string合同单号。Example:
3005619945158043247856
- created_at string订单创建的时间。格式:ISO 8601。例子:
2021-08-31T02:20:26+08:00
Example:2012-05-01T14:22:25-04:00
credit_limitobject
信用支付信息。is_credit_limit boolean订单是否使用了信用支付。true
:有使用false
:未使用
Example:true
outstanding_credit_limit string占用的信用额度总和。初始和total_credit_limit
相等,如果后续有类似还款操作,占用的额度则相应减少。Example:1.00
total_credit_limit string使用的信用额度总和,即该笔订单用了多少信用额度支付。Example:1.00
- current_subtotal_price string商品金额总和,为商品总价 * 数量,以店铺币种展示。Example:
8.00
current_subtotal_price_setobject
商品金额总和,为商品总价 * 数量,分别以买家币种和店铺币种展示。- current_total_discounts string折扣金额总和,数值保留到小数点后两位,为营销优惠 + 人工折扣,以店铺币种展示。Example:
8.00
current_total_discounts_setobject
折扣金额总和,分别以买家币种金额和店铺币种金额展示。current_total_duties_setobject
商品总关税,分别以买家币种金额和店铺币种金额展示。- current_total_price string订单总额,以店铺币种金额展示。Example:
8.00
current_total_price_setobject
订单总额,分别以买家币种金额和店铺币种金额展示。- current_total_tax string税费金额总和,以店铺币种金额展示。Example:
8.00
current_total_tax_setobject
税费金额总和,分别以买家币种金额和店铺币种金额展示。customerobject
买家信息。addressesobject
收货地址。address1 string收货人详细地址的第一行。通常是街道地址或邮政信箱编号等信息。Example:Address 1
address2 string收货人详细地址的第二行。通常是公寓、套房或单元等信息。Example:Address 2
city string收货地址中的城市名称。Example:New York
country string收货地址中的国家或地区。Example:USA
first_name string买家的名。Example:Tom
last_name string买家的姓。Example:Washington
name string买家的全名。Example:Tom Washington
phone string买家的联系电话。Example:19872334222
province string收货地址中州或省的名称。Example:California
zip string收货地址邮政编号。Example:510000
area_code string手机区号。Example:+86
created_at string买家创建的时间。格式:ISO 8601。例子:2021-08-31T02:20:26+08:00
Example:2022-11-04T10:18:46+00:00
email string买家邮箱。Example:test1001@Gmail.com
first_name string买家的名。Example:Tom
id string买家 ID。Example:4201057495
last_name string买家的姓。Example:Washington
phone string买家手机号。Example:19872334222
- customer_locale string买家国家,语种编码 + 国家名称缩写。例子:
enCA
Example:enCN
- deduct_member_point_amount string当前订单会员积分抵扣金额, 以店铺币种金额展示。Example:
8.00
deduct_member_point_amount_setobject
当前订单会员积分抵扣金额,分别以买家币种金额和店铺币种金额展示。discount_applicationsobject[]
该订单应用的所有折扣信息。allocation_method string折扣的范围。有效枚举值包括:across
: 按照购买总数折扣。each
: 按照单个商品分别折扣。
示例:如一次购买 3 个相同的商品,折扣 10 元,across
代表三个商品一起减 10 元,each
代表每个商品分别减 10 元。Example:across
code string折扣码。Example:1Q3UMQM8RBP5
description string活动的具体描述。Example:Detailed description of the activity
target_selection string折扣分配商品行方式。有效枚举值包含:explicit
:折扣分配到明确选择的商品行all
:折扣分配到所有商品行entitled
:折扣仅分配到其有权使用的商品行
Example:explicit
target_type string折扣应用的对象。有效枚举值包含:line_item
:作用在商品上的折扣shipping_line
:作用在运费上的折扣
Example:line_item
title string活动折扣的标题。Example:Detailed description of the activity
type string折扣类型。有效枚举值包含:manual
:手动折扣automatic
:自动折扣discount_code
:折扣码
Example:manual
value string活动的折扣值。Example:20
value_type string折扣值的类型。有效枚举值包含:fix_amount
:固定金额percentage
:百分比
Example:fixed_amount
discount_codesobject[]
优惠码信息。amount string数值保留到小数点后两位。Example:8.00
code string优惠码。Example:KIN4GNAB2FRH
type string优惠类型。有效枚举值包含:减金额
打折
免运费
加价品
任意N件优惠价
A+B组合优惠价
赠品
固定售价
最低价商品免费
打包价
第N件打折
买X送Y
自定义
Example:Reduction amount
- draft_order_seq string草稿单号。Example:
2506031660544058504339
- email string买家邮箱。Example:
test1001@Gmail.com
- exist_subscription boolean是否存在销售计划商品。
ture
:存在false
:不存在
Example:true
- financial_status string订单付款状态。有效枚举值包含:
unpaid
:未支付authorized
:已授权pending
:处理中partially_paid
:部分付款paid
:已付款partially_refunded
:部分退款refunded
:已退款
Example:unpaid
- fulfillment_status string发货状态。有效枚举值包含:
fulfilled
:已发货partial
:部分发货null
:未发货
注意:返回的枚举值与入参的查询枚举值不一样。Example:fulfilled
fulfillmentsobject[]
发货单信息。created_at string发货单创建的时间。格式:ISO 8601。例子:2021-08-31T02:20:26+08:00
Example:2022-11-04T10:18:46+00:00
id string发货单 ID。Example:22046737798141702810214336
line_itemsobject[]
商品行列表。attribute string商品属性:名称 - 属性值。多个以 ", " 分割。例如:颜色 - 红色, 尺寸 - X
。Example:red
bundle_parent_variant_id string套装子商品关联的父商品变体ID。Example:18056761559984840457934011
fulfillable_quantity integer商品行维度剩余可履约的商品数量。Example:2
fulfillment_quantity integer已发货数量。Example:1
fulfillment_service string物流商名称,如果一种商品有多个不同的发货服务商,则以逗号分隔。Example:Sf international
fulfillment_status string商品的发货状态。有效枚举值包含:fulfilled
: 商品已发货partial
: 商品部分发货null
: 商品未发货
Example:fulfilled
grams double商品重量,单位:gExample:100
id string商品快照表的 ID,由系统生成,与订单号唯一确认一个商品。Example:417
image_url string商品图片。Example:https://d2n979dmt31clo.cloudfront.net/image/store/4211449909/1667384795847/63928f08a7174ab2958c6a969
is_bundle boolean是否为套装商品:true:套装商品 false:非套装商品Example:true
is_bundle_component boolean是否为套装子商品:true:子商品 false:非子商品Example:true
location_id string地点 ID。Example:5327026538935748524
name stringSKU 标题。Example:testProduct1001
price string商品售价,数值保留到小数点后两位。Example:8.00
product_id stringSPU 序列号。Example:16056761559984840457934011
quantity integer订单中的商品数量。Example:2
requires_shipping boolean商品是否需要发货。true
:需要发货false
:不需要发货
Example:true
sku string商品码。Example:18056761559987524812644011
tax_linesobject[]
税费信息列表。price string税费金额,以买店铺币种金额展示。Example:8.00
rate double税率。Example:1
title string税费名称。Example:Tax
taxable boolean该商品是否含税。true
:含税false
:不含税
Example:true
title string商品标题。Example:Beautiful skirt
variant_id string商品 SKU 序列号。Example:18056761559987524812644011
variant_title string商品属性值,多个以 " / " 分割。例如:155 / 红色 / 大
Example:big
vendor string供应商。Example:Supplier
order_id string订单 ID。Example:21056577640603870897253153
shipment_status string包裹状态。有效枚举值包含:success
:发货成功cancelled
:已取消发货
Example:fulfilled
status string物流配送状态。有效枚举值包含:success
:已发货cancelled
:已取消
Example:success
tracking_company string物流公司名称。Example:Sf international
tracking_number string第三方物流单号。Example:yun0001
tracking_url string物流公司 URL。Example:https://www.sf-international.com/
updated_at string发货单的更新时间。格式:ISO 8601。例子:2021-08-31T02:20:26+08:00
Example:2022-11-04T10:18:46+00:00
- hidden_order boolean订单是否已归档。有效枚举值包含:
true
:已归档订单false
:未归档订单
Example:true
- id string系统订单号。Example:
21050224312121887324667162
- landing_site string着陆页。Example:
https://www.url.com
line_itemsobject[]
商品行列表。attribute string商品属性:名称 - 属性值。多个以 ", " 分割。例子:颜色 - 红色, 尺寸 - X
Example:red
bundle_parent_variant_id string套装子商品关联的父商品变体ID。Example:18056761559984840457934011
discount_allocationsobject[]
折扣明细。amount string数值保留到小数点后两位。Example:8.00
discount_application_index integer折扣明细中的位置。Example:1
dutiesobject[]
关税信息。country_code_of_origin string原产地或发货地的国家代码。harmonized_system_code string海关编码。id string关税编号。tax_linesobject[]
税费信息列表。rate double税率。rate_percentage double税率(百份比的值,即 rate * 100)。title string税费名称。fulfillable_quantity integer商品行维度剩余可履约的商品数量。Example:3
fulfillment_service string物流商名称,如果一种商品有多个不同的发货服务商,则以逗号分隔。Example:Sf international
fulfillment_status string商品的发货状态。有效枚举值包含:fulfilled
: 商品已发货partial
: 商品部分发货null
: 商品未发货
Example:fulfilled
giftCard boolean该商品是否为礼品卡商品。true
:是礼品卡商品false
:不是礼品卡商品
grams double商品重量,单位:g。Example:100
id string商品快照表的 ID,由系统生成,与订单号唯一确认一个商品。Example:413
image_url string商品图片。Example:https://d2n979dmt31clo.cloudfront.net/image/store/4211449909/1667384795847/63928f08a7174ab2958c6a969
is_bundle boolean是否为套装商品:true:套装商品 false:非套装商品Example:true
is_bundle_component boolean是否为套装子商品:true:子商品 false:非子商品Example:true
location_id string地点 ID。Example:5327026538935748524
name stringSKU 标题。Example:testProduct1001
price string商品售价,数值保留到小数点后两位。Example:8.00
product_id stringSPU 序列号。Example:16056761559984840457934011
propertiesobject[]
定制商品附加字段。additional string定制商品附加字段,比如当name
为 “文字”,additional
可以附加文字的字号、字体、颜色等。Example:Expand
name string商品定制信息名称。Example:Custom properties
type string商品的定制信息类型。有效枚举值包含:text
:文本类型picture
:图片类型link
:链接类型
Example:text
urls array商品定制信息链接。Example:https://www.url.comhttps://www.url.com
value string商品定制信息内容。Example:Custom properties
quantity integer订单中的商品数量。Example:1
requires_shipping boolean商品是否需要发货。true
:需要发货false
:不需要发货
Example:true
sku string商品码。Example:18056761559987524812644011
tags string商品标签,多个逗号隔开。Example:watch
tax_linesobject[]
税费信息列表。price string税费金额,以买店铺币种金额展示。Example:8.00
rate double税率。Example:1
title string税费名称。Example:Tax
type string税费类型,用于区分是商品税还是运费税。有效枚举值包含:product_tax
:商品税shipping_tax
:运费税
Example:shipping_tax
taxable boolean该商品是否含税。true
:含税false
:不含税
Example:true
title string商品标题。Example:Beautiful skirt
variant_id string商品 SKU 序列号。Example:18056761559987524812644011
variant_title string商品属性值,多个以 " / " 分割。例如:155 / 红色 / 大
Example:big
vendor string供应商。Example:Supplier
locationsobject[]
商品地点信息。location_id string地点的唯一标识。Example:5327026538935748524
name string地点名称。Example:US.street
type string地点类型。有效枚举值包含:posLocation
:POS 渠道创建该订单的门店地点(建议使用posLocationId
,后续将废弃)pickupLocation
:当订单的配送方式为自提时,自提的门店地点productLocation
:订单中商品的库存地点(建议使用商品行中的location
信息,后续将废弃)
Example:pickupLocation
- name string订单编号(和订单 ID 不同,该编号可以在商家后台自定义前缀)。Example:
test1001
- note string商家备注内容,多个以逗号分隔。Example:
Notes
note_attributesobject[]
商家备注内容。create_time string备注创建的时间。格式:ISO 8601。例子:2021-08-31T02:20:26+08:00
Example:2022-11-04T10:18:46+00:00
name string备注来源,卖家标识。Example:Note source
value string备注内容。Example:Notes
- order_at string订单完成的时间。格式:ISO 8601。例子:
2021-08-31T02:20:26+08:00
Example:2021-08-16T08:27:57+00:00
- order_source string订单来源渠道。Example:
pos
- order_status_url string订单状态页 URL。Example:
https://shoptest.myshopline.com/trade/thank_you?mainOrderMark=xxx&mainOrderSeq=200565776406008509
payment_detailsobject[]
支付单信息。create_time string支付单创建时间。格式:ISO 8601。例子:2021-08-31T02:20:26+08:00
Example:2021-08-16T08:27:57+00:00
pay_amount double支付金额。Example:8
pay_channel_deal_id string支付流水号,支付渠道生成的支付号。Example:pi_3MI897Hezv8FxjBO1uGxMPhX
pay_seq string支付网支付单号,SL 内部定义的支付单的唯一编号请求号。Example:23057287797738260472676128
pay_status string支付单状态。有效枚举值包含:unpaid
:未支付pending
:支付中risking
:风控中paid
:已支付paid_overtime
:支付超时paid_failed
:支付失败
Example:unpaid
processed_at string支付单完成的时间。格式:ISO 8601。例子:2021-08-31T02:20:26+08:00
Example:2023-04-12T22:59:52+08:00
status_code string支付状态码。Example:RISK_PENDING
status_msg string支付单状态码描述。Example:PENDING_REVIEW
- payment_gateway_names array付款方式列表,该订单所用到的付款方式列表:
SLpayments
Paypal(PayPal支付)
Oceanpay(钱海支付)
TwoCheckout
AsiaBill
Stripe
Pacypay
WorldPay
COD(货到付款)
CUSTOM(自定义)
adjustPay(资金调整)
Xendit(xendit 信用卡)
XenditOther
Example:Paypal
payment_termsobject
支付条款详情。due_in_days integer当条款类型为NET
时提供,多少天后未付款则到期。Example:2
id string支付条款的唯一标识 ID。Example:6497210673894431747
overdue boolean支付条款是否超时。true
: 超时false
:未超时
Example:true
payment_schedulesobject[]
与付款条件相关联的一组时间表。issued_at string付款条件启动的时间。当为FIXED
时,为保存时间(若草稿单成单,则订单继承草稿单时间);当为FULFILLMENT/RECEIPT
时,为条件生效时间;当为NET
时,则为保存时间(若草稿单成单,则订单继承草稿单时间)。Example:2024-06-05 08:00:00
payment_terms_name string用于创建付款条件的付款条件模板的名称。Example:Due on receipt
payment_terms_type string用于创建付款条件的付款条件模板类型。有效枚举值包含:FIXED
:商家指定日期FULFILLMENT
:完成发货日期NET
:固定条件日期RECEIPT
:发送账单日期UNKNOWN
:未知类型
Example:RECEIPT
- phone string买家手机号。Example:
19872334222
- po_number stringB2B 场景在订单上记录的采购订单号。
- pos_location_id stringPOS 交易地点。Example:
5327026538935748524
- presentment_currency string买家侧币种。Example:
USD
- processed_at string订单完成的时间。格式:ISO 8601。例子:
2021-08-31T02:20:26+08:00
Example:2023-04-12T22:59:52+08:00
- processed_user_id string订单创建者。Example:
4201057495
- referring_site string外部链接。Example:
https://www.url.com
refundsobject[]
退款列表。created_at string退款单创建的时间。格式:ISO 8601。例子:2021-08-31T02:20:26+08:00
Example:2021-08-16T08:27:57+00:00
id string退款 ID。Example:2605659027312156877634
note string退款备注。Example:Notes
order_id string订单 ID。Example:21056577640603870897253153
processed_at string退款单更新时间。格式:ISO 8601。例子:2021-08-31T02:20:26+08:00
Example:2021-08-16T08:27:57+00:00
user_id string用户 ID。Example:4201057495
- serivce string发货方式类型。有效枚举值包含:
Pickup
:到店取货null
:非到店取货
Example:Pickup
shipping_addressobject
收货地址。address1 string收货人详细地址的第一行。通常是街道地址或邮政信箱编号等信息。Example:Address 1
address2 string收货人详细地址的第二行。通常是公寓、套房或单元等信息。Example:Address 2
city string收货地址中的城市名称。Example:New York
company string收件人的公司名称。Example:Company
country string收货地址中的国家或地区。Example:USA
delivery_store_code string门店编码。Example:1001
delivery_store_name string门店名称。Example:Store
district string收货地址中的行政区名称。Example:Manhattan
district_code string收货地址中区的编码,自定义编号。Example:NY
first_name string买家的名。Example:Tom
last_name string买家的姓。Example:Washington
latitude string收货地址纬度。Example:23.35773
longitude string收货地址经度。Example:116.4151
name string买家的全名。Example:Tom Washington
phone string买家的联系电话。Example:13100000000
province string收货地址中州或省的名称。Example:California
zip string收货地址邮政编号。Example:521000
shipping_linesobject[]
物流信息。code string物流编号。Example:SF534535555324556
discount_allocationsobject[]
折扣明细。amount string折扣金额,数值保留到小数点后两位。例如,88.98
。Example:8.00
amount_setobject
折扣金额,数值保留到小数点后两位。分别以买家币种金额和店铺币种金额展示。discount_application_index integer折扣明细中的位置。Example:1
discounted_price string折扣金额,数值保留到小数点后两位。例如,88.98
.Example:8.00
discounted_price_setobject
折扣金额。分别以买家币种金额和店铺币种金额展示。phone string电话。Example:13100000000
price string物流运费,数值保留到小数点后两位。Example:8.00
shipping_price string原运费金额值,数值保留到小数点后两位。Example:8.00
source string物流类型。Example:SHOPLINE
tax_linesobject[]
物流税费信息。price string物流税费金额,以店铺币种金额展示。Example:8.00
rate double税率。Example:1
title string税费名称。Example:Tax
title string物流名称。Example:Sf international
- source_identifier string用于识别业务处理的 ID 标识。Example:
-
- source_name string买家点击链接访问商店时的营销推荐代码。支持以下 URL 参数:
ref
、resource
或r
。例如,如果 URL 是myshopline.com/products/slide?ref=22dd9dctg
,则该值为22dd9dctg
。Example:-
- source_url string归因URL,买家点击链接并跳转到在线商店。Example:
https://www.url.com
- status string订单状态。有效枚举值包含:
open
:处理中cancelled
:已取消
Example:open
- store_id string店铺 ID。Example:
1644828244663
- subtotal_price string商品折后价总和, 为商品总价 - 营销优惠 - 自定义折扣,以店铺币种展示。
subtotal_price_setobject
商品折后价总和,分别以买家币种金额和店铺币种金额展示。- tags string订单标签。Example:
watch
tax_linesobject[]
订单税费信息。price string订单税费金额,以店铺币种金额展示。Example:8.00
rate double税率。Example:1
title string税费名称。Example:Tax
- tax_number string税号。Example:
111111
- tax_type string税号类型。Example:
Type
- taxes_included boolean总计额是否包含税额。
true
:包含false
:不包含
Example:true
- total_discounts string折扣金额总和,数值保留到小数点后两位,为营销优惠 + 人工折扣,以店铺币种展示。Example:
8.00
total_discounts_setobject
折扣金额总和,数值保留到小数点后两位,为营销优惠 + 人工折扣,分别以买家币种金额和店铺币种金额展示。- total_line_items_price string商品原价总和,数值保留到小数点后两位,以店铺币种金额展示。Example:
8.00
total_line_items_price_setobject
商品原价总和,分别以买家币种金额和店铺币种金额展示。- total_outstanding string未付款金额总额,数值保留到小数点后两位,以店铺币种金额展示。Example:
8.00
total_outstanding_setobject
未付款金额,分别以买家币种金额和店铺币种金额展示。total_shipping_price_setobject
订单运费总和,分别以买家币种金额和店铺币种金额展示。- total_tax string税费总额,数值保留到小数点后两位,以店铺币种金额展示。Example:
8.00
- total_tip_received string小费,数值保留到小数点后两位,以店铺币种金额展示。Example:
8.00
total_tip_received_setobject
小费,分别以店铺币种金额和买家币种金额展示。- total_weight double商品总重量,单位:g。Example:
100
- updated_at string订单更新的时间。格式:ISO 8601。例子:
2021-08-31T02:20:26+08:00
Example:2022-11-04T10:18:46+00:00
- user_id string买家 ID。Example:
4201057495
- utm_parameters string广告业务专用参数。Example:
-
响应
收到 SHOPLINE 发送的 Webhook 通知后,你需要按照如下 SHOPLINE 要求的格式进行响应。
HTTP/1.1 200 OK
关于如何订阅 Webhooks 及更多 Webhook 响应规则说明,请参考 Webhook 概述。
这篇文章对你有帮助吗?