Developer changelog

Subscribe to the changelog to stay up to date on recent changes to Shopify’s APIs and other developer products, as well as preview upcoming features and beta releases.

Get updates by RSS

Return mutation will update sales (previously unchanged until time of Refund)

API

Action required

As of February 20, 2024, the returnCreate mutation and the returnApproveRequest mutation will create return sales on the order. Each returned item will create a product type return sale. Previously, these mutations did not create sales.

To keep track of line item or value changes to the order due to returns, we will soon provide more information on subscribing to enhanced Return related webhooks. Stay tuned for these details.

Related changes

Return fees as RETURN type

When a merchant adds return fees to a return using the admin, return fees will show up as a RETURN OrderActionType on a SalesAgreement.

LineItem.currentQuantity and LineItem.refundableQuantity definition changes

Previously, both LineItem.currentQuantity and LineItem.refundableQuantity returned identical numbers. They represented the total quantity of the line item minus the quantity that had been removed.

The definitions of these properties have been updated:
- LineItem.currentQuantity: This property now considers returns that are in progress, even if they haven't been refunded yet. CurrentQuantity will now be the line item's total quantity minus the removed or returned quantity.
- LineItem.refundableQuantity: It now represents the line item's total quantity minus the refunded quantity, not the removed quantity. This indicates the quantity of line items that are available for a refund, including items in a return.

These changes affect all currently supported APIs (GraphQL, REST, liquid, etc.)

Use ReturnRefund when refunding a return line

Use the returnRefundGraphQL mutation when refunding a line item on a return to guarantee accurate sales ledger entries. We strongly encourage developers to migrate away from using refundCreate and POST refund to refund return line items due to potential inaccuracies in the sales ledger due to both returns and refunds producing product type return sales.