Troubling creating returns

Hello, I’m trying to update my square orders to reflect returns. I have returns with or without refunds associated. My main concern is to have line items removed from the order as well as to add the quantity back to the inventory count.

As far as I can tell, it seems like I cannot update the original order directly, but instead have to create a new order on it. My flow is essentially this:

Create a new Order
Create a new OrderReturn (OrderReturn Object - Square API Reference)
Set the OrderReturn SourceOrderId to the original Order’s Id
Create a new OrderReturnLineItem
Set the OrderReturnLineItem SourceLineItemUid to the original Order Line Item’s Uid
Set the OrderReturnLineItem CatalogObjectId the original Order Line Item’s CatalogObjectId
Create a new Money object
Set the OrderReturnLineItem basepricemoney to the Money object

Set the OrderReturn’s return line items to the OrderReturnLineItem
Set the new Order’s returns to the OrderReturn object (although the documentation describes this field on Orders as read-only)

Send the new order to the OrdersApi->createOrder()

What I get back is essentially a blank order that does not reflect the return.

Looking for some help on this. Is OrdersApi->createOrder() the correct endpoint to be hitting? Am I misconfiguring any objects or missing some necessary detail?

Thank you very much.

Currently, creating a return order with our API isn’t currently available. The return order is created when a refund is issued. :slightly_smiling_face:

Thanks for your response. So, is there no way to itemize refunds? For instance, if a customer ordered 5 items and returned 1 on our side, I currently have the money being refunded to them, however the order still shows that they are to receive all 5 items. I’m not seeing anything in the refund API (POST /v2/refunds - Square API Reference) that would suggest this is possible. Can you confirm or deny?

Itemized refunds unfortunately aren’t available with Refunds APIs. Currently if a refund is initiated from our 1st party products like the app or Dashboard you can itemize the refund but not from our API at this time.