Skip to content

Import Refunds into Shopify

This task will create refunds for existing orders in your Shopify store using data in an XML file.

Settings

Shopify Connection

Required
The Shopify connection to use. See Shopify Connection if you require more information on how to create/manage connections.

Fail File

Required
The XML file to output any failed imports to.

Input File

Required
The XML file containing the records to import into Shopify. See below for a sample of the XML format.

Success File

Required
The XML file to output successful imports to.

Cache Time To Live

Required
Zynk will cache the IDs of certain records that it looks up against Shopify, to prevent the same lookup being performed more than is necessary. This setting controls the length of time (in minutes) that cached IDs are considered valid for. Before this time has elapsed, the cached copy of the ID will be used. Once this time has elapsed, the lookup will be performed again against Shopify.

Prevent Reprocessing

Required
When enabled, this setting will prevent the same records being processed more than once by the task. Records will be identified based on the <ZynkExternalId> values provided in the input file.

Selections

Required
The set of fields to select from Shopify. For more details about the syntax, please refer to Selections Syntax.

For more details about the refund object and it's fields, please refer to Shopify's documentation.

Timeout

Optional
The length of time to wait (in seconds) for Shopify to respond to each API request. If left blank, or set to 0 or less, a default value of 100 seconds will be applied.

Zynk Settings

See Common Task Settings

Permissions

This task requires the following permissions in your Shopify app:

  • write_orders
  • read_orders
  • read_locations

Examples

A sample input file is shown below.

<?xml version="1.0" encoding="utf-8"?>
<Refunds>
  <Refund>
    <ZynkExternalId>1234</ZynkExternalId>
    <Currency>GBP</Currency>
    <DiscrepancyReason>OTHER</DiscrepancyReason> <!-- Available options: 'CUSTOMER', 'DAMAGE', 'OTHER', 'RESTOCK' --> 
    <Note>Product not fit for purpose</Note>
    <Notify>false</Notify>
    <Order>
      <Id>gid://shopify/Order/6022747717721</Id>
      <Name>#1116</Name>
    </Order>
    <RefundDuties>
      <RefundDuty>
        <DutyId>gid://shopify/Duty/123456789</DutyId>
        <RefundType>FULL</RefundType> <!-- Available options: 'FULL', 'PROPORTIONAL' --> 
      </RefundDuty>
    </RefundDuties>
    <RefundLineItems>
      <Record>
        <LineItem>
          <Id>gid://shopify/LineItem/14582187720793</Id>
          <Sku>003</Sku>
        </LineItem>
        <Location>
          <Id>gid://shopify/Location/16144367705</Id>
          <Name>6-8 Charlotte Square</Name>
        </Location>
        <Quantity>1</Quantity>
        <RestockType>RETURN</RestockType> <!-- Available options: 'CANCEL', 'LEGACY_RESTOCK', 'NO_RESTOCK', 'RETURN' --> 
      </Record>
    </RefundLineItems>
    <Shipping>
      <Amount>1.00</Amount>
      <FullRefund>false</FullRefund>
    </Shipping>
    <Transactions>
      <Record>
        <AmountSet>
          <PresentmentMoney>
            <Amount>1.00</Amount>
          </PresentmentMoney>
        </AmountSet>
        <Gateway>shopify_payments</Gateway>
        <Kind>REFUND</Kind> <!-- Available options: 'AUTHORIZATION', 'CAPTURE', 'CHANGE', 'EMV_AUTHORIZATION', 'REFUND', 'SALE', 'SUGGESTED_REFUND', 'VOID' --> 
        <Order>
          <Id>gid://shopify/Order/6022747717721</Id>
        </Order>
        <ParentTransaction>
          <Id>gid://shopify/OrderTransaction/7696928014425</Id>
          <PaymentId>rMoy2Y82UMo8vEkYxDsNPLaWq</PaymentId>
        </ParentTransaction>
      </Record>
    </Transactions>
  </Refund>
</Refunds>