Itemized Refund

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:

id='1ecrHIg0T8F70jqxV8N93oxl295YY'
created_at='2025-09-07T22:21:10.848Z'
updated_at='2025-09-07T22:21:10.955Z'
...
refunded_money=Money(amount=1150, currency='CAD')
...
order_id='etYXtf6u9Km05bDbF8bH4zek9UGZY'

Using the included order_id, I retrieve the order but there there is nothing telling me about the refund:

order=
Order(
    id='etYXtf6u9Km05bDbF8bH4zek9UGZY',
    location_id='L9VYCMX2RASVZ',
    ...
    discounts=None,
    service_charges=None,
    fulfillments=None,
    returns=None,
    return_amounts=None,
    ...
    refunds=None,
    metadata=None,
    created_at='2025-09-07T22:21:10.659Z',
    updated_at='2025-09-07T22:26:27.267Z',
    closed_at='2025-09-07T22:21:10.981Z',
    state='COMPLETED',
    version=8,
    total_money=Money(amount=1300, currency='CAD'),
    total_tax_money=Money(amount=141, currency='CAD'),
    total_discount_money=Money(amount=0, currency='CAD'),
    total_tip_money=Money(amount=0, currency='CAD'),
    total_service_charge_money=Money(amount=0, currency='CAD'),
    ticket_name=None,
    pricing_options=None,
    rewards=None,
    net_amount_due_money=Money(amount=0, currency='CAD')
)
errors=None

Anything obvious?

TIA

:waving_hand: 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:

Additional Documentation

Refunds and Exchanges
Refunds API
Pay or Refund Invoices

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. :slight_smile:

If you look above, the refunds field in the order in question is blank.

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? :slight_smile:

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.

Thanks!

Glad to hear that you see the itemized refunds. :slight_smile:

Cool. It all works! Thanks!