question

brokenOval avatar image
brokenOval asked ·

Relationship between item "refunded" item and "refunds" array

I'm trying to track refunds and assumed that if an order was refunded all the line items (or some items if a partial refund) would be marked as "refunded": TRUE. My assumption was that total refund amount would be equal to the total price of all the items refunded:

i.e. this amount

"refunds": { "elements": [ { "amount": 265, },

should equal some lineItem in the order e.g.:

"lineItems": { "elements": [ { "price": 265, "refunded": false, }

however I'm finding that there are a number of instances (as shown above) where the lineItem is not marked as "refunded": true

Is this a bug or am I misunderstanding some logic?

Thanks!

Refund
2 comments
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

What endpoint are you using to request this data?

0 Likes 0 · ·

End point looks like this: https://api.eu.clover.com:443/v3/merc...token=<access_token>&limit=1000&expand=overrideMerchantTender,refunds,lineItems,payments.tender,discounts&returnnull_fields=true

0 Likes 0 · ·

1 Answer

Mark Mullan avatar image
Mark Mullan answered ·

Hi @brokenOval,

The core issue is that a Payment Refund is intrinsically different than a Lineitem Refund. For example, if multiple payments are used on a single order, and you want to refund one of those payments, how do you then determine which Lineitem to mark as refunded?

When a merchant is given the option of refunding either a payment or individual lineitems (screenshot below), only refunds at the lineitem level will toggle the lineitem "refunded" property.

Hope this helps,

Mark

image description

1 comment Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

That does make sense - thanks Mark

0 Likes 0 · ·

Welcome to the
Clover Developer Community