截至 API 版本 2026-04,税务合作伙伴应用的税务计算请求现在可以包含购物车行项目属性。这些属性是商家可以添加到各个行项目的自定义名称-值对。
- 商家在单个购物车行项目上配置属性(例如 token、personalization 或 gift_wrap)。
- 税务合作伙伴应用指定它们希望接收所有行项目中的哪些属性键
- 只有被请求的属性键才会包含在计算请求中。
键限制
您可以指定最多五个键。这五个键的限制适用于合作伙伴希望接收哪些属性键,而不是行项目的数量。例如:
- 合作伙伴进行配置:["token", "personalization"] (2 keys)
- 购物车包含:10 个行项目
- 结果:所有 10 个行项目都将包含各自的 token 和 personalization 值(如果存在)
示例负载
delivery_groups[].cart_lines[] 对象中的购物车行项目现在为每个行项目包含一个可选的 properties 字段。
之前(2026-04):
{ "delivery_groups": [{ "cart_lines": [{ "id": "gid://shopify/CartLine/123", "quantity": 1, "merchandise": { "id": "gid://shopify/ProductVariant/456", "title": "Custom T-Shirt" }, "cost": { "amount_per_quantity": { "currency_code": "USD", "amount": "25.00" } } }] }] }(2026-04)及之后:
{ "delivery_groups": [{ "cart_lines": [ { "id": "gid://shopify/CartLine/7", "quantity": 1, "merchandise": { "id": "gid://shopify/ProductVariant/456", "title": "Custom T-Shirt" }, "cost": { "amount_per_quantity": { "currency_code": "USD", "amount": "25.00" } }, "properties": { "token": "abc-123", "personalization": "John Smith" } }, { "id": "gid://shopify/CartLine/6", "quantity": 2, "merchandise": { "id": "gid://shopify/ProductVariant/789", "title": "Custom Mug" }, "cost": { "amount_per_quantity": { "currency_code": "USD", "amount": "15.00" } }, "properties": { "token": "def-456", "personalization": "Jane Doe" } } ] }] }
