Appearance
V1 订单和物流 API
本章定义订单查询、订单出货、取消交易处理,以及店铺物流仓配置。所有数据均按 Access Token 绑定的卖家租户隔离。
Base Path: /openapi/v1
Authentication: 除特别说明外,均需传入 Authorization: Bearer <access_token>。
设计原则
order_id是 Sugumart 订单 ID;ruten_order_id是露天订单号。- 调用方只提交当前业务动作新增的信息。订单、收件人、商品、金额和末端配送资料由 Sugumart 根据订单快照取得。
- 订单出货使用店铺当前设置的大陆集运仓,不允许在出货请求中临时指定仓库。
- 写请求以订单当前状态为前置条件。重复请求不得重复建立履约或重复处理取消交易。
- 露天或物流商的异步结果通过订单详情和第二章回调通知确认。
处理流程
text
首次配置:GET /warehouses → POST /warehouses/selection
日常处理:GET /orders → GET /orders/{order_id}
├─ POST /orders/{order_id}/ship
├─ POST /orders/{order_id}/cancel
└─ POST /orders/{order_id}/cancel/confirm4.1 订单管理
4.1.1 查询订单列表
GET /openapi/v1/orders
本接口定位为人工查询和订单处理页面使用,不提供增量同步语义。调用方可按订单状态、创建时间或关键字筛选,并使用 limit、offset 浏览结果。
返回当前店铺的订单摘要,固定按 created_at DESC, id DESC 排列。id 是创建时间相同时的稳定第二排序键;V1 不提供自定义排序参数。
Query Parameters
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
limit | number | 否 | 每页数量,默认 20,范围 1-100 |
offset | number | 否 | 偏移量,默认 0,必须为非负整数 |
q | string | 否 | 精确或模糊搜索 Sugumart 订单 ID、露天订单号、商品名称或 SKU |
status | string | 否 | 订单主状态;多个值使用半角逗号分隔,枚举见V1 状态附录 |
view_status | string | 否 | 商家展示状态;多个值使用半角逗号分隔,枚举见V1 状态附录 |
cancellation_pending | boolean | 否 | true 时仅返回等待卖家确认的买家取消申请 |
created_from | string | 否 | 创建时间下界,ISO 8601 UTC,包含边界 |
created_to | string | 否 | 创建时间上界,ISO 8601 UTC,包含边界;不得早于 created_from |
Response (200 OK)
| 字段 | 类型 | 说明 |
|---|---|---|
orders | OrderSummary[] | 当前页订单摘要 |
count | number | 符合筛选条件的订单总数 |
limit | number | 本次分页大小 |
offset | number | 本次分页偏移量 |
Response Example
json
{
"success": true,
"data": {
"orders": [
{
"id": "d2e925a7-b767-407b-8624-c61388ab24b3",
"ruten_order_id": "24080412345678",
"status": "pending_shipment",
"view_status": "pending_shipment",
"buyer_name": "林小姐",
"recipient_name": "林怡君",
"item_count": 1,
"quantity": 1,
"currency": "TWD",
"total_amount": "1280.00",
"cancellation": null,
"active_fulfillment": null,
"available_actions": [
"ship",
"cancel"
],
"status_observed_at": "2026-08-04T03:09:55.000Z",
"shipment_deadline_at": "2026-08-06T03:09:55.000Z",
"created_at": "2026-08-04T02:15:00.000Z",
"updated_at": "2026-08-04T03:10:00.000Z"
}
],
"count": 1,
"limit": 20,
"offset": 0
}
}Error Responses
| Status | code | 说明 |
|---|---|---|
| 400 | validation_error | 查询参数、状态或时间范围无效 |
| 401 | unauthorized | Access Token 无效或已过期 |
4.1.2 查询订单详情
GET /openapi/v1/orders/{order_id}
返回订单商品、金额、收件信息、取消交易和当前履约资料。调用出货或取消接口前,应以本接口返回的 available_actions 判断当前允许操作。
Path Parameters
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
order_id | string(uuid) | 是 | Sugumart 订单 ID |
Response (200 OK)
| 字段 | 类型 | 说明 |
|---|---|---|
order | OrderDetail | 订单完整详情 |
Response Example
json
{
"success": true,
"data": {
"order": {
"id": "d2e925a7-b767-407b-8624-c61388ab24b3",
"ruten_order_id": "24080412345678",
"status": "pending_shipment",
"view_status": "pending_shipment",
"currency": "TWD",
"product_amount": "1200.00",
"shipping_amount": "80.00",
"total_amount": "1280.00",
"recipient_name": "林怡君",
"recipient_phone": "0912345678",
"shipping_address": {
"name": "林怡君",
"phone": "0912345678",
"city": "台北市",
"district": "中山区",
"address_1": "南京东路三段 100 号",
"country_code": "TW",
"identity_name": "林怡君",
"identity_number_masked": "A1******89"
},
"items": [
{
"id": "58dff493-4174-4896-825d-8bc36f8bbc39",
"ruten_item_id": "22408041234567",
"sku": "BAG-BLK-20",
"spec_name": "黑色 / 20L",
"item_name": "轻量防泼水通勤背包",
"quantity": 1,
"currency": "TWD",
"unit_price": "1200.00",
"product_amount": "1200.00"
}
],
"cancellation": null,
"fulfillment": null,
"available_actions": [
"ship",
"cancel"
],
"status_observed_at": "2026-08-04T03:09:55.000Z",
"shipment_deadline_at": "2026-08-06T03:09:55.000Z",
"created_at": "2026-08-04T02:15:00.000Z",
"updated_at": "2026-08-04T03:10:00.000Z"
}
}
}Error Responses
| Status | code | 说明 |
|---|---|---|
| 401 | unauthorized | Access Token 无效或已过期 |
| 404 | order_not_found | 订单不存在或不属于当前店铺 |
4.1.3 订单出货
POST /openapi/v1/orders/{order_id}/ship
为待出货订单登记一个大陆快递单号并建立跨境履约。Sugumart 自动从订单、SKU 和店铺配置取得集运仓、末端配送、收件人、发件人、商品、重量及申报金额。
前置条件
available_actions包含ship。- 店铺已设置有效的大陆集运仓和默认大陆发件地址。
- 订单收件人与清关资料完整。
- 每个订单商品已关联有效 SKU,且具备物流商要求的重量及申报资料。
- 一个订单在 V1 中只建立一个有效履约,并只接受一个大陆快递单号。
Path Parameters
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
order_id | string(uuid) | 是 | Sugumart 订单 ID |
Request Body
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
tracking_number | string | 是 | 大陆快递单号,去除首尾空格后长度 1-100 |
carrier_code | string | 否 | 大陆快递公司代码。Sugumart 优先根据单号识别;无法识别时必须提供 |
json
{
"tracking_number": "SF123456789CN"
}Response (201 Created)
| 字段 | 类型 | 说明 |
|---|---|---|
order | OrderDetail | 已刷新状态和可用操作的订单 |
fulfillment | Fulfillment | 创建后的履约资料 |
Response Example
json
{
"success": true,
"data": {
"order": {
"id": "d2e925a7-b767-407b-8624-c61388ab24b3",
"ruten_order_id": "24080412345678",
"status": "shipped",
"view_status": "shipped",
"available_actions": []
},
"fulfillment": {
"id": "97e78f56-6f67-474b-91cd-3669461ec54d",
"fulfillment_no": "SGM202608040001",
"status": "created",
"tracking_number": "SF123456789CN",
"carrier_code": "SF",
"warehouse_code": "20089",
"external_order_code": "WMS2408040098",
"drop_order_status": "created",
"warehouse_received_at": null,
"shipped_at": null,
"delivered_at": null,
"created_at": "2026-08-04T08:50:00.000Z",
"updated_at": "2026-08-04T08:50:00.000Z"
}
}
}同一订单以同一个 tracking_number 重试时返回 200 OK 和现有结果;使用不同单号重复出货返回 409。
Error Responses
| Status | code | 说明 |
|---|---|---|
| 400 | validation_error | 快递单号或承运商代码格式无效 |
| 400 | carrier_required | 无法识别快递公司,必须提供 carrier_code |
| 401 | unauthorized | Access Token 无效或已过期 |
| 404 | order_not_found | 订单不存在或不属于当前店铺 |
| 409 | order_not_shippable | 当前订单状态不允许出货 |
| 409 | fulfillment_already_exists | 订单已使用其他快递单号建立有效履约 |
| 422 | shipment_configuration_incomplete | 物流仓、默认发件地址或物流商配置不完整;data.missing_fields 返回缺失项 |
| 422 | order_shipment_data_incomplete | 订单、清关、SKU 重量或申报资料不完整;data.missing_fields 返回缺失项 |
| 503 | shipment_provider_error | 物流商暂时不可用或拒绝建立集货单 |
4.1.4 卖家取消交易
POST /openapi/v1/orders/{order_id}/cancel
由卖家主动向露天申请取消交易。该操作不会删除 Sugumart 订单;已经进入有效履约的订单不能通过本接口取消。
Path Parameters
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
order_id | string(uuid) | 是 | Sugumart 订单 ID |
Request Body
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
reason_code | string | 是 | item_defective_or_lost、buyer_unreachable、cancelled_by_agreement、seller_out_of_stock 或 other |
reason | string | 条件必填 | reason_code=other 时必填,去除首尾空格后长度 1-100;其他原因可省略 |
json
{
"reason_code": "seller_out_of_stock"
}Response (200 OK)
| 字段 | 类型 | 说明 |
|---|---|---|
order | OrderDetail | 提交取消请求后的最新订单 |
cancellation | Cancellation | 当前取消交易资料 |
Response Example
json
{
"success": true,
"data": {
"order": {
"id": "d2e925a7-b767-407b-8624-c61388ab24b3",
"ruten_order_id": "24080412345678",
"status": "pending",
"available_actions": []
},
"cancellation": {
"requested_by": "seller",
"status": "pending",
"reason_code": "seller_out_of_stock",
"reason": null,
"requested_at": "2026-08-04T09:00:00.000Z",
"decided_at": null,
"status_at": "2026-08-04T09:00:00.000Z"
}
}
}相同取消原因的重复请求返回当前结果,不重复向露天提交。
Error Responses
| Status | code | 说明 |
|---|---|---|
| 400 | validation_error | 取消原因无效或缺少 reason |
| 401 | unauthorized | Access Token 无效或已过期 |
| 404 | order_not_found | 订单不存在或不属于当前店铺 |
| 409 | order_not_cancellable | 当前订单状态不允许卖家取消 |
| 409 | fulfillment_already_exists | 订单已经进入有效履约 |
| 409 | cancellation_conflict | 已存在内容不同或由买家发起的取消交易 |
| 502 | ruten_provider_error | 露天未接受取消请求 |
4.1.5 确认买家取消交易
POST /openapi/v1/orders/{order_id}/cancel/confirm
同意买家发起的取消交易。仅当 cancellation.requested_by=buyer 且 cancellation.status=pending_confirmation 时允许调用。已付款订单的款项处理由露天取消流程完成,本接口不单独发起退款。
Path Parameters
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
order_id | string(uuid) | 是 | Sugumart 订单 ID |
Request Body
无请求体。
Response (200 OK)
| 字段 | 类型 | 说明 |
|---|---|---|
order | OrderDetail | 确认后的最新订单 |
cancellation | Cancellation | 确认后的取消交易资料 |
Response Example
json
{
"success": true,
"data": {
"order": {
"id": "d2e925a7-b767-407b-8624-c61388ab24b3",
"ruten_order_id": "24080412345678",
"status": "cancelled",
"available_actions": []
},
"cancellation": {
"requested_by": "buyer",
"status": "cancelled",
"reason_code": "cancelled_by_agreement",
"reason": null,
"requested_at": "2026-08-04T08:40:00.000Z",
"decided_at": "2026-08-04T09:05:00.000Z",
"status_at": "2026-08-04T09:05:00.000Z"
}
}
}已确认成功的重复请求返回当前结果,不重复向露天提交。
Error Responses
| Status | code | 说明 |
|---|---|---|
| 401 | unauthorized | Access Token 无效或已过期 |
| 404 | order_not_found | 订单不存在或不属于当前店铺 |
| 409 | cancellation_not_pending | 当前没有等待卖家确认的买家取消申请 |
| 409 | cancellation_already_rejected | 该取消申请已经被拒绝,不能再确认 |
| 502 | ruten_provider_error | 露天未接受确认请求 |
4.2 物流管理
4.2.1 获取露天仓库列表
GET /openapi/v1/warehouses
返回当前店铺可以选择的有效物流仓。列表只包含已启用、未删除且已关联可用物流商的仓库,固定按 code ASC 排列;V1 不提供自定义排序参数。
Query Parameters
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
limit | number | 否 | 每页数量,默认 20,范围 1-100 |
offset | number | 否 | 偏移量,默认 0,必须为非负整数 |
role | string | 否 | consolidation(大陆集运仓)或 return(台湾退货仓) |
Response (200 OK)
| 字段 | 类型 | 说明 |
|---|---|---|
warehouses | Warehouse[] | 当前页可选仓库 |
count | number | 符合条件的仓库总数 |
limit | number | 本次分页大小 |
offset | number | 本次分页偏移量 |
Response Example
json
{
"success": true,
"data": {
"warehouses": [
{
"code": "20089",
"name": "深圳集运仓",
"role": [
"consolidation"
],
"logistics_company_code": "SUGU_LOGISTICS",
"logistics_company_name": "Sugumart 跨境物流",
"address": {
"contact_name": "集运仓收货组",
"phone": "0755-88886666",
"province": "广东省",
"city": "深圳市",
"district": "宝安区",
"address_1": "航城街道示例物流园 2 栋",
"postal_code": "518100",
"country_code": "CN"
}
}
],
"count": 1,
"limit": 20,
"offset": 0
}
}Error Responses
| Status | code | 说明 |
|---|---|---|
| 400 | validation_error | 分页参数或 role 无效 |
| 401 | unauthorized | Access Token 无效或已过期 |
4.2.2 获取当前物流仓
GET /openapi/v1/warehouses/selection
返回当前店铺的物流仓设置及有效性。已选仓库后来被停用或不再满足规则时,仍返回其 code,并将对应 valid 设为 false,避免把错误配置静默表现为“从未设置”。
Response (200 OK)
| 字段 | 类型 | 说明 |
|---|---|---|
selection | WarehouseSelection | 当前店铺物流仓设置 |
Response Example
json
{
"success": true,
"data": {
"selection": {
"consolidation_warehouse": {
"code": "20089",
"name": "深圳集运仓",
"valid": true,
"invalid_reason": null
},
"return_warehouse": {
"code": "20090",
"name": "新北退货仓",
"valid": true,
"invalid_reason": null
},
"logistics_company_code": "SUGU_LOGISTICS",
"updated_at": "2026-08-04T06:00:00.000Z"
}
}
}Error Responses
| Status | code | 说明 |
|---|---|---|
| 401 | unauthorized | Access Token 无效或已过期 |
| 404 | shop_not_found | 当前 Token 未绑定可用店铺 |
4.2.3 设置物流仓
POST /openapi/v1/warehouses/selection
更新当前店铺的大陆集运仓或台湾退货仓。请求采用局部更新语义:省略字段表示保持不变,传 null 表示清空对应设置;至少必须传入一个字段。
Request Body
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
consolidation_warehouse_code | string | null | 否 | 大陆集运仓 code;必须支持 consolidation;null 表示清空 |
return_warehouse_code | string | null | 否 | 台湾退货仓 code;必须支持 return;null 表示清空 |
json
{
"consolidation_warehouse_code": "20089",
"return_warehouse_code": "20090"
}选择规则:
- 集运仓必须位于大陆并支持集运;退货仓必须位于台湾并支持退货。
- 仓库必须启用、未删除且已关联可用物流商。
- 两个非空仓库必须属于同一物流商。
- 清空大陆集运仓后,新的订单出货请求将被拒绝;不影响已经建立的履约。
Response (200 OK)
| 字段 | 类型 | 说明 |
|---|---|---|
selection | WarehouseSelection | 更新后的完整设置 |
Response Example
json
{
"success": true,
"data": {
"selection": {
"consolidation_warehouse": {
"code": "20089",
"name": "深圳集运仓",
"valid": true,
"invalid_reason": null
},
"return_warehouse": {
"code": "20090",
"name": "新北退货仓",
"valid": true,
"invalid_reason": null
},
"logistics_company_code": "SUGU_LOGISTICS",
"updated_at": "2026-08-04T09:10:00.000Z"
}
}
}使用与当前设置相同的值重复请求时,返回当前结果且不产生额外副作用。
Error Responses
| Status | code | 说明 |
|---|---|---|
| 400 | validation_error | 未提供更新字段或字段格式无效 |
| 401 | unauthorized | Access Token 无效或已过期 |
| 404 | warehouse_not_found | 指定仓库不存在或当前店铺不可见 |
| 409 | warehouse_unavailable | 指定仓库已停用、删除或物流商不可用 |
| 409 | warehouse_role_mismatch | 仓库地区或能力不符合指定用途 |
| 409 | warehouse_provider_mismatch | 两个仓库不属于同一物流商 |
公共响应对象
OrderSummary
| 字段 | 类型 | 说明 |
|---|---|---|
id | string(uuid) | Sugumart 订单 ID |
ruten_order_id | string | 露天订单号 |
status | string | 订单主状态,见V1 状态附录 |
view_status | string | 商家展示状态,见V1 状态附录 |
buyer_name | string | null | 买家名称 |
recipient_name | string | null | 收件人名称 |
item_count | number | 订单商品明细种类数,非负整数 |
quantity | number | 商品购买总数量,非负整数 |
currency | string | ISO 4217 币种代码 |
total_amount | string | null | 订单总额,currency 主单位 decimal string,固定 2 位小数 |
cancellation | Cancellation | null | 当前取消交易;不存在时为 null |
active_fulfillment | FulfillmentSummary | null | 当前有效履约;未出货时为 null |
available_actions | string[] | 当前可执行操作:ship、cancel、confirm_cancellation |
status_observed_at | string | null | 最近一次观察到露天订单、付款、出货或取消回复状态的时间,ISO 8601 UTC;尚无外部状态观察记录时为 null。该字段不表示每次本地字段更新的时间 |
shipment_deadline_at | string | null | 当前订单最晚发货时间,ISO 8601 UTC;不适用、尚未计算或订单已无需发货时为 null |
created_at | string | 订单创建时间,ISO 8601 UTC |
updated_at | string | 订单最近更新时间,ISO 8601 UTC |
OrderDetail
OrderDetail 包含 OrderSummary 的全部字段,并增加以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
ruten_order_status | string | null | 最近观察到的露天订单状态 |
ruten_pay_status | string | null | 最近观察到的露天付款状态 |
ruten_shipping_status | string | null | 最近观察到的露天出货状态 |
ruten_respond_status | string | null | 最近观察到的露天取消回复状态 |
buyer_phone | string | null | 买家联系电话 |
buyer_email | string | null | 买家电子邮件 |
recipient_phone | string | null | 收件人联系电话 |
shipping_address | ShippingAddress | 结构化收件及清关资料 |
items | OrderItem[] | 订单商品明细 |
product_amount | string | null | 商品金额,currency 主单位 decimal string,固定 2 位小数 |
shipping_amount | string | null | 运费,currency 主单位 decimal string,固定 2 位小数 |
fulfillment | Fulfillment | null | 当前有效履约完整资料 |
paid_at | string | null | 付款时间,ISO 8601 UTC |
cancelled_at | string | null | 取消完成时间,ISO 8601 UTC |
completed_at | string | null | 订单完成时间,ISO 8601 UTC |
ShippingAddress
| 字段 | 类型 | 说明 |
|---|---|---|
name | string | null | 收件人姓名 |
phone | string | null | 收件人联系电话 |
postal_code | string | null | 邮政编码 |
city | string | null | 城市或县市 |
district | string | null | 行政区 |
address_1 | string | null | 主要地址 |
address_2 | string | null | 补充地址 |
country_code | string | null | ISO 3166-1 alpha-2 国家或地区代码 |
identity_name | string | null | 清关实名姓名;无资料时为 null |
identity_number_masked | string | null | 脱敏后的清关证件号码;不返回完整证件号 |
OrderItem
| 字段 | 类型 | 说明 |
|---|---|---|
id | string(uuid) | 订单商品明细 ID |
ruten_item_id | string | 露天商品 ID |
product_id | string(uuid) | null | 匹配到的 Sugumart 商品 ID |
sku_id | string(uuid) | null | 匹配到的 Sugumart SKU ID |
sku | string | null | SKU 编号快照 |
spec_name | string | null | 规格名称快照 |
item_name | string | 商品名称快照 |
image_url | string | null | 商品主图 URL |
quantity | number | 购买数量,正整数 |
currency | string | ISO 4217 币种代码 |
unit_price | string | null | 单价,currency 主单位 decimal string,固定 2 位小数 |
product_amount | string | null | 商品小计,currency 主单位 decimal string,固定 2 位小数 |
Cancellation
| 字段 | 类型 | 说明 |
|---|---|---|
requested_by | string | buyer、seller 或 system |
status | string | pending、pending_confirmation、confirmed、rejected、cancelled 或 failed |
reason_code | string | null | 取消原因代码 |
reason | string | null | 取消原因补充说明 |
requested_at | string | 取消申请时间,ISO 8601 UTC |
decided_at | string | null | 确认、拒绝或系统完成处理的时间,ISO 8601 UTC |
status_at | string | 当前取消状态生效时间,ISO 8601 UTC;未作出决定时等于 requested_at,已确认、拒绝、取消或失败时等于 decided_at |
FulfillmentSummary
| 字段 | 类型 | 说明 |
|---|---|---|
id | string(uuid) | 履约 ID |
fulfillment_no | string | Sugumart 集货单号 |
status | string | 履约状态,见V1 状态附录 |
tracking_number | string | 大陆快递单号 |
carrier_code | string | 大陆快递公司代码 |
warehouse_code | string | 建立履约时使用的大陆集运仓 code |
created_at | string | 履约创建时间,ISO 8601 UTC |
updated_at | string | 履约最近更新时间,ISO 8601 UTC |
Fulfillment
Fulfillment 包含 FulfillmentSummary 的全部字段,并增加以下字段:
| 字段 | 类型 | 说明 |
|---|---|---|
external_order_code | string | null | 物流商集货单号;尚未取得时为 null |
deliverer_code | string | null | 从露天订单取得的台湾末端承运商代码 |
drop_order_status | string | 大陆快递状态,见V1 状态附录 |
warehouse_received_at | string | null | 集运仓签收入库时间,ISO 8601 UTC |
shipped_at | string | null | 集运仓出库时间,ISO 8601 UTC |
delivered_at | string | null | 买家末端签收时间,ISO 8601 UTC |
completed_at | string | null | 履约完成时间,ISO 8601 UTC |
Warehouse
| 字段 | 类型 | 说明 |
|---|---|---|
code | string | 仓库 code,设置物流仓时使用 |
name | string | 仓库名称 |
role | string[] | 支持用途:consolidation、return |
logistics_company_code | string | 物流公司代码 |
logistics_company_name | string | 物流公司名称 |
address | WarehouseAddress | 仓库地址 |
WarehouseAddress
| 字段 | 类型 | 说明 |
|---|---|---|
contact_name | string | null | 联系人 |
phone | string | null | 联系电话 |
province | string | null | 省份或地区 |
city | string | null | 城市 |
district | string | null | 行政区 |
address_1 | string | 详细地址 |
postal_code | string | null | 邮政编码 |
country_code | string | ISO 3166-1 alpha-2 国家或地区代码 |
WarehouseSelection
| 字段 | 类型 | 说明 |
|---|---|---|
consolidation_warehouse | SelectedWarehouse | null | 当前大陆集运仓;从未设置或已清空时为 null |
return_warehouse | SelectedWarehouse | null | 当前台湾退货仓;从未设置或已清空时为 null |
logistics_company_code | string | null | 当前选择所属物流公司代码;均未设置时为 null |
updated_at | string | null | 最近设置时间,ISO 8601 UTC;从未设置时为 null |
SelectedWarehouse
| 字段 | 类型 | 说明 |
|---|---|---|
code | string | 已保存的仓库 code |
name | string | null | 当前仓库名称;仓库不可用时仍保留 code,名称可能为 null |
valid | boolean | 当前是否仍可用于对应业务 |
invalid_reason | string | null | 无效原因代码;有效时为 null |
通用错误格式
错误响应遵循 V1 统一信封;request_id 仅在请求携带 X-SGM-Request-Id 时返回,需要指出缺失资料时可在 data 中增加结构化字段。
json
{
"success": false,
"code": "order_shipment_data_incomplete",
"message": "Shipment data is incomplete",
"data": {
"missing_fields": ["items[0].weight"]
},
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}注意事项
available_actions由订单、取消交易和履约状态计算,不是独立持久化字段。- 金额均使用 JSON string,单位为对应
currency的主单位,固定 2 位小数。 - 所有时间均为 ISO 8601 UTC;调用方可转换为店铺时区展示,但不得改变原始时间含义。
- 集运仓入库、集运仓出库和买家签收是不同物流节点,不得互相替代。
- 写请求超时后先查询订单详情,再决定是否重试。