Refunds¶
The Refunds pull reads the refunds against refunded and partly refunded orders, for a credit note or a refund in the target system. Each refund record carries its transactions and adjustments, and the order's customer, addresses, discounts, shipping and taxes. The refunded lines sit beneath it.
On a reader, select Refunds as the Shopify Entity.
A refund belongs to its order, and Shopify finds refunds through their orders. The pull reads the orders that match its options and returns each of their refunds. The options and the time window therefore apply to the order, not to the refund.
Reader Options¶
The options work as they do on the Orders pull, with these differences:
- Financial Status has no effect. The pull always reads refunded and partly refunded orders.
- Set Fulfillment Status to
any. Its default,unshipped, leaves out the refunds of orders that have shipped. - Set Order Status to
any. The pull then also reads refunds on closed orders. - Set Use created date/time or updated date/time to
updated. A refund updates its order in Shopify. A window on the created date misses a refund on an order placed before the last run. - Payment Status and Payment Kind have no effect. A refund carries its own transactions.
Shopify Ids to download, API and Timestamps apply as they do to Orders.
Records¶
The pull returns a Refund record for each refund, with a LineItems record for each line it refunds.
Refund¶
The Refund record holds the refund's own fields:
id,created_at,processed_atandnote;restock, whether the refund returned stock;order_id,order_nameandorder_number, the order it belongs to.
IMan flattens its money into numbered field sets:
| Fields | What they hold |
|---|---|
Refund1_ to Refund6_ |
The refund's first six transactions, with their kind, status, gateway, amount and currency |
OrderAdjustment1_ to OrderAdjustment3_ |
The first three order adjustments, such as a refunded shipping charge or a refund discrepancy, with their kind, reason, amount and tax |
The record also carries the order's details, in the same field sets as the Order record: BillTo_, ShipTo_, Customer_, Client_, Discount1_ to Discount5_, DiscountCode1_ to DiscountCode5_, Note1_ to Note10_, Shipping1_ to Shipping3_ and Tax1_ to Tax3_. The order's totals come in both currencies, as order_total_price_shop_money_amount and order_total_price_presentment_money_amount, for example.
LineItems¶
Each LineItems record holds a refunded line:
quantity, the quantity refunded;restock_typeandlocation_id, how and where Shopify restocked it;subtotalandtotal_tax, in both currencies;line_item_fields, from the order line it refunds, such asline_item_sku,line_item_title,line_item_variant_idandline_item_price.
Running from a Schedule¶
The pull keeps its last run time as the Orders pull does, in the same lookup table. See Running from a Schedule for resetting it and for filtering out duplicates. Record the refund's id in the target system. An order with several refunds can then bring each one in once.
Access Scopes¶
The pull needs read_orders, read_customers, read_products and read_locations. Add read_all_orders to read orders created more than 60 days ago. See Access Scopes.
Shopify Reference¶
Refund in Shopify's GraphQL Admin API reference.