A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hi,
Is there a way to understand via the GraphQL admin API which line item on an order is the "X" when a BuyXGetY discount has been applied to an order? While trying to develop a self-service returns app, I am trying to identify which line items on an order are affected by a BuyXGetY discount. It is (partially) clear which item is the "Y" line item (it has been allocated a discount) but it is unclear which item is the "X".
I thought maybe the "index" field under the DiscountAllocation key would provide some insight but it doesn't appear to.
The reason I am trying to identify the "X" is that I want to force customers to return item "Y" when they choose to return item "X".
I hope that makes sense. Please let me know if I can add more clarification.
Thanks!
Solved! Go to the solution
This is an accepted solution.
Hi Buywithfin,
There is not currently a direct way with the GraphQL API to identify which was the 'X' item in a BuyXGetY discount so we've submitted a suggestion about that on your behalf.
Thanks and hope you have a great day,
Jon551 | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Hi Buywithfin,
There is not currently a direct way with the GraphQL API to identify which was the 'X' item in a BuyXGetY discount so we've submitted a suggestion about that on your behalf.
Thanks and hope you have a great day,
Jon551 | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thanks Jon!