Skip to content

Shopify File XML (GraphQL)

The XML format documented here is used for the import of files into Shopify, via the Import Files task.

We recommend that the ZynkExternalId field be populated with the unique ID of the file from the external system. Zynk uses this field to track files already imported, to prevent duplicates being created in Shopify when the 'Prevent Reprocessing' setting is enabled. The 'Prevent Reprocessing' setting is disabled by default on this task.

The task always uploads a new file. Existing files cannot be updated.

XML

Any fields not documented below are ignored by the task. Examples of where in the XML the fields should appear are shown in the samples below.

<?xml version="1.0" encoding="utf-8"?>
<Files>
  <File>
    <ZynkExternalId>INV-123</ZynkExternalId>
    <FilePath>C:\Exports\invoice_123.pdf</FilePath>
    <MimeType>application/pdf</MimeType>
    <ContentType>FILE</ContentType>
    <AltText>Invoice 123</AltText>
  </File>
</Files>

File

Each file must be provided by either FileUrl or FilePath, but not both.

Shopify Field XML Field Type Input Notes
- ZynkExternalId string Optional Stored in Zynk's internal DB and used in conjunction with the 'Prevent Reprocessing' setting
originalSource FileUrl string Dependant Required if FilePath is not provided. Must be an absolute URL that Shopify can download the file from
- FilePath string Dependant Required if FileUrl is not provided. Path to a local file, which Zynk uploads to Shopify's staged upload storage before creating the file. Absolute and relative paths are supported, and the file must exist
- MimeType string Optional Only used with FilePath. Set automatically from the file extension if not provided, e.g. application/pdf
contentType ContentType enum Optional Defaults to FILE. Options: FILE, IMAGE, VIDEO
alt AltText string Optional Alt text for the file
<?xml version="1.0" encoding="utf-8"?>
<Files>
  <File>
    <ZynkExternalId>INV-123</ZynkExternalId>
    <FilePath>C:\Exports\invoice_123.pdf</FilePath>
    <ContentType>FILE</ContentType>
    <AltText>Invoice 123</AltText>
  </File>
  <File>
    <ZynkExternalId>LOGO-1</ZynkExternalId>
    <FileUrl>https://zynk.com/wp-content/uploads/2018/02/sitelogo100.png</FileUrl>
    <ContentType>IMAGE</ContentType>
    <AltText>Zynk Logo</AltText>
  </File>
</Files>

The success file returns each record with the Shopify Id, FileStatus and CreatedAt populated.