大数跨境

客户账户 API 现已支持草稿订单的折扣应用信息

客户账户 API 现已支持草稿订单的折扣应用信息 Shopify电商独立站
2026-07-01
2
导读:截至 GraphQL 客户账户 API 版本 2026-07,草稿订单现在会暴露折扣应用。

截至 GraphQL Customer Account API 2026-07 版本,草稿订单现在会展示折扣应用信息。

您可以在DraftOrder上使用新的discountApplications字段来查询应用于草稿订单的折扣,并在DraftOrderLineItem上使用新的discountAllocations字段来查询折扣如何分配到各个行项目。

例如:

query DraftOrderDiscounts($id: ID!) { draftOrder(id: $id) { discountApplications(first: 10) { nodes { __typename ... on DiscountCodeApplication { code } ... on ManualDiscountApplication { title } allocationMethod targetSelection targetType value { ... on MoneyV2 { amount currencyCode } ... on PricingPercentageValue { percentage } } } } lineItems(first: 10) { nodes { title discountAllocations { allocatedAmount { amount currencyCode } discountApplication { __typename } } } } } }

使用这些字段来了解哪些折扣适用于草稿订单,以及这些折扣如何影响草稿订单项。

【声明】内容源于网络
0
0
Shopify电商独立站
1234
内容 7146
粉丝 0
Shopify电商独立站 1234
总阅读87.4k
粉丝0
内容7.1k