Exporting orders

Webservice URL : https://sws.spartoo.co.uk/mp/xml_export_orders.php

The webservice allows you to receive order information by either defining a specific date or with the ID.
Orders can be filtered by status

List of Parameters

The parameters of this webservice must be registered in POST

Parameter Description
partner Must contain your unique code :
date The start date from which you would like to select orders. Format : YYYY-MM-DD:hh:mm:ss (example : 2011-11-27:03:00:00)
oID Order ID
status Status of orders to download. If the parameter is not provided, it will select all orders.
> See the list of statuses

The partner parameter is required and either the date parameter or the oID parameter is also required (one of the two). The status parameter is optional.

XML format returned


<root>
	<orders>
		<order>
			<orders_id>string</orders_id>
			<customers>
				<customers_firstname>string</customers_firstname>
				<customers_lastname>string</customers_lastname>
				<customers_company>string</customers_company>
				<customers_street_address>string</customers_street_address>
				<customers_suburb>string</customers_suburb>
				<customers_city>string</customers_city>
				<customers_postcode>string</customers_postcode>
				<customers_state>string</customers_state>
				<customers_country>string</customers_country>
				<customers_email_address>string</customers_email_address>
				<customers_telephone>string</customers_telephone>
			</customers>
			<delivery>
				<delivery_firstname>string</delivery_firstname>
				<delivery_lastname>string</delivery_lastname>
				<!-- ... The tag "relay_info" is only shown if the order is to be delivered to a collection shop ... -->
				<relay_info>
					<relay_id>int</relay_id>
					<relay_type>string</relay_type>
					<relay_name>string</relay_name>
					<relay_address>string</relay_address>
					<relay_city>string</relay_city>
					<relay_postcode>string</relay_postcode>
					<relay_country_iso>string</relay_country_iso>
				</relay_info>
				<!-- ... The tag "delivery_*" below is only shown is the order is not delivered to a collection shop. ... -->
				<delivery_company>string</delivery_companyy>
				<delivery_suburb>string</delivery_suburb>
				<delivery_street_address>string</delivery_street_address>
				<delivery_city>string</delivery_city>
				<delivery_postcode>string</delivery_postcode>
				<delivery_state>string</delivery_state>
				<delivery_country>string</delivery_country>
			</delivery>
			<payment_method>string</payment_method>
			<payment_price>float</payment_price>
			<shipping_price>float</shipping_price>
			<shipping_name>string</shipping_name>
			<order_total>float</order_total>
			<orders_status_name>string</orders_status_name>
			<orders_status_id>int</orders_status_id>
			<date_purchased>[DATE]</date_purchased>
			<last_modified>[DATE]</last_modified>
			<products>
				<product>
					<products_reference>string</products_reference>
					<products_name>string</products_name>
					<products_qty>int</products_qty>
					<products_spartoo>int</products_spartoo>
					<products_manufacturers>string</products_manufacturers>
					<products_size>string</products_size>
					<products_size_reference>string</products_size_reference>
					<products_color>string</products_color>
					<products_price_unit>float</products_price_unit>
					<products_price_unit_with_reduce>float</products_price_unit_with_reduce>
					<products_final_price>float</products_final_price>
				</product>
				<!-- ... Multiple "product" tags possible ... -->
			</products>
			<errors>
				<error>
					<id>int</id>
					<description>string</description>
				</error>
			</errors>
		</order>
		<!-- ... Multiple "order" tags possible ... -->
	</orders>
	<statut>
		<id>int</id>
		<description>string</description>
	</statut>
</root>

Optional Tags

For an order to be delivered to a collection shop, add the tag relay_infoand delete the tag delivery_*with the exception of the first name and surname.
For an order not delivered to a collection point, delete the tag relay_infoand display all of the tags delivery_*.

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
-3 A required parameter is missing (date or oID/rID )
-4 Invalid date format
-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 response field description


Tag Description
orders_id Order ID
customers Customer information for billing
delivery Customer information for delivery
customers_firstname / delivery_firstname Customer first name
customers_lastname / delivery_lastname Customer surname
customers_company / delivery_company Customer company
customers_street_address / delivery_street_address Customer address
customers_suburb / delivery_suburb Customer second address line
customers_city / delivery_city Customer city
customers_postcode / delivery_postcode Customer postcode
customers_country / delivery_country Customer country
customers_telephone Customer telephone number
relay_info Information on collection shop
relay_id Collection shop ID
relay_type Type of collection shop
relay_name Name of Collection shop
relay_address Address of Collection shop
relay_city City of collection shop
relay_postcode Postcode of collection shop
relay_country Country of Collection shop
payment_method Payment method
payment_price Payment cost (currently, always 0)
order_total Order total
orders_status_name Name of the current order status
orders_status_id ID of the current order status
date_purchased Order date
last_modified Date of the last order modification
products Product list
products_reference Product reference at merchant
products_spartoo Product reference at Spartoo
products_name Product name
products_qty Quantity ordered
products_manufacturers Brand name
products_size Size ordered
products_color Product colour
products_price_unit Unit price
products_price_unit_with_reduce Price with discount
products_final_price products_price_unit_with_reduce x products_qty


XML return examples




Example of a response to a web service request KO :

