Refund Creation
Refund creation is managed by Flowlyze through a Flowlyze Webhook.
Refund Creation Flow Configuration
In addition to the base data flow configuration, it is necessary to add the following settings in the destination's Settings Override:
| Field | Value | Note |
|---|---|---|
Base Url | https://adapt.flowlyze.com | adapter URL |
Resource Path | api/adp/shopify/egress/create-refund-on-shopify | adapter path for refund creation flow. |
Headers :: x-api-key | ********** | API key for endpoint interaction verification |
Headers :: x-shopify-access-token | shpat_CODICEALFANUMERICO | Secret of the custom app created for integration |
Headers :: x-shopify-graphql-url | https://SHOPIFYURL.myshopify.com/ | Shopify shop URL to connect to |
Input Message
The message to send to create the refund is characterized by the following fields:
orderName: name of the order to refund (mandatory).refundAmount: refund value in header, applies to all order lines.refundShippingAmount: refund value on shipping.refundAllItems: field to enable total refund on order lines.totalShippingRefund: field to enable total refund on shipping.refundLineItems: collection of order lines to refund and related specifications.notifyCustomer: field to indicate whether to notify the customer or not (default: true).reason: field used to specify the reason for the refund.
Each object in the refundLineItems field is characterized by the following fields:
sku: sku of the order line to refund (mandatory).quantity: quantity of items refunded from an order line.refundAmount: refund value on the order line.refundLineTotally: field to enable total refund of a single order line.
Some properties are mutually exclusive with each other, and cannot be set simultaneously:
refundShippingAmountandtotalShippingRefundcannot both be set; if total shipping refund is set, the specific refund amount must be zero.refundAllItems,refundAmountandrefundLineItems, if total item refund is requested, it is not possible to specify neither the partial refund amount nor the list of items to refund;- Within
refundLineItems, some properties are subject to logical consistency constraints:- At least one of the following conditions must be valid for each element:
refundLineTotally = true, orquantity > 0, orrefundAmount > 0.
- The combination where
refundLineTotally = falseandquantity = 0is not allowed; at least one of the two must be set. - If
refundLineTotally = falseandrefundAmount > 0, thenquantitymust be greater than zero.
- At least one of the following conditions must be valid for each element:
The quantity and refundAmount properties for an order line of refundLineItems must instead be set simultaneously, if set.
The refund currency is that of the customer's order requesting it.
Input Message Examples
- Partial shipping refund and partial order line refund, with one line refunded totally, and the other for 1 quantity.
{
"orderName":"#1061",
"notifyCustomer": true,
"reason": "Damaged items",
"refundShippingAmount": "9.99",
"refundLineItems": [
{
"sku": "135DFE",
"refundLineTotally": true
},
{
"sku": "136HJK",
"quantity": 1,
"refundAmount": "90.30"
}
]
}
- Partial shipping refund and total order line refund
{
"orderName":"#1061",
"notifyCustomer": false,
"refundShippingAmount": "9.99",
"refundAllItems": true
}
- Total shipping refund and header order line refund
{
"orderName":"#1061",
"notifyCustomer": true,
"totalShippingRefund": true,
"refundAmount": "349.99"
}