When a Zendesk ticket is tagged refund, refunds the customer's latest Shopify order, asking your support lead first for $50 or more.

UsesShopifyZendesk

Refund Shopify orders from Zendesk refund tickets

When a Zendesk ticket is tagged 'refund', this finds the customer's most recent Shopify order by their email.

Orders under $50 are refunded straight away. Orders of $50 or more wait for your support lead to approve. After a refund the customer gets a reply on the ticket, and every outcome, including no order found, leaves an internal note so the team can see what happened. Change the $50 limit in the step that checks the order's total.

ZendeskZendeskWhen a ticket is tagged. Save it as ticket.When a ticket is tagged. Save it as ticket.
Who approves refunds of $50 or moreSet support_lead_email to blank.
ShopifyCustomer's most recent Shopify orderList orders. Save it as recent_orders.Shopify
The order to refundSet order to recent_orders.orders[0].
Is the refund going ahead?Set approved to true.
What happened, for the internal noteBuild the text “Refunded @order.total_display on Shopify order @order.name automatically, as it is under $50.” and save it as what_happened.
No order, or $50 or more?If recent_orders.count is 0
Yes
Change approved to false.Change approved to false.
Build the text “No refund made: there is no Shopify order placed with @ticket.requester_email. Please find the order by hand.” and save it as what_happened.Build the text “No refund made: there is no Shopify order placed with @ticket.requester_email. Please find the order by hand.” and save it as what_happened.
Else if @order.total is greater than or equal to 50
Ask a person: Refund order.total_display on Shopify order order.name? Save it as decision.Ask a person: Refund order.total_display on Shopify order order.name? Save it as decision. Who to ask: support_lead_emailCustomer: ticket.requester_name (ticket.requester_email) Order: order.name for order.total_display Zendesk ticket: ticket.subject ticket.url
Change approved to decision.approved.Change approved to decision.approved.
Build the text “The support lead (@decision.decided_by.name) @decision.decision refunding @order.total_display on Shopify order @order.name. @decision.comment” and save it as what_happened.Build the text “The support lead (@decision.decided_by.name) @decision.decision refunding @order.total_display on Shopify order @order.name. @decision.comment” and save it as what_happened.
Otherwise
No steps
Refund going ahead?If approved is yes
Yes
ShopifyShopifyRefund order. Save it as refund.Refund order. Save it as refund.
ZendeskReply to the customerComment on Zendesk ticket ticket. Save it as customer_reply.Hi ticket.requester_first_name, We've refunded refund.amount_display for your order refund.order_name. It goes back to the card or account you paid with. Thanks for your patience.Zendesk
No
No steps
ZendeskInternal note on what happenedComment on Zendesk ticket ticket. Save it as internal_note. Visible to the requester: Nowhat_happenedZendesk