Capture transaction does not account for gift cards used

Highlighted
Shopify Partner
9 0 2

When sending a capture transaction for an order that included partial payment via gift card, the capture transaction will attempt to capture the full order amount, without accounting for the fact the the order was already partially paid with a gift card.   Is there some way to force the capture transaction to only capture the unpaid balance?

For example, an order is place where the order total (merchandise, tax, and freight) is $76.48.  A $10 gift card is applied during checkout, leaving an unpaid balance of $66.48.  The shop is setup to only authorize payments at checkout, and the credit card on the order is authorized for the unpaid balance of $66.48.  

Later, when sending a simple capture request ({"transaction":{"kind":"capture"}}), I would expect this to only attempt to capture the unpaid balance since I am not specifying an amount in the API request.  But instead, Shopify will attempt to capture the entire order amount of $76.48 (ignoring the $10 paid by gift card).  This capture transaction will fail since the authorization is only for $66.48, and Shopify will return an error result ({"errors":{"base":["Cannot capture more than the authorized 66.48 for this payment."]}})

Any suggestions on how to force the capture to only capture the unpaid balance are appreciated!

0 Likes
Highlighted
Shopify Partner
9 0 2

Any ideas how to handle this?  The basic Shopify 'capture' should be able to account for any other payments already on the order, so this seems like a bug to me.

0 Likes
Highlighted
New Member
6 0 0

I am having the same issue. Did you ever figure this out?

0 Likes
Highlighted
Shopify Partner
9 0 2

No, I haven't found a solution to this problem.  Technically, I suppose I could read through all of the transactions to try to add up what amount is still owed, but that isn't a good long-term solution since Shopify may add or change the payment transactions and cause the logic to fail.  Since the 'authorize' transaction already accomodated the gift card amounts, it seems that the 'capture' transacation should as well.  The fact that it doesn't seems like a bug to me.

0 Likes
Highlighted
New Member
6 0 0

yeah, I agree that is seems like a bug. It would be nice if someone would step in and at least confirm our suspicions.

0 Likes
Highlighted
Shopify Partner
22 1 10

Can anyone from Shopify confirm the definitive logic app developers must use to capture a full payment amount on an order without causing an error?

The documentation on https://shopify.dev/docs/admin-api/rest/reference/orders/transaction#create-2020-10 states:

Capture the full amount for an authorized order, and associate the capture with an authorization by including its authorization code

Screen Shot 2020-10-23 at 12.22.11 PM.png

However, it seems that when a Gift Card is used we need to do an additional calculation to ensure we don't over-charge the authorized card. In addition to using Gift Cards, are there other considerations we must take into account when trying to capture remaining payment on an order? Is there general documentation on how we must manually perform this calculation given all possible use-cases?

Sorry if I am missing something obvious but I was unable to find clear documentation that states exactly how to determine what the remaining balance on an order is.

0 Likes