i tried to build a custom gift card app to shopify.
one of the functionality is that the customer can send the giftcard to other customer.
i create a webhook that listen to order creation an get the info.
if there is a line item property like "send to other" i want to prevent shopify automatic mail and send it from my api, to the email that the customer insert in "email to send" line item property.
any ideas how i can do that ? i know that gift card hero app do something like this.
thanks for the help !
Hi @omriWedev, this is a great question. I just want to confirm - you're not wanting an email to automatically be sent out when a gift card is created? If so, when you're using the Gift Card object in our GraphQL admin API to create the gift card, what you may first want to do is create the gift card without associating it with a customer ID. Then, once the Gift Card is created without a customer, reassign it to the customer you'd like to send the gift card out to using the GiftCardUpdate mutation.
This will have the effect of stopping the initial gift card email from being sent out upon creation, but then still having it be assigned to the right person. At the moment, it's the best workaround I am aware of, but let us know if you'd like us to forward some feedback on to our product team. I can understand how it might be easier to suppress the email with a field/value within the API call itself.
That said, our Gift Card API is limited to custom/private apps installed Shopify Plus stores only - at the moment, there's not a way to create gift cards for non-Plus stores using the API.
Hope this helps - let us know if we can clarify anything!
Hey, thanks for the response!
i`m thinking about something else to do:
when i get an order, in my api i checked if the order includes my gift card product,
if it includes, i get from it the "email to send" property and with this email i tried to search a customer in my shop and get the id of the customer,
then, i create a gift card with your api with customer_id that i get before.
this could be work ?
Hey @omriWedev - this could work! If I'm understanding correctly, you want to create a separate gift card product, filter for it with an API query and then pull the customer's email from that original order to create a "real" gift card via the Gift Card API?
In theory, you could use an orders query (GraphQL/REST) to pull the customer ID/email as well as to confirm they have that separate gift card product as a line item - then you'd use the Plus Gift Card API we were talking about a bit before to process a usable gift card.
Hope this helps - let us know if we can clarify anything further.