Shopify Refund/Generate Gift Card for Line Items (v3)
Refunds chosen line items on a Shopify order, or issues a gift card instead, with built-in fraud and rate-limit safety checks. Use it to automate refunds while keeping abuse under control.
What it does
- Refunds specific line items, or all of them, on a Shopify order.
- Can issue a gift card instead of a monetary refund, and refund shipping in full or in part.
- Can calculate a refund without processing it, and block refunds that breach configured safety limits.
Inputs
| Name | Type | Description |
|---|---|---|
| Shopify Token | Credentials | Shopify access token |
| Shopify Domain | Credentials | Shopify sub-domain |
| Order ID | String | Shopify order ID |
| Refund Reason | String | Refund reason that will be added to the order notes |
| Refund Only Shipping? | Optional Boolean | Whether to refund only the shipping fee. Linked to: Shipping Refund Type. Default: false |
| Generate Gift Card? | Optional Boolean | Whether to generate a gift card instead of issuing a refund. Default: false |
| Line Items | Optional List | Shopify line items to be refunded. Default: All line items |
| Only Calculate Refund? | Optional Boolean | Whether to only calculate the refund and not actually perform it. Default: false |
| Restock Type | Optional String | Restock type for the line items. Default: no_restock Possible values: no_restock, cancel, return. |
| Shipping Refund Type | Optional String | Type of refund for the shipping fee. Default: Depending on the line items Possible values: full, partial, none. |
| Partial Shipping Refund Criteria | Optional String | Criteria on which to calculate the partial shipping fee refund. Default: quantity Possible values: quantity, weight. |
| Update Order Note? | Optional Boolean | Whether to update the order note with the refund reason. Default: true |
| Max Refund Amount | Optional Number | Max refund amount for one transaction |
| Check for Previous Refunds? | Optional Boolean | Whether to check for previous refunds for the order customer. Default: true |
| Check Universal Limits? | Optional Boolean | Whether to check for domain wide number of refunds during last hour, 12 hours and 24 hours. Default: true |
| Check Universal Amount Limits? | Optional Boolean | Whether to check amount refunded in the last 24 hours. Default: false |
| Check for Fraud Limits? | Optional Boolean | Whether to check for shipping/billing addresses and card details limits. Default: false |
| Send Notifications to DG Slack channel? | Optional Boolean | Whether to send notifications to the DG Slack channel if the universal limits were exceeded |
| Fraud Records Limit | Optional Number | Limit for refunds created for address/card number/card name. Linked to: Check for Fraud Limits. Default: 1 |
| Fraud Addresses Limit | Optional Number | Limit for refunds created from different addresses for a specific zip code. Linked to: Check for Fraud Limits. Default: 5 |
| Hour Limit | Optional Number | Hour limit for refunds created. Linked to: Check Universal Limits. Default: 10 |
| Twelve Hour Limit | Optional Number | Twelve hour limit for refunds created. Linked to: Check Universal Limits. Default: 30 |
| Twenty Four Hour Limit | Optional Number | Twenty four hour limit for refunds created. Linked to: Check Universal Limits. Default: 50 |
| Twenty Four Hour Amount Limit | Optional Number | Twenty four hour amount limit for refunds created. Linked to: Check Universal Amount Limits. Default: 2000 |
Outputs
| Name | Type | Description |
|---|---|---|
| Operation Successful? | Boolean | Whether the refund/gift card was created/calculated successfully |
| Calculate Refund Only? | Boolean | Whether to only calculate the refund and not actually process the refund |
| Blocked by Safety Checks? | Boolean | Whether the refund was blocked by safety/fraud checks |
| Order Meta Fields Created? | Boolean | Whether the refund order meta fields were created |
| Fraud Prevention Meta Objects Created? | Boolean | Whether the fraud prevention addresses/card details meta objects were created |
| Refund Meta Object Created? | Boolean | Whether the refund meta object was created |
| Refund Meta Object Updated? | Boolean | Whether the refund meta object was updated after the refund |
| Refund Details | Object | Refund details |
| Amount | Number | Amount |
| Amount String | String | Amount and currency |
| Gift Card Code | String | Gift card code. Dependant on: Generate Gift Card |
Notes
- Use Only Calculate Refund to preview the amounts without actually refunding.
- The universal, amount and fraud limit checks guard against abuse and can block a refund even when everything else is valid.
API reference
Updated 20 days ago
Did this page help you?