Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Gift Card not deducted when creating order

Gift Card not deducted when creating order

MrBasicX
Shopify Partner
5 0 4

Hey there, I am trying to create an order through the Rest API where I am adding a Gift Card transaction; I am able to create the order with the proper transaction but the relevant gift card is not deducted for the charged amount.

I found this thread which mentions the same issue but a solution was not provided https://community.shopify.com/c/api-announcements/gift-card-requirement-on-gift-card-transactions/m-...

As mentioned in this thread, I tried refunding another order created the same way and it does show up in the gift card timeline, but not the orders made using the gift card.

Any input on this issue will be highly appreciated.

Edit: the following is the transaction block of the request

{
  "kind": "sale",
  "status": "success",
  "gateway": "gift_card",
  "amount": "15.00",
  "gift_card_id": <gift-card-id>,
  "gift_card_last_characters": "1g94",
  "receipt": {
    "gift_card_id": <gift-card-id>,
    "gift_card_last_characters": "1g94"
  }
}
Reply 1 (1)

GrahamS
Shopify Staff (Retired)
193 37 55

Hello @MrBasicX ,

 

Thanks for checking in.

 

What you are seeing is an expected behaviour. When it comes to API, an important thing to consider is that a transaction record (what you see in the transactions.json) is not in itself a payment processing event. In order for an entry to that record to be meaningful, you have to also perform the necessary payment processing operation to go along with it, otherwise it's just a record of something that never actually occurred. You can think of processing gift cards as extremely similar to processing credit cards, and will require the use of the Checkout API in order to complete.

 

Best,

 

To learn more visit the Shopify Help Center or the Community Blog.