Product update

Webservice URL : https://sws.spartoo.eu/mp/xml_maj_stock_batch.php

This webservice updates the product stock on the Spartoo website.
Every time you send a product, the webservice provides you with a code, which confirms that your update went through successfully.

This webservice updates the product stock. It can be used to send an entire catalogue or only a few products.

This webservice operates in "Update" mode and not in "Elimination" mode. In other words, products that are not sent in the XML will not be removed.
To remove a product from the website, you must update the stock to 0.

List of Parameters

The parameters of this webservice must imperatively be in POST

Parameter Description
partner Must contain your user ID:
xml XML Character string containing the list of items to be updated


XML parameter format


The text fields must be protected by CDATA tags if they contain special characters that would make the XML invalid.

<catalogue>
	<products>
		<product>
			<reference_partenaire>string</reference_partenaire>
			<size_list>
				<size>
					<size_reference>string</size_reference>
					<size_quantity>int</size_quantity>
					<languages>
						<language>
							<code>string</code>
							<product_price>float</product_price>
							<discount>
								<startdate>timestamp</startdate>
								<stopdate>timestamp</stopdate>
								<price_discount>float</price_discount>
								<rate>int</rate>
								<sales/>
							</discount>
						</language>
						<!-- ... Multiple "language" tags possible ... -->
					</languages>
					<!-- ... Multiple "languages" tags possible ... -->
				</size>
				<size>
					<size_reference>string</size_reference>
					<size_quantity>int</size_quantity>
				</size>
			</size_list>
		</product>
		<product>
			<reference_partenaire>string</reference_partenaire>
			<size_list>
				<size>
					<size_reference>string</size_reference>
					<size_quantity>int</size_quantity>
				</size>
				<size>
					<size_reference>string</size_reference>
					<size_quantity>int</size_quantity>
				</size>
			</size_list>
		</product>
	</products>
</catalogue>


Entry XML field description


Tag Description Mandatory
reference_partner Product ID of the merchant. It is the sku that identifies a brand's product in a specific colour
The product ID can only contain alphanumeric characters as well as the characters - (dash) _ (underscore) and . (full stop).
Yes
product_quantity Total stock of a product
Unknown if one or more of the size_quantity tags is given for the product.
For one-sized products, one product_quantity tag is needed if the size_quantity tag is not specified.
No
size List of sizes and their stock.
Optional for one-sized products ( Bags / Accessories ). Otherwise, it is mandatory.
Yes / No
size_quantity The stock must be specified for each size.
To deactivate a product, the stock must be set to 0.
Once the stock has been set to 0, the product is deactivated and is removed from Spartoo.
Yes
size_reference Product reference for the size. Yes
product_price Price for the size No
discount Allows you to apply a promotion to the product.
The rate of the discount concerns the price reduction as a percentage of the field product_price.
The price_discount of the discount concerns the discounted price of the product. The discount percentage displayed will be calculated.
If both fields are present, the price_discount has priority over the field rate.
If the discount is immediate, there is no need to specify the startdate. If the stopdate is not specified, the default duration of the promotion will be one month. If the sales field is specified, the promotion will be a sale promotion. Otherwise, it will be a classic promotion. Specifying this parameter allows products to be displayed on the sales page during sales periods.
No


XML parameter example

<catalogue>
	<products>
		<product>
			<reference_partenaire>98</reference_partenaire>
			<size_list>
				<size>
					<size_reference>98_38</size_reference>
					<size_quantity>5</size_quantity>
					<languages>
						<language>
							<code>FR</code>
							<product_price>100.00</product_price>
							<discount>
								<startdate>1199170800</startdate>
								<stopdate>1204354800</stopdate>
								<price_discount>90.00</price_discount>
								<rate>10</rate>
								<sales/>
							</discount>
						</language>
						<!-- ... Multiple "language" tags possible ... -->
					</languages>
					<!-- ... Multiple "languages" tags possible ... -->
				</size>
				<size>
					<size_reference>98_39</size_reference>
					<size_quantity>7</size_quantity>
				</size>
			</size_list>
		</product>
		<product>
			<reference_partenaire>158_tailor</reference_partenaire>
			<size_list>
				<size>
					<size_reference>158_37</size_reference>
					<size_quantity>2</size_quantity>
				</size>
				<size>
					<size_reference>158_36</size_reference>
					<size_quantity>0</size_quantity>
				</size>
			</size_list>
		</product>
	</products>
</catalogue>

XML format returned


<catalogue>
	<products>
		<product>
			<reference_partenaire>string</reference_partenaire>
			<size_list>
				<size>
					<size_reference>string</size_reference>
					<errors>int</errors>
				</size>
			</size_list>
		</product>
		<!-- ... Multiple "product" tags possible ... -->
	</products>
</catalogue>


List of webservice error codes


Code Description
1 No error with parameters
-1 The parameter partenaire has not been set up or it is empty
-2 The parameter partenaire does not exist
-11 The parameter xml has not been set up or it is empty
-13 The parameter products_size_reference has not been set up or it is empty
-15 XML syntax error, verify your XML file
-18 The stock is the same as database and it has not been updated
-20 Unable to update stock. Size is no longer valid for the product, the stock for this product and this size is 0.
-31 Size_reference does not exist
-428 Your account has been deactivated. You will no longer have access to our online services.
-429 You have made too many online requests during this 1-hour time period.



XML return examples


Example of a response to a web service request KO :

<catalogue>
	<products></products>
	<errors>-1</errors>
</catalogue>

Example of a response to a web service request OK :

<catalogue>
	<products>
		<product>
			<reference_partenaire>EEAJBCC</reference_partenaire>
			<size_list>
				<size>
					<size_reference>EEAJBCC_38</size_reference>
					<errors>1</errors>
				</size>
			</size_list>
		</product>
		<product>
			<reference_partenaire>KJHGFDS</reference_partenaire>
			<size_list>
				<size>
					<size_reference></size_reference>
					<errors>-13</errors>
				</size>
			</size_list>
		</product>
	</products>
</catalogue>