Choco Customer Pricing XML
Tasks
This XML format represents the prices individual customers pay for products in Choco.
Tasks
Minimal XML Sample
The XML below represents the minimum information that needs to be provided to update customer pricing in Choco.
<?xml version="1.0"?>
<CustomerPricings>
<CustomerPricing>
<CustomerNumber>ZYNK0001</CustomerNumber>
<Prices>
<Price>
<ExternalId>PE23</ExternalId>
<Currency>GBP</Currency>
<Amount>0.25</Amount>
</Price>
</Prices>
</CustomerPricing>
</CustomerPricings>
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 CustomerPricings schema is used below as a reference of where fields should be in the object model.
CustomerPricing
The CustomerPricing
element represents a combination of a customer and their pricing. This element appears within the root CustomerPricings
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. |
ZynkExternalId | 123456 | string | Optional | Used in conjunction with the Prevent Reprocessing setting. Max 255 chars |
CustomerId | 58482754-b9b9-46a8-b4eb-4a33a415cf61 | guid | Dependant | Either CustomerId or CustomerNumber must be provided. |
CustomerNumber | ZYNK0001 | string | Dependant | Either CustomerId or CustomerNumber must be provided. |
Prices | See below | Collection | Required | The collection of Price elements for the customer. |
- The
Upsert
operation type will insert new or update existing prices. It also allows existing prices to be removed, by not specifying anAmount
. - 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"?>
<CustomerPricings>
<CustomerPricing Operation="Upsert">
<ZynkExternalId>123456</ZynkExternalId>
<CustomerId>58482754-b9b9-46a8-b4eb-4a33a415cf61</CustomerId>
<CustomerNumber>ZYNK0001</CustomerNumber>
<Prices>
<!-- See below for example -->
</Prices>
</CustomerPricing>
</CustomerPricings>
Price
The Price
element represents a price a customer pays for a specific product. This element appears within the Prices
collection of the CustomerPricing element.
XML Field | Example | Field Type | Input | Description |
---|---|---|---|---|
ProductId | 4be1163f-28c1-4572-a99c-172caa12b4a4 | guid | Dependant* | Choco's internal identifier for the product |
ExternalId | PE23 | string | Dependant* | The ID of the product |
Unit | Each | string | Optional | The unit the product is sold in. Only used when ProductId is not specified. |
Currency | GBP | string | Dependant | The currency of the price. Required whenever Amount is specified. |
Amount | 0.25 | decimal | Optional | The price of the product. If not provided, the existing price will be removed from Choco. |
*You must provide either a ProductId
or ExternalId
to identify which product each price relates to. If both are provided, ProductId
will take precedence over ExternalId
. If you are using ExternalId
, we would recommend also specifying the Unit
wherever possible as this will speed up the import. If Unit
is not specified, it will be looked up against the product records.
<?xml version="1.0"?>
<CustomerPricings>
<CustomerPricing>
<Prices>
<Price>
<ProductId>4be1163f-28c1-4572-a99c-172caa12b4a4</ProductId>
<ExternalId>PE23</ExternalId>
<Unit>Each</Unit>
<Currency>GBP</Currency>
<Amount>0.25</Amount>
</Price>
</Prices>
</CustomerPricing>
</CustomerPricings>
Complete XML Sample
This sample shows all data that can be provided via our customer pricing XML format.
<?xml version="1.0"?>
<CustomerPricings>
<CustomerPricing Operation="Upsert">
<ZynkExternalId>123456</ZynkExternalId>
<CustomerId>58482754-b9b9-46a8-b4eb-4a33a415cf61</CustomerId>
<CustomerNumber>ZYNK0001</CustomerNumber>
<Prices>
<Price>
<ProductId>4be1163f-28c1-4572-a99c-172caa12b4a4</ProductId>
<ExternalId>PE23</ExternalId>
<Unit>Each</Unit>
<Currency>GBP</Currency>
<Amount>0.25</Amount>
</Price>
<Price>
<ProductId>c1c327f2-2819-482a-a6b2-8c9b80c5dd38</ProductId>
<ExternalId>008</ExternalId>
<Unit>Pack</Unit>
<Currency>GBP</Currency>
<Amount>8.00</Amount>
</Price>
<Price>
<ProductId>b39a9d18-ef9f-4242-ab35-de2cc1dced39</ProductId>
<ExternalId>HSYE</ExternalId>
<Unit>Pack</Unit>
<Currency>GBP</Currency>
<Amount>6.00</Amount>
</Price>
</Prices>
</CustomerPricing>
<CustomerPricing Operation="Replace">
<ZynkExternalId>234567</ZynkExternalId>
<CustomerId>9f7c506b-727f-4694-acdd-26cabdfa74f7</CustomerId>
<CustomerNumber>ABCD0001</CustomerNumber>
<Prices>
<Price>
<ProductId>4be1163f-28c1-4572-a99c-172caa12b4a4</ProductId>
<ExternalId>PE23</ExternalId>
<Unit>Each</Unit>
<Currency>GBP</Currency>
<Amount>0.30</Amount>
</Price>
<Price>
<ProductId>c1c327f2-2819-482a-a6b2-8c9b80c5dd38</ProductId>
<ExternalId>008</ExternalId>
<Unit>Pack</Unit>
<Currency>GBP</Currency>
<Amount>8.50</Amount>
</Price>
<Price>
<ProductId>b39a9d18-ef9f-4242-ab35-de2cc1dced39</ProductId>
<ExternalId>HSYE</ExternalId>
<Unit>Pack</Unit>
<Currency>GBP</Currency>
<Amount>6.50</Amount>
</Price>
</Prices>
</CustomerPricing>
</CustomerPricings>