Discussing APIs and development related to customers, discounts, and order management.
Hi! We are developing a public app that allows Shopify merchants to create & manage Gift Cards. We are currently looking to add a new feature that lets merchants configure conditional gift card application based on cart value.
For example, allow merchants to set up gift cards that can only be redeemed if the cart total reaches a certain amount, like a $100 gift card being applicable only for orders exceeding $1,000.
We would greatly appreciate any guidance on how to best implement this feature within our app.
Hi Yusoof,
This is a great idea for expanding on the native gift card functionality, and you'd likely be using the Cart API to get the details of the items in the cart, including their prices and a carts total value. Then you could perform your own validation logic that would be part of your app's backend but uses the data obtained from the Cart API. You can also use the Cart API to update the cart's state and display relevant messages.
Liam | Developer Advocate @ 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
Thank you for the insights on using the Cart API. To clarify the specific implementation we are aiming for, would it be possible to perform the cart value check and conditionally apply the gift card directly on the checkout page, as the user attempts to redeem it?