获取邮包险报价
接口名:/go/packageOpenApiWeb/OpenApiV2/CalcPrice
Section titled “接口名:/go/packageOpenApiWeb/OpenApiV2/CalcPrice”报价混合接口:支持延保险商详报价、邮包险购物车报价、延保险购物车报价(须传对应延保方案)。
试算带风控。若接口报错,电商平台可视为试算失败、无法购买邮包险。即使前端未勾选邮包险,也可调用本接口获取价格。
完整字段说明见 API 接口文档 · CalcPrice。
注意:
- 欧洲站商品价多为含税;美国站多为不含税。
orderInfo.totalPayPrice语义是实际支付的与商品有关的金额。 - 本页示例口径:
totalPayPrice = totalPrice − preferentialPrice(税、运费另以taxPrice/shipPrice传入,不计入totalPayPrice)。 orderInfo.totalPayPrice是 CalcPrice 的报价计算基数并应传入;preferentialPrice仅用于说明优惠金额,选填,不应为了调用接口而虚构优惠值。- 商品行 JSON 名
ItemPicInfoMain、Properties为 PascalCase。 - 延保方案放在
ppVariant.properties(例如"Plan ID": "2 Years");入参ppVariant各字段无 validate required,「指定方案」只传properties合法。 - 出参延保看
data.ppComputeResult.oVariants[].ppVariants:字段是oSkuId/ppVariants/price(不是oSku/ppVariantItems/priceString)。 - 风控:
rcAction只有accept才可投保。
接口入参示例:
Section titled “接口入参示例:”邮包险试算入参
Section titled “邮包险试算入参”{ "userId": "user-0001", "userEmail": "user-0001@example.com", "orderInfo": { "orderId": "", "currency": "USD", "totalPrice": "150.00", "preferentialPrice": "50.00", "taxPrice": "0.00", "shipPrice": "0.00", "totalPayPrice": "100.00" }, "buyerIp": "198.51.100.10", "cartToken": "cart_7f3c9a21-b4e8-4d0f-9a1c-6e2d8b5f0a13", "isShippingProtectionOpen": true}邮包险试算入参最大保额
Section titled “邮包险试算入参最大保额”{ "userId": "user-0001", "userEmail": "user-0001@example.com", "orderInfo": { "orderId": "", "currency": "USD", "totalPrice": "5050.00", "preferentialPrice": "10.00", "taxPrice": "0.00", "shipPrice": "0.00", "totalPayPrice": "5040.00", "payTime": "" }, "buyerIp": "198.51.100.10", "cartToken": "cart_7f3c9a21-b4e8-4d0f-9a1c-6e2d8b5f0a13", "isShippingProtectionOpen": true}延保险试算入参
Section titled “延保险试算入参”商详,购物车获取商品延保报价可用该接口
{ "userId": "user-0001", "userEmail": "user-0001@example.com", "orderInfo": { "currency": "USD", "totalPrice": "200", "preferentialPrice": "10", "taxPrice": "5", "shipPrice": "20", "totalPayPrice": "190", "itemList": [ { "itemId": "97760109-16ad-40c9-9385-caba381a26aa", "skuId": "sku1", "variantId": "var1", "itemName": "Variant 1", "ItemPicInfoMain": [ "https://xxxxxxxxx/pic1", "https://xxxxxxxxx/pic2" ], "currency": "USD", "unitNum": "2", "unitPrice": "100", "preferentialPrice": "0", "totalPrice": "200", "totalPayPrice": "200", "Properties": { "otherKey1": "1", "otherKey2": "2" } } ] }}延保险试算指定方案入参
Section titled “延保险试算指定方案入参”{ "userId": "user-0001", "userEmail": "user-0001@example.com", "orderInfo": { "currency": "USD", "totalPrice": "200", "preferentialPrice": "10", "taxPrice": "5", "shipPrice": "20", "totalPayPrice": "190", "itemList": [ { "itemId": "97760109-16ad-40c9-9385-caba381a26aa", "skuId": "sku1", "variantId": "var1", "itemName": "Variant 1", "ItemPicInfoMain": [ "https://xxxxxxxxx/pic1", "https://xxxxxxxxx/pic2" ], "currency": "USD", "unitNum": "2", "unitPrice": "100", "preferentialPrice": "0", "totalPrice": "200", "totalPayPrice": "200", "Properties": { "otherKey1": "1", "otherKey2": "2" }, "ppVariant": { "properties": { "Plan ID": "2 Years" } } } ] }}延保险与邮包险混合试算入参
Section titled “延保险与邮包险混合试算入参”{ "userId": "user-0001", "userEmail": "user-0001@example.com", "orderInfo": { "currency": "USD", "totalPrice": "200", "preferentialPrice": "10", "taxPrice": "5", "shipPrice": "20", "totalPayPrice": "190", "itemList": [ { "itemId": "97760109-16ad-40c9-9385-caba381a26aa", "skuId": "sku1", "variantId": "var1", "itemName": "Variant 1", "ItemPicInfoMain": [ "https://xxxxxxxxx/pic1", "https://xxxxxxxxx/pic2" ], "currency": "USD", "unitNum": "2", "unitPrice": "100", "preferentialPrice": "0", "totalPrice": "200", "totalPayPrice": "200", "Properties": { "otherKey1": "1", "otherKey2": "2" }, "ppVariant": { "properties": { "Plan ID": "2 Years" } } } ] }, "isShippingProtectionOpen": true}接口出参示例:
Section titled “接口出参示例:”邮包险试算出参
Section titled “邮包险试算出参”{ "errCode": 0, "errMsg": "success", "data": { "rcResult": { "disRcId": "", "rcState": 0, "rcAction": "accept", "rcMsg": "通过", "rcInfo": {} }, "spComputeResult": { "disComputeId": "xcp-00222550000000000508824155", "computeState": 0, "computeMsg": "success", "currency": "USD", "currencySymbol": "", "totalPrice": "2", "extId": "", "openapiUsdBasePrice": "1.00" }, "ppComputeResult": null }}邮包险试算出参-超过最大保额
Section titled “邮包险试算出参-超过最大保额”{ "errCode": 801027, "errMsg": "试算错误errCode: 801027, errMsg: 邮包险价格,超过最大保额,暂时无法投保", "data": null}延保试算出参
Section titled “延保试算出参”{ "errCode": 0, "errMsg": "success", "data": { "rcResult": { "disRcId": "", "rcState": 0, "rcAction": "accept", "rcMsg": "通过", "rcInfo": {} }, "spComputeResult": { "disComputeId": "xcp-00222550000000000508825155", "computeState": 0, "computeMsg": "未选择邮包险", "currency": "", "currencySymbol": "", "totalPrice": "0.00", "extId": "", "openapiUsdBasePrice": "0.00" }, "ppComputeResult": { "disComputeId": "xcp-00222550000000000508825155", "computeState": 0, "computeMsg": "", "extId": "", "oVariants": [ { "oItemId": "97760109-16ad-40c9-9385-caba381a26aa", "oVariantId": "var1", "oSkuId": "sku1", "ppVariants": [ { "variantId": "", "name": "1 Year", "price": "1.9999", "currency": "USD", "currencySymbol": "", "properties": { "Plan ID": "1 Year", "Product": "Variant 1", "Reference": "97760109-16ad-40c9-9385-caba381a26aa" } }, { "variantId": "", "name": "2 Years", "price": "3.9998", "currency": "USD", "currencySymbol": "", "properties": { "Plan ID": "2 Years", "Product": "Variant 1", "Reference": "97760109-16ad-40c9-9385-caba381a26aa" } } ] } ] } }}延保试算出参-指定方案
Section titled “延保试算出参-指定方案”{ "errCode": 0, "errMsg": "success", "data": { "rcResult": { "disRcId": "", "rcState": 0, "rcAction": "accept", "rcMsg": "通过", "rcInfo": {} }, "spComputeResult": { "disComputeId": "xcp-00222550000000000508825255", "computeState": 0, "computeMsg": "未选择邮包险", "currency": "", "currencySymbol": "", "totalPrice": "0.00", "extId": "", "openapiUsdBasePrice": "0.00" }, "ppComputeResult": { "disComputeId": "xcp-00222550000000000508825255", "computeState": 0, "computeMsg": "", "extId": "", "oVariants": [ { "oItemId": "97760109-16ad-40c9-9385-caba381a26aa", "oVariantId": "var1", "oSkuId": "sku1", "ppVariants": [ { "variantId": "", "name": "2 Years", "price": "3.9998", "currency": "USD", "currencySymbol": "", "properties": { "Plan ID": "2 Years", "Product": "Variant 1", "Reference": "97760109-16ad-40c9-9385-caba381a26aa" } } ] } ] } }}延保险与邮包险混合试算出参
Section titled “延保险与邮包险混合试算出参”{ "errCode": 0, "errMsg": "success", "data": { "rcResult": { "disRcId": "", "rcState": 0, "rcAction": "accept", "rcMsg": "通过", "rcInfo": {} }, "spComputeResult": { "disComputeId": "xcp-00222550000000000508825355", "computeState": 0, "computeMsg": "success", "currency": "USD", "currencySymbol": "", "totalPrice": "3.3", "extId": "", "openapiUsdBasePrice": "1.00" }, "ppComputeResult": { "disComputeId": "xcp-00222550000000000508825355", "computeState": 0, "computeMsg": "", "extId": "", "oVariants": [ { "oItemId": "97760109-16ad-40c9-9385-caba381a26aa", "oVariantId": "var1", "oSkuId": "sku1", "ppVariants": [ { "variantId": "", "name": "2 Years", "price": "3.9998", "currency": "USD", "currencySymbol": "", "properties": { "Plan ID": "2 Years", "Product": "Variant 1", "Reference": "97760109-16ad-40c9-9385-caba381a26aa" } } ] } ] } }}