Return updated
The Return updated trigger starts a workflow when one or more fields on a return, its line items, or its reverse fulfillment orders change in your store. You choose which return fields matter, and the workflow runs only when one of those fields changes, such as when the return's status changes or a restocking fee is added.
To start a workflow when a return reaches a specific stage, you can also use a trigger for that stage, such as the Return requested, Return approved, or Return closed trigger.
On this page
Fields available to monitor
The Return updated trigger requires you to select at least one field to monitor. You can select up to five fields. When any one of the selected fields changes, the workflow runs. Changes to fields that you didn't select don't start the workflow.
Review the following table to learn more about the fields that you can monitor.
| Field type | Fields |
|---|---|
| Return | closedAt, decline, requestApprovedAt, status |
| Return line items | returnLineItems.quantity, returnLineItems.refundableQuantity, returnLineItems.refundedQuantity, returnLineItems.restockingFee, returnLineItems.restockingFee.amountSet, returnLineItems.restockingFee.amountSet.presentmentMoney, returnLineItems.restockingFee.amountSet.shopMoney, returnLineItems.restockingFee.percentage, returnLineItems.unprocessedQuantity |
| Exchange line items | exchangeLineItems |
| Return shipping fees | returnShippingFees, returnShippingFees.amountSet, returnShippingFees.amountSet.presentmentMoney, returnShippingFees.amountSet.shopMoney |
| Reverse fulfillment orders | reverseFulfillmentOrders, reverseFulfillmentOrders.lineItems, reverseFulfillmentOrders.status |
A field with a name that ends in amountSet holds an amount in two currencies. When you monitor the field, a change to either amount starts the workflow. To monitor only one of the amounts, select the field's shopMoney field for the amount in your store's currency, or the field's presentmentMoney field for the amount in the customer's currency.
Some fields also start the workflow when an item is added to the return or removed from the return:
- If you monitor a field in the Return line items group, then adding a line item to the return or removing a line item from the return starts the workflow.
- If you monitor a restocking fee field, such as
returnLineItems.restockingFee.percentage, then adding a restocking fee to a line item or removing it starts the workflow. - If you monitor the
exchangeLineItemsfield, then adding an exchange item to the return or removing an exchange item from the return starts the workflow. - If you monitor a field in the Return shipping fees group, then adding a return shipping fee or removing a return shipping fee starts the workflow.
- If you monitor a field in the Reverse fulfillment orders group, then adding a reverse fulfillment order to the return starts the workflow. If you monitor the
reverseFulfillmentOrdersfield or thereverseFulfillmentOrders.lineItemsfield, then removing a line item from a reverse fulfillment order also starts the workflow.
Select the fields that start the workflow
Select the fields that start the workflow when they change.
Steps:
- In the workflow editor, click the Return updated trigger.
- In the Select return fields section, click Select fields.
- In the Add field to monitor dialog, search for or browse to the field that you want to monitor, and then select it.
- Optional: Repeat steps 2 and 3 to monitor up to five fields.
Fields
The Return updated trigger contains the following fields, which can be used in conditions and actions, and to get data in the workflow. The Return and Shop fields are always available. The other fields are available only when you monitor a related field. For example, the Reverse Fulfillment Order field is available when you monitor a reverse fulfillment order field, such as reverseFulfillmentOrders.status.
| Field | Description |
|---|---|
| Return | The return that was updated. |
| Shop | The shop where the return was updated. |
| Return Line Item | The return line item that changed. Empty when a line item was removed from the return. Available when you monitor returnLineItems.quantity or a restocking fee field. |
| Exchange Line Item | The exchange line item that was added. Empty when an exchange line item was removed. Available when you monitor the exchangeLineItems field. |
| Reverse Fulfillment Order | The reverse fulfillment order that changed. Available when you monitor a reverse fulfillment order field. |
If you monitor fields of different types, then the Return Line Item, Exchange Line Item, and Reverse Fulfillment Order fields can be empty when the workflow runs. For example, if you monitor both status and returnLineItems.quantity, then the Return Line Item field is empty when only the status changes. The Return Line Item and Exchange Line Item fields can be empty even when you monitor only fields of their type. Before you use one of these fields in an action, add a condition that checks that the field has a value.
The Return updated trigger provides only the current values of the return and its line items. The previous values of the fields that changed aren't available in the workflow. For example, if you monitor the status field, then you can use the return's current status in a condition or action, but you can't use the status before the change.
Actions
This trigger provides a return object, so it lets you use any action that requires a return. In addition, because the return object includes an order, the trigger can be used with any order actions, including:
- Add order line item
- Add order tags
- Archive order
- Cancel order
- Capture payment
- Hold fulfillment order
- Mark order as paid
Orders allow you to access other data such as the customer, so it can be used with customer actions. These include:
- Add customer tags
- Remove customer metafield
- Remove customer tags
- Update customer metafield
- Update customer note
Orders also contain lists of data such as line items. Using a For each action, you can loop through these lists and perform actions on each item. For example, you can loop through the line items and add a tag to each product.
Testing the Return updated trigger
To test a workflow that starts with this trigger, turn on the workflow, and then change one of the fields that the workflow monitors on a return in the Shopify admin. For example, create a return, and then process the return or close the return.
API details
The Return updated trigger allows actions to be taken with the Return GraphQL API object. This trigger corresponds to the update action of the Return topic in the Shopify Events reference, filtered to the fields that you choose to monitor.