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.