Magento V2 Tier Price XML
The XML format documented here is used for the import of tier prices into Magento, via the Import Tier Prices to Magento V2 task.
Tier prices can also be sent as part of a product import, see Magento V2 Product XML.
Sample XML
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfTierPrice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<TierPrice>
<sku>24-MB01</sku>
<customer_group_id>1</customer_group_id>
<qty>3</qty>
<value>29.99</value>
</TierPrice>
<TierPrice>
<sku>24-MB01</sku>
<customer_group_name>Wholesale</customer_group_name>
<qty>10</qty>
<value>25.99</value>
</TierPrice>
<TierPrice>
<sku>24-MB01</sku>
<customer_group_name>ALL GROUPS</customer_group_name>
<qty>3</qty>
<value>49.99</value>
</TierPrice>
</ArrayOfTierPrice>
Tier Price
| Magento Field | XML Field | Type | Input | Notes |
|---|---|---|---|---|
| SKU | sku | string | Required | The SKU of the product to price. The product must already exist in Magento |
| Customer Group | customer_group_id* | int | Conditional | The ID of the customer group the price applies to. 0 is the NOT LOGGED IN group on a standard install and 32000 applies the price to all groups |
| Customer Group | customer_group_name* | string | Conditional | The code of the customer group the price applies to, e.g. Wholesale, or ALL GROUPS to apply the price to every group. Zynk looks the group up in Magento |
| Quantity | qty | decimal | Required | The minimum quantity the price applies from |
| Price | value | decimal | Required | The price to charge |
- customer_group_id*, customer_group_name* - One of these is required to set the customer group the price applies to
Use Export Customer Groups to list the group IDs and codes on your store.
Common Fields
The following fields are supported on every record we import into Magento. They are used by Zynk rather than sent to Magento.
| XML Field | Type | Input | Notes |
|---|---|---|---|
| external_id | string | Optional | The unique ID of the record in the external system. Stored in Zynk's internal DB and used to track records already imported. Required when the Prevent Reprocessing setting is enabled on the task |
| store_code | string | Optional | The store view code to send this record to, overriding the Store View Code setting on the task for this record only |
| match | element | Optional | Match an existing record on a field and value other than the default. See Matching Records in Magento v2 |
| matches | element | Optional | As match, but matching on more than one field. See Matching Records in Magento v2 |
Errors
Records which fail to import are written to the Fail File in the same format as the input file, with the reason for the failure added in an errors element. There is no need to send this element yourself.
The name of each error tells you at which stage the record failed:
| Name | Meaning |
|---|---|
| Pre-Validation | Zynk checked the record before sending it and found a problem, e.g. a required field is missing or a related record could not be found. The record was not sent to Magento |
| Prevent Reprocessing | A record with the same external_id has already been imported, and the Prevent Reprocessing setting is enabled on the task |
| Error | Magento rejected the record, or Zynk could not match the record to the data already in Magento. The description contains the message returned by Magento |
| Upload Error | An unexpected error occurred while sending the record to Magento |