Skip to main content

Refund Creation

Refund creation is managed by Flowlyze through a Flowlyze Webhook.

Destination configuration

Configure a Shopify destination and associate it with the flow, in addition to the basic data flow configuration.

FieldValueNotes
Destination TypeShopify
OperationRefundPOST /egress/create-refund-on-shopify
GraphQL endpoint URLhttps://SHOPIFYURL.myshopify.com/Shopify Admin GraphQL endpoint URL
Admin API access tokenshpat_CODICEALFANUMERICOOr Client ID (API key) + Client secret — see Authentication
Client ID (API key)YOUR_CLIENT_ID
Client secretYOUR_CLIENT_SECRET

Deprecated — previous configuration (HTTP Adapter)

Deprecated

Configuration via HTTP Adapter with Base Url, Resource Path, and x-api-key header in Settings Override is deprecated.

In addition to the basic data flow configuration, the following Settings Override settings were required:

FieldValueNotes
Base Urlhttps://adapter.flowlyze.ioAdapter URL
Resource Pathapi/adp/shopify/egress/create-refund-on-shopifyAdapter path for refund creation flow
Headers :: x-api-key**********API key for endpoint interaction verification
Headers :: x-shopify-access-tokenshpat_CODICEALFANUMERICOSecret of the custom app created for integration
Headers :: x-shopify-graphql-urlhttps://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:

  • refundShippingAmount and totalShippingRefund cannot both be set; if total shipping refund is set, the specific refund amount must be zero.
  • refundAllItems, refundAmount and refundLineItems, 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, or
      • quantity > 0, or
      • refundAmount > 0.
    • The combination where refundLineTotally = false and quantity = 0 is not allowed; at least one of the two must be set.
    • If refundLineTotally = false and refundAmount > 0, then quantity must be greater than zero.

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

  1. 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"
}
]
}
  1. Partial shipping refund and total order line refund
{
"orderName":"#1061",
"notifyCustomer": false,
"refundShippingAmount": "9.99",
"refundAllItems": true
}
  1. Total shipping refund and header order line refund
{
"orderName":"#1061",
"notifyCustomer": true,
"totalShippingRefund": true,
"refundAmount": "349.99"
}