同步平台订单
接口名:/go/packageOpenApiWeb/OpenApiV2/SyncPlatformOrder
Section titled “接口名:/go/packageOpenApiWeb/OpenApiV2/SyncPlatformOrder”同步电商平台订单给 Xcotton。订单状态有变化时可再调。最简易做法:生成订单后(未付款前)先传入,付款等导致订单数据变化时再传入。根据订单状态决定是否执行投保。
发货信息可通过本接口传递,也可使用 同步发货接口。
完整字段说明见 API 接口文档 · SyncPlatformOrder。
注意:
orderInfo.receiverInfo本接口必传(试算 CalcPrice 才可不传)。orderInfo.itemList本接口必传:不传会导致保单不记录商品明细,后续无法发起理赔;延保还需在商品行带ppVariant。- 已支付自动承保时:
payTime/paySn必传;orderState需为PAIED或之后。 orderState必须用这些字面量(不要改成英语正确拼写):UNPAIED/PAIED/UNSHIPED/SHIPED/DELIVERED/FINISHED。见 订单状态。- 商品行 JSON 名
ItemPicInfoMain、Properties为 PascalCase;延保方案在ppVariant.properties。 - 购买延保的商品行必须同时提供商品级
insuredPayPrice、有效的ppVariant.price和ppVariant.properties;properties中的Plan ID应使用报价接口返回的真实方案值。未购买延保时请省略ppVariant或传null,不要传空对象{}。 - 出参看
data.orderId/xmhShopOrderId/insurance.spInsureDetail.serviceOrderId/insurance.ppInsureDetail.insureItemList。 - API Reference 的 Try-it 成功同步后,服务单号显示在联调设置「上次同步」中,供理赔「填入当前请求」使用。订单与发货示例共用同一个
orderId;「填入当前请求」不改 Body。
接口入参示例:
Section titled “接口入参示例:”{ "userId": "customer-005", "userEmail": "customer@example.com", "orderInfo": { "orderId": "order-005", "currency": "USD", "totalPrice": "201.00", "preferentialPrice": "10.00", "taxPrice": "0.00", "shipPrice": "0.00", "totalPayPrice": "191.00", "insuredPayPrice": "0.00", "insuredPayPriceForExtended": "1.00", "payTime": "2025-08-18T15:37:22+08:00", "paySn": "pay-005", "itemList": [ { "itemId": "item-001", "skuId": "SKU001", "orderGoodsId": "orderGoodsId001", "itemName": "Sample protected product", "ItemPicInfoMain": [ "https://example.com/product-001.jpg" ], "currency": "USD", "unitNum": "1", "unitPrice": "120.00", "preferentialPrice": "5.00", "totalPrice": "120.00", "totalPayPrice": "115.00", "insuredPayPrice": "1.00", "Properties": {}, "ppVariant": { "variantId": "pp-variant-1y", "name": "1 Year", "price": "1.00", "currency": "USD", "currencySymbol": "$", "properties": { "Reference": "item-001", "Plan ID": "1 Year", "Product": "Sample protected product" } } }, { "itemId": "item-002", "skuId": "SKU002", "orderGoodsId": "orderGoodsId002", "itemName": "Sample product without protection", "ItemPicInfoMain": [ "https://example.com/product-002.jpg" ], "currency": "USD", "unitNum": "1", "unitPrice": "80.00", "preferentialPrice": "5.00", "totalPrice": "80.00", "totalPayPrice": "75.00", "Properties": {} } ], "receiverInfo": { "receiverShipAddress": { "country": "United States", "countryCode": "US", "province": "California", "provinceCode": "CA", "city": "Los Angeles", "postalCode": "90001", "address": "125 Main Street", "linkName": "Jessy Doe", "mobile": "+1-202-555-0100" } }, "orderState": "PAIED", "orderCreateTime": "2025-08-18T15:30:00+08:00", "orderModifyTime": "2025-08-18T15:37:22+08:00" }, "disRcId": "xrc-example-005", "disComputeId": "xcp-example-005", "buyerIp": "192.0.2.10"}接口出参示例:
Section titled “接口出参示例:”{ "errCode": 0, "errMsg": "success", "data": { "orderId": "order-005", "xmhShopOrderId": "9372657428", "insurance": { "spInsureDetail": { "serviceOrderId": "" }, "ppInsureDetail": { "insureItemList": [ { "itemId": "item-001", "skuId": "SKU001", "orderGoodsId": "orderGoodsId001", "itemName": "Sample protected product", "currency": "USD", "unitNum": "1", "insuredPayPrice": "1.00", "Properties": { "Reference": "item-001", "Plan ID": "1 Year", "Product": "Sample protected product" }, "serviceOrderIds": [ "20250818XPP0001ABCD" ] } ] } } }}