订单
订单属性
属性名 | 说明 | 必含 | 类型 | 值可能性 | 限制 |
ID | 订单ID | 是 | [integer] | ||
order_tax | 订单商品税费 | 是 | [float] | ||
order_shipping_tax | 订单物流税费 | 是 | [float] | ||
post_date | 创建时间(local) | 是 | [datetime] | Y-m-d H:i:s | |
post_date_gmt | 创建时间(GMT) | 是 | [datetime] | Y-m-d H:i:s | |
post_status | 状态 | 是 | [string] | wc-completed:已完成 wc-on-hold:等待 wc-processing: 进行中 wc-cancelled:已取消 | |
post_password | 订单密钥 | 是 | [string] | ||
post_modified | 更新时间(local) | 是 | [datetime] | Y-m-d H:i:s | |
post_modified_gmt | 更新时间(GMT) | 是 | [datetime] | Y-m-d H:i:s | |
number | 订单编码 | 是 | [string] | ||
payment_method | 支付方式代码 | 否 | [string] | ||
payment_method_title | 支付方式名称 | 否 | [string] | ||
trackname | 物流名称 | 否 | [string] | ||
trackno | 物流单号 | 否 | [string] | ||
track_source | 物流来源 | 否 | [string] | ||
track_date | 发货时间(local) | 否 | [datetime] | Y-m-d H:i:s | |
track_date_gmt | 发货时间(GMT) | 否 | [datetime] | Y-m-d H:i:s | |
financial_status | 交易状态 | 是 | [string] | paid:已支付 partial-refund:部分退款 refund:全部退款 unpaid:未支付 | |
fulfillment_status | 物流状态 | 是 | [string] | unfulfilled:未发货 fulfilled:已发货 | |
billing_user_name | 账单主体姓名 | 是 | [string] | ||
order_shipping | 物流费用 | 是 | [number] | ||
order_total | 订单总金额 | 是 | [number] | ||
transaction_id | 交易号 | 否 | [string] | ||
paid_date | 付款时间(local) | 否 | [datetime] | Y-m-d H:i:s | |
paid_date_gmt | 付款时间(GMT) | 否 | [datetime] | Y-m-d H:i:s | |
note | 订单备注 | 否 | [string] | ||
domain | 生成订单时的绑定域名 | 是 | [string] | ||
billing_address | 账单地址 | 是 | [object] | ||
billing_address>>first_name | 姓 | 是 | [string] | ||
billing_address>>last_name | 名 | 是 | [string] | ||
billing_address>>company | 否 | [string] | |||
billing_address>>address_1 | 地址1 | 是 | [string] | ||
billing_address>>address_2 | 地址2 | 是 | [string] | ||
billing_address>>city | 城市 | 是 | [string] | ||
billing_address>>state | 省份缩写 | 是 | [string] | ||
billing_address>>postcode | 邮编 | 是 | [string] | ||
billing_address>>country | 国家 | 是 | [string] | ||
billing_address>>email | 邮件 | 是 | [string] | ||
billing_address>>phone | 联系电话 | 是 | [string] | ||
billing_address>>address_index | 地址信息串联 | 是 | [string] | ||
billing_address>>subscribed | 是否已订阅 | 是 | [string] | ||
billing_address>>state_name | 省份名称 | 是 | [string] | ||
shipping_address | 收件地址 | 是 | [object] | ||
shipping_address>>first_name | 名 | 是 | [string] | ||
shipping_address>>last_name | 姓 | 是 | [string] | ||
shipping_address>>company | 是 | [string] | |||
shipping_address>>address_1 | 地址1 | 是 | [string] | ||
shipping_address>>address_2 | 地址2 | 是 | [string] | ||
shipping_address>>city | 城市 | 是 | [string] | ||
shipping_address>>state | 省份缩写 | 是 | [string] | ||
shipping_address>>postcode | 邮编 | 是 | [string] | ||
shipping_address>>country | 国家 | 是 | [string] | ||
shipping_address>>address_index | 地址信息串联 | 是 | [string] | ||
shipping_address>>phone | 联系电话 | 是 | [string] | ||
shipping_address>>address_note | 稅号 | 是 | [string] | ||
state_name | |||||
public_url | 公开链接 | 是 | [string] | ||
order_currency | 币种 | 是 | [string] | ||
date_updated | 发货时间 | 否 | [datetime] | Y-m-d H:i:s | |
paypal_email | 贝宝邮箱 | 否 | [string] | ||
path | 订单查看路径 | 否 | [string] | ||
current_time | 当前时间 | 是 | [datetime] | Y-m-d H:i:s | |
number_of_products | 订单所含商品数量 | 是 | [integer] | ||
ip | 下单时的IP | 是 | [string] | ||
country_or_region | 国家地区 | 是 | [string] | ||
user_agent | 下单时的UA | 是 | [string] | ||
refund_amount | 退款总金额 | 否 | [number] | ||
sales_channel_category | 销售渠道分类 | 是 | [string] | ||
refunds | 退款纪录列表 | 否 | [object] | ||
sales_channel | 销售渠道 | 是 | [string] | ||
date_updated | 发货时间 | 是 | [datatime] | ||
processing_at_gmt | [datatime] | ||||
completed_at_gmt | 完成时间 GMT | 是 | [datatime] | ||
processing_at | [datatime] | ||||
completed_at | 完成时间 | 是 | [datatime] | ||
cart_hash | 购物车 hash | [string] | |||
custom_attributes | 自定义属性 | 是 | [array] | ||
refunds>>refund_date | 退款时间(local) | 是 | [datetime] | Y-m-d H:i:s | |
refunds>>refund_date_gmt | 退款时间(GMT) | 是 | [datetime] | Y-m-d H:i:s | |
refunds>>refund_amount | 退款金额 | 是 | [number] | ||
refunds>>refund_reason | 退款理由 | 是 | [string] | ||
refunds>>refund_source | 退款来源 | 是 | [string] | manual:后台手动标记退款 auto:支付方式回调自动处理 | |
is_manual_refund | 是否是手动退款,手动退款的订单不可被自动退款覆盖 | 是 | [boolean] | true:手动退款 false:自动退款 | |
shippings | 物流信息 | 是 | [array] | ||
shippings>>order_item_id | 费用项ID | 是 | [integer] | ||
shippings>>order_item_name | 费用项名称 | 是 | [string] | ||
shippings>>order_item_type | 费用类型 | 是 | [string] | shipping | |
shippings>>order_id | 订单ID | 是 | [integer] | ||
shippings>>cost | 费用 | 是 | [number] | ||
shippings>>total_tax | 税费 | 是 | [string] | ||
shippings>>instance_id | 实例 id | 是 | [string] | ||
shippings>>method_id | 物流 id | 是 | [string] | ||
fees | 其它费用信息 | 是 | [array] | ||
fees>>order_item_id | 费用项ID | 是 | [integer] | ||
fees>>order_item_name | 费用项名称 | 是 | [string] | Shipping Insurance: 运费险 | |
fees>>order_item_type | 费用类型 | 是 | [string] | fee | |
fees>>order_id | 订单ID | 是 | [integer] | ||
fees>>line_total | 费用总额 | 是 | [number] | ||
fees>>fee_amount | 费用小计 | 是 | [number] | ||
fees>>tax_class | 费用类别 | 是 | [string] | ||
fees>>line_tax | 税费总计 | 是 | [number] | ||
fees>>rate | 费率 | 是 | [number] | 最大1 | |
fee>>tax_status | 税费状态 | 是 | [string] | ||
line_items | 商品信息 | 是 | [integer] | ||
line_items>>order_item_id | 订单项ID | 是 | [integer] | ||
line_items>>order_item_name | 订单项名称 | 是 | [string] | ||
line_items>>order_item_type | 订单项目类型 | 是 | [string] | ||
line_items>>order_id | 订单ID | 是 | [integer] | ||
line_items>>price | 商品售价 | 是 | [number] | ||
line_items>>qty | 数量 | 是 | [string] | ||
line_items>>line_total | 商品最终价格 | 是 | [number] | ||
line_items>>product_id | 商品 ID | 是 | [integer] | ||
line_items>>variation_id | 变种 ID | 是 | [integer] | ||
line_items>>public_url | 商品路径 | 是 | [string] | ||
line_items>>line_subtotal | 商品总价 | 是 | [string] | ||
line_items>>regular_price | 原价 | 是 | [string] | ||
line_items>>sku | sku | 是 | [string] | ||
line_items>>properties | 商品属性 | 是 | [array] | ||
attrs | 变种规格 | 是 | [array] | ||
feature_image | 图片信息 | 是 | [object] | ||
discount_record | 优惠券记录 | 是 | [object] | ||
discount_record>>id | 优惠券使用记录ID | 否 | [integer] | ||
discount_record>>order_id | 订单ID | 否 | [integer] | ||
discount_record>>code | 优惠码 | 否 | [string] | ||
discount_record>>discount_type | 优惠类型 | 否 | [string] | ||
discount_recor>>rule_id | 优惠ID | 否 | [integer] | ||
discount_record>>description | 优惠描述 | 否 | [string] | ||
discount_record>>amount | 优惠总额 | 否 | [string] | ||
discount_record>>auto_coupon | 是否自动优惠 | 否 | [string] | ||
discount_record>>free_shipping | 免运费 | 否 | [number] | ||
discount_record>>product_ids | 应用优惠商品 id集合 | 否 | [string] | ||
discount_record>>rule_data | 优惠数据 | 否 | [string] | ||
seller_notes | 订单备注 | 是 | [array] | ||
seller_notes>>id | 备注ID | 否 | [int] | ||
seller_notes>>order_id | 订单ID | 否 | [int] | ||
seller_notes>>note | 备注 | 否 | [string] | ||
seller_notes>>created_at_gmt | 创建时间GMT | 否 | [string] | ||
seller_notes>>updated_at_gmt | 更新时间 GMT | 否 | [string] | ||
conversion_summary | 订单摘要 | 是 | [object] | ||
conversion_summary>>order_id | 订单 id | 是 | [int] | ||
conversion_summary>>order_index | 订单排序 | 是 | [int] | ||
conversion_summary>>interact_times | 交互次数 | 是 | [int] | ||
conversion_summary>>page_visits_count | 浏览量 | 是 | [int] | ||
conversion_summary>>sessions_count | 会话数 | 是 | [int] | ||
conversion_summary>>days_to_conversion | 转化天数 | 是 | [int] | ||
conversion_summary>>device | 设备 | 是 | [string] | ||
conversion_summary>>ip | 顾客 ip | 是 | [string] | ||
conversion_summary>>first_visit | 首次交互 | 是 | [object] | ||
conversion_summary>>first_visit>>landing_page | 落地页信息 | 是 | [string] | ||
conversion_summary>>first_visit>>utm_parameters | utm 参数 | 是 | [object] | ||
conversion_summary>>first_visit>>utm_parameters>>utm_source | utm 来源 | 否 | [string] | ||
conversion_summary>>first_visit>>utm_parameters>>utm_medium | utm 媒介 | 否 | [string] | ||
conversion_summary>>first_visit>>utm_parameters>>utm_campaign | 否 | [string] | |||
conversion_summary>>first_visit>>utm_parameters>>utm_term | 否 | [string] | |||
conversion_summary>>first_visit>>utm_parameters>>utm_content | 否 | [string] | |||
conversion_summary>>first_visit>>referrer_url | 来源地址 | 是 | [string] | ||
conversion_summary>>first_visit>>interact_source | 交互来源 | 是 | [string] | ||
conversion_summary>>first_visit>>created_at | 创建时间 | 是 | [string] | ||
conversion_summary>>first_visit>>created_at_gmt | 创建时间 gmt | 是 | [string] | ||
conversion_summary>>last_visit | 末次交互 | 是 | [object] | ||
conversion_summary>>last_visit>>landing_page | 落地页信息 | 是 | [string] | ||
conversion_summary>>last_visit>>utm_parameters | utm 参数 | 是 | [object] | ||
conversion_summary>>last_visit>>utm_parameters>>utm_source | utm 来源 | 否 | [string] | ||
conversion_summary>>last_visit>>utm_parameters>>utm_medium | utm 媒介 | 否 | [string] | ||
conversion_summary>>last_visit>>utm_parameters>>utm_campaign | 否 | [string] | |||
conversion_summary>>last_visit>>utm_parameters>>utm_term | 否 | [string] | |||
conversion_summary>>last_visit>>utm_parameters>>utm_content | 否 | [string] | |||
conversion_summary>>last_visit>>referrer_url | 来源地址 | 是 | [string] | ||
conversion_summary>>last_visit>>interact_source | 交互来源 | 是 | [string] | ||
conversion_summary>>last_visit>>created_at | 创建时间 | 是 | [string] | ||
conversion_summary>>last_visit>>created_at_gmt | 创建时间 gmt | 是 | [string] |
API
使用提示:
点击 API 展开信息;
字段带有 * 表示必填与响应中一定会携带;
展开每个 Responses 可以查看响应示例。
获取订单列表
GET
/openapi/2021-08/orders
权限要求:read_orders
Query Parameters
Name | Type | Description |
---|---|---|
page | int | 页码 |
filter[search] | string | 模糊匹配订单编号、商品名称、SKU、支付编号、顾客邮箱 |
filter[fulfillment_status] | string | 发货状态 unfulfilled:未发货状态 fulfilled:已发货状态 |
filter[financial_status] | string | 交易状态 paid:已付款 refund:已退款 partial-refund :部分退款 unpaid:未付款 |
page_size | int | 每页数量 |
sort | string | 排序, 可选: date:创建时间 modified_date:修改时间 paid_date:支付时间 total_sales:销售总额 示例:-paid_date |
filter[status] | string | 订单状态 wc-completed:已完成 wc-pending:待付款 wc-processing:已付款 wc-cancelled:已取消 |
filter[date] | string | 按支付时间匹配 |
filter[modified_date] | string | 按更新时间匹配 |
获取订单详情
GET
/openapi/2021-08/orders/{id}
权限:read_orders
Path Parameters
Name | Type | Description |
---|---|---|
id* | int | 订单ID |
更新订单收货地址
POST
/openapi/2021-08/orders/{id}/shipping
权限:write_orders
Path Parameters
Name | Type | Description |
---|---|---|
id* | int | 订单ID |
Request Body
Name | Type | Description |
---|---|---|
shipping* | object | 收货地址 |
shipping.country* | string | 国家代码 |
shipping.address_2 | string | 地址2 |
shipping.city* | string | 城市 |
shipping.first_name* | string | 名 |
shipping.last_name* | string | 姓 |
shipping.address_1* | string | 地址1 |
shipping.phone* | string | 电话 |
shipping.state* | string | 省份代码 |
shipping.postcode* | string | 邮政编码 |
更新发货状态
POST
/openapi/2021-08/orders/{id}/track
权限:write_orders
Path Parameters
Name | Type | Description |
---|---|---|
id* | int | 订单ID |
Request Body
Name | Type | Description |
---|---|---|
trackno* | string | 物流编号 |
sendemail* | boolean | 是否发送邮件,true:是,false:否 |
logistics_company | string | 物流服务商 |
Last updated