<root>
	<orders>
		<order>
			<orders_id>90D813EA1A2365A8</orders_id>
			<customers>	</customers>
			<delivery>
				<delivery_firstname><![CDATA[Robert]]></delivery_firstname>
				<delivery_lastname><![CDATA[Durand]]></delivery_lastname>
				<relay_info>
					<relay_id>1505</relay_id>
					<relay_type><![CDATA[kiala]]></relay_type>
					<relay_name><![CDATA[(NP)LE PAPYRUS]]></relay_name>
					<relay_address><![CDATA[Boulevard Gambetta]]></relay_address>
					<relay_city><![CDATA[Grenoble]]></relay_city>
					<relay_postcode><![CDATA[38000]]></relay_postcode>
					<relay_country_iso><![CDATA[FR]]></relay_country_iso>
				</relay_info>
				<delivery_company><![CDATA[Spartoo]]></delivery_company>
				<delivery_suburb><![CDATA[16 rue Henri Barbusse]]></delivery_suburb>
				<delivery_street_address><![CDATA[16 rue Henri Barbusse]]></delivery_street_address>
				<delivery_city><![CDATA[Grenoble]]></delivery_city>
				<delivery_postcode><![CDATA[38100]]></delivery_postcode>
				<delivery_state></delivery_state>
				<delivery_country><![CDATA[France]]></delivery_country>
			</delivery>
			<payment_method><![CDATA[Paiement par carte bancaire]]></payment_method>
			<payment_price>0</payment_price>
			<order_total>120.0000</order_total>
			<orders_status_name><![CDATA[Commande Vérifiée]]></orders_status_name>
			<orders_status_id>11</orders_status_id>
			<date_purchased>2013-02-12 14:00:00</date_purchased>
			<last_modified>2013-02-12 14:00:00</last_modified>
			<products>
				<product>
					<products_reference><![CDATA[ABCD]]></products_reference>
					<products_name><![CDATA[ALL STAR HI]]></products_name>
					<products_qty>2</products_qty>
					<products_spartoo>123456</products_spartoo>
					<products_manufacturers><![CDATA[Converse]]></products_manufacturers>
					<products_size>42</products_size>
					<products_size_reference><![CDATA[AAAAAA]]></products_size_reference>
					<products_color><![CDATA[Blanc]]></products_color>
					<products_price_unit>60.00</products_price_unit>
					<products_price_unit_with_reduce>200.00</products_price_unit_with_reduce>
					<products_final_price>120.00</products_final_price>
				</product>
			</products>
			<errors>
				<error>
					<id>-1</id>
					<description>Le paramètre partenaire n'est passé ou est vide</description>
				</error>
			</errors>
		</order>
	</orders>
	<statut>
		<id>41</id>
		<description>Annulation commande</description>
	</statut>
</root>

Example of a response to a web service request OK :

<root>
	<orders>
		<order>
			<orders_id>90D813EA1A2365A8</orders_id>
			<customers>
				<customers_firstname><![CDATA[Robert]]></customers_firstname>
				<customers_lastname><![CDATA[Durand]]></customers_lastname>
				<customers_company><![CDATA[Spartoo]]></customers_company>
				<customers_street_address><![CDATA[16 rue Henri Barbusse]]></customers_street_address>
				<customers_suburb><![CDATA[2eme Etage]]></customers_suburb>
				<customers_city><![CDATA[Grenoble]]></customers_city>
				<customers_postcode><![CDATA[38100]]></customers_postcode>
				<customers_state></customers_state>
				<customers_country><![CDATA[France]]></customers_country>
				<customers_telephone><![CDATA[0612345678]]></customers_telephone>
			</customers>
			<delivery>
				<delivery_firstname><![CDATA[Robert]]></delivery_firstname>
				<delivery_lastname><![CDATA[Durand]]></delivery_lastname>
				<relay_info>
					<relay_id>1505</relay_id>
					<relay_type><![CDATA[kiala]]></relay_type>
					<relay_name><![CDATA[(NP)LE PAPYRUS]]></relay_name>
					<relay_address><![CDATA[Boulevard Gambetta]]></relay_address>
					<relay_city><![CDATA[Grenoble]]></relay_city>
					<relay_postcode><![CDATA[38000]]></relay_postcode>
					<relay_country_iso><![CDATA[FR]]></relay_country_iso>
				</relay_info>
				<delivery_company><![CDATA[Spartoo]]></delivery_company>
				<delivery_suburb><![CDATA[16 rue Henri Barbusse]]></delivery_suburb>
				<delivery_street_address><![CDATA[16 rue Henri Barbusse]]> </delivery_street_address>
				<delivery_city><![CDATA[Grenoble]]></delivery_city>
				<delivery_postcode><![CDATA[38100]]></delivery_postcode>
				<delivery_state></delivery_state>
				<delivery_country><![CDATA[France]]></delivery_country>
			</delivery>
			<payment_method><![CDATA[Paiement par carte bancaire]]></payment_method>
			<payment_price>0</payment_price>
			<order_total>120.0000</order_total>
			<orders_status_name><![CDATA[Commande Vérifiée]]></orders_status_name>
			<orders_status_id>11<orders_status_id>
			<date_purchased>2013-02-12 14:00:00</date_purchased>
			<last_modified>2013-02-12 14:00:00</last_modified>
			<products>
				<product>
					<products_reference>ABCD</products_reference>
					<products_name><![CDATA[ALL STAR HI]]></products_name>
					<products_qty>2</products_qty>
					<products_spartoo>123456</products_spartoo>
					<products_manufacturers><![CDATA[Converse]]></products_manufacturers>
					<products_size>42></products_size>
					<products_size_reference><![CDATA[AAAAAA]]></products_size_reference>
					<products_color><![CDATA[Blanc]]></products_color>
					<products_price_unit>60.00</products_price_unit>
					<products_price_unit_with_reduce>200.00</products_price_unit_with_reduce>
					<products_final_price>120.00</products_final_price>
				</product>
			</products>
			<errors>
				<error>
					<id>1</id>
					<description>Pas d'erreur de paramètres</description>
				</error>
			</errors>
		</order>
	</orders>
	<statut>
		<id>11</id>
		<description>Commande vérifiée</description>
	</statut>
</root>