Skip to content

SparkLayer Product Pricing XML

Tasks

This XML format represents the pricing for products in SparkLayer.

Tasks

Minimal XML Sample

<?xml version="1.0"?>
<ProductPricings>
    <ProductPricing>
        <Sku>PROD0001</Sku>
        <Pricing>
            <PriceListPricing>
                <PriceListSlug>trade-prices</PriceListSlug>
                <Prices>
                    <Price>
                        <Price>10.49</Price>
                    </Price>
                </Prices>
            </PriceListPricing>
        </Pricing>
    </ProductPricing>
</ProductPricings>

In each of the following sections most of the XML has been omitted to make the samples easier to read. The whole structure of the ProductPricings schema is used below as a reference of where fields should be in the object model.

ProductPricing

The ProductPricing element represents a combination of a product and it's pricing. This element appears within the root ProductPricings collection of XML document.

XML Field  Example  Field Type  Input  Description
@Operation Upsert enum Optional Valid values: Upsert, Replace, Overwrite. Defaults to Upsert, see below for details.
Sku PROD0001 string Required The SKU of the product the prices relate to.
Pricing See below Collection Dependant* The collection of PriceListPricing elements for the product.
  • The Upsert operation type will insert new or update existing prices for each combination of product and price list specified in the XML. Prices will be matched based on a combination of SKU, price list slug and quantity. Use this option if you want to ensure that any prices that don't appear in the XML are preserved on SparkLayer.
  • The Replace operation type will clear the existing prices on SparkLayer for each combination of product and price list specified in the XML, then upload the prices specified in the XML. This effectively replaces the list of quantity break discounts on SparkLayer for each product and price list combination specified in the XML. Use this option if you want to ensure that any quantity discounts that don't appear in the XML are removed from SparkLayer.
  • The Overwrite operation type will completely overwrite the product's existing pricing in SparkLayer with whatever is specified in the XML. It is similar to the 'replace' operation, but in addition it will also remove the product from any price lists that are not specified in the XML. Use this option if you want the pricing in SparkLayer to be exactly as specified in the XML.

* The Pricing collection is required when the operation is set to Upsert or Upsert, and must contain at least one PriceListPricing child element. It is optional when the operation is set to 'Overwrite', but please not that the product will be removed from all price lists in SparkLayer if it is not provided.

<?xml version="1.0"?>
<ProductPricings>
    <ProductPricing Operation="Upsert">
        <Sku>PROD0001</Sku>
        <Pricing>
            <!-- See below for example -->
        </Pricing>
    </ProductPricing>
</ProductPricings>

PriceListPricing

The PriceListPricing element represents the pricing for an individual price list. This element appears within the Pricing collection of the ProductPricing element.

XML Field Example Field Type Input Description
PriceListSlug trade-prices string Required The slug of the price list. It must already exist in SparkLayer. Max 30 chars
Prices See below Collection Optional The collection of Price elements for this price list. If not provided, the product will be removed from the price list on SparkLayer.
<?xml version="1.0"?>
<ProductPricings>
    <ProductPricing>
        <Pricing>
            <PriceListPricing>
                <PriceListSlug>trade-prices</PriceListSlug>
                <Prices>
                    <!-- See below for example -->
                </Prices>
            </PriceListPricing>
        </Pricing>
    </ProductPricing>
</ProductPricings>

Price

The Price element represents an individual price point for a product on a price list. This element appears within the Prices collection of the PriceListPricing element.

If no Price elements are provided, the product will be removed from the price list on SparkLayer.

XML Field Example Field Type Input Description
Quantity 1 integer Optional The quantity from which the price is applicable. Defaults to 1 if not specified
Price 10.49 decimal Required The price.
TaxType net string Optional The tax type. Defaults to net if not specified
<?xml version="1.0"?>
<ProductPricings>
    <ProductPricing Operation="Upsert">
        <Pricing>
            <PriceListPricing>
                <Prices>
                    <Price>
                        <Quantity>1</Quantity>
                        <Price>10.49</Price>
                        <TaxType>net</TaxType>
                    </Price>
                </Prices>
            </PriceListPricing>
        </Pricing>
    </ProductPricing>
</ProductPricings>

Complete XML Sample

This sample shows all data that can be provided via our product pricing XML format.

<?xml version="1.0"?>
<ProductPricings>
    <ProductPricing Operation="Upsert">
        <ExternalId>123</ExternalId>
        <Sku>PROD0001</Sku>
        <Pricing>
            <PriceListPricing>
                <PriceListSlug>trade-prices</PriceListSlug>
                <Prices>
                    <Price>
                        <Quantity>1</Quantity>
                        <Price>10.49</Price>
                        <TaxType>net</TaxType>
                    </Price>
                    <Price>
                        <Quantity>5</Quantity>
                        <Price>9.99</Price>
                        <TaxType>net</TaxType>
                    </Price>
                </Prices>
            </PriceListPricing>
            <PriceListPricing>
                <PriceListSlug>web-prices</PriceListSlug>
                <Prices>
                    <Price>
                        <Quantity>1</Quantity>
                        <Price>19.99</Price>
                        <TaxType>net</TaxType>
                    </Price>
                    <Price>
                        <Quantity>3</Quantity>
                        <Price>17.99</Price>
                        <TaxType>net</TaxType>
                    </Price>
                </Prices>
            </PriceListPricing>
        </Pricing>
    </ProductPricing>
    <ProductPricing Operation="Replace">
        <ExternalId>456</ExternalId>
        <Sku>PROD0002</Sku>
        <Pricing>
            <PriceListPricing>
                <PriceListSlug>trade-prices</PriceListSlug>
                <Prices>
                    <Price>
                        <Quantity>1</Quantity>
                        <Price>10</Price>
                        <TaxType>net</TaxType>
                    </Price>
                </Prices>
            </PriceListPricing>
            <PriceListPricing>
                <PriceListSlug>web-prices</PriceListSlug>
                <Prices>
                    <Price>
                        <Quantity>1</Quantity>
                        <Price>20</Price>
                        <TaxType>net</TaxType>
                    </Price>
                </Prices>
            </PriceListPricing>
        </Pricing>
    </ProductPricing>
</ProductPricings>