How do I determine the processing (return) location for a cross-location refund via the API?
I have a multi-location Square account and I sync refunds into an external inventory/accounting system. I am hitting a case I cannot solve from the API and I want to confirm whether it is possible at all.
Scenario: an item is sold at Location A. Later the customer returns it at Location B (a different physical store, different terminal). I process this as a refund of the original payment.
What I see in the API (all point at Location A):
- The
refund.updatedwebhook and thePaymentRefundobject both carrylocation_id= Location A. - The
Paymentbeing refunded is at Location A, and itsdevice_detailsis the device from the original sale, not the device that processed the return. - The refund’s
order_idresolves to an order whoselocation_idis also Location A. That order hastenders: null.
What the inventory shows (Location B): pulling BatchRetrieveInventoryChanges for the returned item returns:
- A
TRANSFERchange moving quantity from Location A to Location B. - An
ADJUSTMENTat Location B changing stateSOLDtoRETURNED_BY_CUSTOMER.
The dashboard confirms this: the return’s money shows under Location A’s sales report, but the stock is restocked at Location B, and the receipt shows the Location B device.
My questions:
-
Is there any way to determine Location B (where the return was physically processed) for a given refund, other than inferring it from the inventory
TRANSFER/ADJUSTMENTledger? Is it exposed on any financial object I am missing? -
Is there a reliable identifier linking a
PaymentRefund(or its return order) to the resulting inventoryTRANSFERandADJUSTMENTevents? TheInventoryChangeobjects have anid,catalog_object_id,quantity,state, and timestamps, but no order id or refund id, so today the only correlation I have is item + quantity + timestamp, which is not deterministic when two returns of the same item happen close together. -
Is the terminal/device that processed the refund exposed anywhere in the API? It appears on the dashboard receipt but I cannot find it on the
PaymentRefund, the return order, or a tender. -
Would processing the return as an unlinked refund (or a Square for Retail cross-location return that creates its own order) change any of the above? Specifically, would the return location then appear directly on the refund or order object?
Environment: Square-Version: 2025-10-16, PHP SDK square/square 43.2.0.20251016.
Thanks for any guidance.