I can’t figure out what I am doing wrong. I can’t seem to be able to get an itemized list of items refunded. Iterating a list of payments, I see a refund amount:
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
Thanks for the quick reply. The Refund object returned only contains the amount. It does not tell me which item within the order was refunded. That’s what I am trying to find.
The refund object will have an order_id. That ID is the refund order_id that will have the itemized retuned items if the refund is an itemized. Please note that not all refunds will be itemized.
Also, you mentioned not all refunds are itemized. If I go to Square’s dashboard, under Payments & Invoices/Transactions, I can see the refund along with the item it was refunded, so I know Square has the data. I’m just trying to understand why is the refunds field in the order blank.
When a refund is created in Square we create a new order which will have all the refund details. What is the refund_id your trying to get the itemized data from?
Ha! In retrospect, that makes sense. It didn’t occur to me to check and see of the order ID within the refund was the same. Indeed, if I request that order ID, I do see the itemized items.
My script iterates through payments and pick the orders from there. I assume this is why I never saw this parallel order. I’m away from my work computer now. I will check when I get back.