Skip to content

Shopify Variant Price XML (GraphQL)

The XML format documented here is used for the update of product variant prices in Shopify, via the Import Variant Prices task.

The ZynkExternalId field can be populated with a unique ID for the price update from the external system, such as the SKU. Zynk uses this field in conjunction with the 'Prevent Reprocessing' setting, which is disabled by default on this task. If Id is not provided and the ZynkExternalId has been processed before, the variant ID stored by Zynk is used.

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"?>
<ProductVariantPrices>
  <ProductVariantPrice>
    <ZynkExternalId>TSHIRT-S-RED</ZynkExternalId>
    <Sku>TSHIRT-S-RED</Sku>
    <Price>10.00</Price>
    <CompareAtPrice>12.00</CompareAtPrice>
  </ProductVariantPrice>
  <ProductVariantPrice>
    <Id>gid://shopify/ProductVariant/42180782162009</Id>
    <Price>10.00</Price>
  </ProductVariantPrice>
</ProductVariantPrices>

Product Variant Price

The variant is identified by Id, or by Sku if no Id is provided. When matching by Sku, every variant in Shopify with that SKU is updated. Variants whose prices already match the XML are not updated, but are still written to the success file.

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
id Id string Dependant Required if Sku is not provided. Accepts a GraphQL ID (gid://shopify/ProductVariant/123) or the numeric variant ID
sku Sku string Dependant Required if Id is not provided
price Price decimal Dependant Required if CompareAtPrice is not provided
compareAtPrice CompareAtPrice decimal Dependant Required if Price is not provided

A price that is omitted is left unchanged in Shopify.

<?xml version="1.0" encoding="utf-8"?>
<ProductVariantPrices>
  <ProductVariantPrice>
    <ZynkExternalId>TSHIRT-S-RED</ZynkExternalId>
    <Id>gid://shopify/ProductVariant/42180782129241</Id>
    <Sku>TSHIRT-S-RED</Sku>
    <Price>10.00</Price>
    <CompareAtPrice>12.00</CompareAtPrice>
  </ProductVariantPrice>
</ProductVariantPrices>