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. Defaults to Upsert, see below for details.
Sku PROD0001 string Required The SKU of the product the prices relate to.
Pricing See below Collection Required The collection of PriceListPricing elements for the product.
  • The Upsert operation type will insert new or update existing prices on each price list. Prices will be matched based on a combination of SKU, price list slug and quantity.
  • The Replace operation type will clear the existing prices on each price list that was specified, and upload the new ones provided in the XML.
<?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, any existing pricing will be removed from 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, any existing prices for the product will be removed from the price list.

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>