Unos proizvoda

Webservice URL : https://sws.spartoo.com.hr/mp/xml_import_products.php

This webservice creates and updates products on the Spartoo website.
For each product sent, the webservice will send back an error code to indicate whether everything is ok or not. Certain errors are serious (fatal), others are not (warning).

This webservice creates products and updates your catalogue. It can be used to send the whole catalogue or only a few products.

Frequency of use:
- When using this webservice to update the whole catalogue, we advise that you do this once every 6 hours.
- When using this webservice to update only part of the catalogue (for a few products only), you can do this up to every 10 minutes.

This webservice functions in an "Update" mode rather than a "Overwriting" mode, meaning that the products not included in the XML file will not be deleted.
To take a product offline, you must put the stock to 0.

Lista parametara

The settings of this webservice must be registered in POST

Settings Description
partner Must contain your unique code :
xml XML character string containing the list of elements to be created or updated


Optional settings that can be passed in POST

Settings Description
force_description Set to 1 if you want to force product descriptions to be updated: delete existing descriptions, edit the description of a product with zero stock, etc.
force_overwrite Set to 1 if you want to remove stock errors from the catalogue. Be careful to send the rest of the catalogue without overwriting immediately afterwards.
async Set to 1 if you wish to use the asynchronous method


XML parameter format


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

Format single country

<root>
	<products>
		<product>
			<reference_partenaire>string</reference_partenaire>
			<product_name>string</product_name>
			<manufacturers_name>string</manufacturers_name>
			<product_sex>char</product_sex>
			<product_price>float</product_price>
			<product_quantity>int</product_quantity>
			<color_id>int</color_id>
			<product_style>int</product_style>
			<product_description>string</product_description>
			<product_color>string</product_color>
			<heel_height>float</heel_height>
			<country_origin>int</country_origin>
			<code_hs>int</code_hs>
			<size_list>
				<size>
					<size_name>string</size_name>
					<size_quantity>int</size_quantity>
					<size_reference>string</size_reference>
					<ean>string</ean>
					<code_hs>int</code_hs>
					<product_price>float</product_price>
					<discount>
						<startdate>timestamp</startdate>
						<stopdate>timestamp</stopdate>
						<price_discount>float</price_discount>
						<rate>int</rate>
						<sales/>
					</discount>
				</size>
				<!-- ... Multiple "size" tags possible ... -->
			</size_list>
			<product_composition>int</product_composition>
			<voering_composition>int</voering_composition>
			<first_composition>int</first_composition>
			<zool_composition>int</zool_composition>
			<photos>
				<url1>url</url1>
				<url2>url</url2>
				<url3>url</url3>
				<url4>url</url4>
				<url5>url</url5>
				<url6>url</url6>
				<url7>url</url7>
				<url8>url</url8>
			</photos>
			<discount>
				<startdate>timestamp</startdate>
				<stopdate>timestamp</stopdate>
				<price_discount>float</price_discount>
				<rate>int</rate>
				<sales>0/1</sales>
			</discount>
			<extra_infos>
				<info>
					<id>int</id>
					<value>float</value>
				</info>
				<!-- ... Multiple "info" tags possible ... -->
			</extra_infos>
			<selections>
				<selection>int</selection>
				<!-- ... Multiple "selection" tags possible ... -->
			</selections>
		</product>
		<!-- ... Multiple "product" tags possible ... -->
	</products>
</root>


Format multi country

<root>
	<products>
		<product>
			<reference_partenaire>string</reference_partenaire>
			<manufacturers_name>string</manufacturers_name>
			<product_sex>char</product_sex>
			<product_quantity>int</product_quantity>
			<color_id>int</color_id>
			<product_style>int</product_style>
			<heel_height>float</heel_height>
			<country_origin>int</country_origin>
			<code_hs>int</code_hs>
			<languages>
				<language>
					<code>string</code>
					<product_name>string</product_name>
					<product_description>string</product_description>
					<product_color>string</product_color>
					<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>
			<size_list>
				<size>
					<size_name>string</size_name>
					<size_quantity>int</size_quantity>
					<size_reference>string</size_reference>
					<ean>string</ean>
					<code_hs>int</code_hs>
					<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>
				</size>
				<!-- ... Multiple "size" tags possible ... -->
			</size_list>
			<product_composition>int</product_composition>
			<voering_composition>int</voering_composition>
			<first_composition>int</first_composition>
			<zool_composition>int</zool_composition>
			<photos>
				<url1>url</url1>
				<url2>url</url2>
				<url3>url</url3>
				<url4>url</url4>
				<url5>url</url5>
				<url6>url</url6>
				<url7>url</url7>
				<url8>url</url8>
			</photos>
			<extra_infos>
				<info>
					<id>int</id>
					<value>float</value>
				</info>
				<!-- ... Multiple "info" tags possible ... -->
			</extra_infos>
			 <selections>
				<selection>int</selection>
				<!-- ... Multiple "selection" tags possible ... -->
			</selections>
		</product>
		<!-- ... Multiple "product" tags possible ... -->
	</products>
</root>


Entry XML field description


Označiti Opis Obavezno
reference_partenaire Identifikator proizvoda prodavača
Identifikator proizvoda može sadržavati isključivo alfanumeričke znakove i sljedeće znakove - (povlaku) _ (donju crtu) i . (točku).
Da
product_name Naziv modela
Ne smije sadržavati kategoriju, boju ili marku proizvoda.
Ne smije sadržavati html znakove ili oznake.
Ne
manufacturers_name Naziv marke proizvoda Da
product_sex Spol proizvoda
> Vidi moguće unose
Da
product_price Cijena proizvoda u eurima (nije obavezno za cijene veličine) Da / Ne
color_id Boja za filtere u izborniku.
Ako navedena boja nije precizirana, proizvod neće biti prikazan u rezultatima pretrage s pomoću filtera.
> Vidi moguće vrijednosti
Ne
product_style Kategorija proizvoda
> Vidi moguće unose
Da
product_description Opis proizvoda. Prikazuje se na stranici proizvoda. Ne
product_color Polje za tekstualni opis boje. Pojavljuje se na stranici proizvoda. Ne
size Lista veličina i njihova količina.
Fakultativno za proizvode bez veličine (torbe/modni dodaci). U svim ostalim slučajevima obavezno.
Da/Ne
size_name Naziv veličine
> Vidi moguće unose
Da
size_name lang="en" Naziv UK veličine
Obavezno samo za artikle koji će biti dostupni na engleskoj stranici spartoo.co.uk
> Vidi moguće unose
Ne/ Da
size_quantity Količina proizvoda za određenu veličinu Da
size_reference Referenca proizvoda po veličini.
Ovo polje služi isključivo kako bi se poslalo u izvoz narudžbi ili povrata. Savjetujemo vam da generirate tu referencu spajanjem polja reference_partenaire i size_name s pomoću donje crte "_".
Ne
ean EAN proizvoda po veličini Ne
photos Lista slika i njihov URL.
Obavezna je barem jedna slika.
Savjetujemo vam da imate minimalno tri slike. Maksimalni broj slika koji možemo integrirati je osam.
Slika će se samo jednom preuzeti, a zatim će se predimenzionirati u skladu sa Spartoo dimenzijama i pohraniti na našem serveru.
Slike moraju biti četverokutne, u jpg formatu i imati barem 350x350 piksela. Ako slike imaju 800x800 ili više piksela, opcija zoom-a bit će dostupna na stranici.
Da
url1, url2 ... url8 Poveznice prema slikama
Potrebno je poslati nam link prema slici. Naziv dokumenta mora sadržavati samo alfanumeričke znakove i znakove "-" (povlaka), "_" (donja crta) i "." (točka). Slova sa specijalnim znakovima nisu dozvoljena.
Da
heel_height Visina potpetice izražena u centimetrima (cm). Samo za žensku obuću. Mora biti više od 0,5. Ne
product_composition Sastav gornjišta proizvoda. Samo za obuću.
> Vidi moguće unose
Ne
voering_composition Sastav podstave proizvoda. Samo za obuću.
> Vidi moguće unose
Ne
first_composition Sastav uložne tabanice. Samo za obuću
> Vidi moguće unose
Ne
zool_composition Sastav potplata. Samo za obuću.
> Vidi moguće unose
Ne
discount Omogućuje da se sniženje primijeni na proizvod ili na veličinu.
Polje rate u polju discount odnosi se na postotak sniženja koji se referira na polje product_price.
Polje price_discount u polju discount odnosi se na popust uključen u fiksnu cijenu. Postotak sniženja će se izračunati.
Ako su oba polja prisutna, polje price_discount ima prednost pred poljem rate.
Ako je riječ o popustu koji će odmah biti aktiviran, nije potrebno odrediti polje startdate. Ako je polje sales određeno, sniženje će biti dio sezonskog sniženja. U suprotnom, bit će riječ o klasičnom sniženju. Određivanje ovog polja uvjetuje da će proizvodi biti prikazani na početnoj stranici za vrijeme sezonskog sniženja.
Ne
extra_infos Omogućuje unos dodatnih informacija.
Svaka informacija sastoji se od id-a ( > Vidi vrijednosti ) i numeričkog unosa.
Ne
selections Omogućuje određivanje konteksta za upotrebu proizvoda s pomoću ID liste.
Svi konteksti dostupni su ovdje.
Ne


XML parameter example

<root>
	<products>
		<product>
			<reference_partenaire>98</reference_partenaire>
			<product_name><![CDATA[ALL STAR HI]]></product_name>
			<manufacturers_name><![CDATA[Converse]]></manufacturers_name>
			<product_sex>M</product_sex>
			<product_price>64.99</product_price>
			<product_quantity>5</product_quantity>
			<color_id>8</color_id>
			<product_style>10010</product_style>
			<product_description><![CDATA[Mit nad mitovima, Chuck Taylor All Star Converse tenisice pravi su must-have model. 
Ovaj put je riječ o jednobojnom klasičnom modelu visokih tenisica s platnenim gornjištem, koji je pravi klasik koji nikada ne izlazi iz mode!]]></product_description>
			<product_color><![CDATA[Crvena]]></product_color>
			<country_origin>73</country_origin>
			<code_hs>64059090</code_hs>
			<size_list>
			 <size>
				<size_name>38</size_name>
				<size_quantity>4</size_quantity>
				<size_reference>98_38</size_reference>
				<ean>123456789011></ean>
			 </size>
			 <size>
				<size_name>39</size_name>
				<size_quantity>1</size_quantity>
				<size_reference>98_39</size_reference>
				<ean>123456789012></ean>
			 </size>
			</size_list>
			<product_composition>4</product_composition>
			<photos>
				<url1>https://imgext.spartoo.com/photos/98/98/98_350_A.jpg</url1>
				<url2>https://imgext.spartoo.com/photos/98/98/98_350_B.jpg</url2>
				<url3>https://imgext.spartoo.com/photos/98/98/98_350_C.jpg</url3>
				<url4>https://imgext.spartoo.com/photos/98/98/98_350_D.jpg</url4>
				<url5>https://imgext.spartoo.com/photos/98/98/98_350_E.jpg</url5>
				<url6>https://imgext.spartoo.com/photos/98/98/98_350_F.jpg</url6>
				<url7>https://imgext.spartoo.com/photos/98/98/98_350_G.jpg</url7>
				<url8>https://imgext.spartoo.com/photos/98/98/98_350_H.jpg</url8>
			</photos>
			<discount>
				<startdate>1199170800</startdate>
				<stopdate>1204354800</stopdate>
				<rate>20</rate>
			</discount>
		</product>
	</products>
</root>

XML format returned


<root>
	<products>
		<product>
			<reference_partenaire>string</reference_partenaire>
			<status>string</status>
			<action>string</action>
			<errors>
				<error>
					<id>int</id>
					<description>string</description>
					<level>string</level>
				</error>
				<!-- ... Multiple "error" tags possible ... -->
			</errors>
		</product>
		<!-- ... Multiple "product" tags possible ... -->
	</products>
	<errors>int</errors>
</root>


List of webservice error codes


Kod Opis
1 Nema pogreške u parametrima
-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
-15 XML syntax error, verify your XML file
-428 Vaš račun je deaktiviran. Više ne možete koristiti web servise.
-429 Prekoračili ste broj mogućih korištenja navedenog webservisa u posljednjih sat vremena.

XML response field description


Varijabla Opis
reference_partenaire Identifikator proizvoda trgovca
status OK ako je proizvod uspješno unešen u bazu podataka
KO ako proizvod nije unešen
action Lista mogućih operacija:
  • created: proizvod je kreiran.
  • not created: proizvod nije kreiran. Napomena: proizvod može imati status 'OK', no ipak ne biti kreiran zbog određenih oznaka 'Warning'.
  • updated: proizvod je ažuriran.
  • not updated: proizvod nije ažuriran. Napomena: proizvod može imati status 'OK', no ipak ne biti ažuriran zbog određenih oznaka 'Warning'
errors Lista grešaka u obrađivanju
  • id: kod greške proizvoda
  • level: razina greške
    • Warning: ne blokira integraciju proizvoda
    • Fatal: blokira integraciju proizvoda
  • description: opis greške


List of product error codes


Code Level Description
1 Fatal The partner reference is not long enough
2 Fatal The partner reference is not valid, it can only contain alphanumeric characters
3 Warning Ime proizvoda nije određeno
4 Fatal Marka nije određena
5 Fatal Rod nije ispravan, samo sljedeće oznake su moguće: H, F, M, K, G, B
6 Fatal Cijena mora biti izražena u numeričkim znakovima
7 Fatal Cijena mora biti izražena u pozitivnom obliku
8 Warning Cijena se čini previsoka ( > 1000 € )
81 Fatal Cijena ne može biti viša od 180 €
9 Fatal The amount must be a whole number
10 Fatal Količina treba biti u pozitivnom obliku
11 Warning The colour xxx does not exist: the product will not be available through the colour filters
13 Fatal Kategorija xxx ne postoji
14 Warning Opis proizvoda je prazan
15 Warning The colour description is empty
16 Warning No size list: use a single size
17 Warning The composition is specified, but is invalid
18 Fatal Photo 1 is required
19 Warning The rate of discount must be between 0 and 100, the discount will not be taken into account
20 Warning Veličina xxx ne postoji
201 Fatal EAN barkod je obavezan
202 Fatal EAN kod xxx za referencu xxx u veličini xxx je već upotrijebljen.
205 Fatal Referenca partnera je preduga
23 Warning The photo xxx is smaller than 350x350: it will be of poor quality on the website
24 Warning The photo xxx is smaller than 350x350: it will not be displayed on the website
25 Fatal Size xxx: Unable to regulate stock
26 Fatal Not in stock: Product will not be created
27 Fatal Nije moguće pristupiti slici 1 ( url xxx )
28 Warning Nije moguće pristupiti slici xxx ( url xxx )
30 Fatal The amount of the size xxx is too large (Max amount: xxx)
33 Fatal A xxx product cannot be put under the category xxx
34 Fatal The word xxx is blacklisted and it should not appear in the product name, nor in the product description.
35 Fatal Naziv proizvoda je predugačak, mora sadržavati samo ime modela. Pogreške u zemlji(ama): xxx
341 Fatal The word xxx is blacklisted and should not appear in the product description.
36 Fatal Nije moguće unijeti proizvod: veličina/boja proizvoda su duplicirani
37 Fatal Niste unijeli ispravne jezične postavke za ovaj proizvod
38 Fatal Veličina xxx može samo jednom biti definirana referencom xxx.
39 Warning The partner reference is present several times in the flow, duplicates have been ignored
451 Fatal Nema cijene za veličinu xxx zemlje xxx. (nécessaire pour un discount)
452 Warning Datum završetka popusta je premašen za veličinu xxx zemlje xxx.
453 Fatal "stopa" (xxx) nevažeća je za veličinu xxx zemlje xxx.
454 Fatal "stopa" (xxx) > 85% za veličinu xxx zemlje xxx.
455 Warning Veličina xxx ima cijenu u zemlji (xxx) koja nije definirana za proizvod.
456 Warning Veličina xxx ima cijenu na xxx identičnu globalnoj cijeni u ovoj zemlji.


XML return examples


Primjer neispravnog odgovora na poziv web servisa :

<root>
	<products></products>
	<errors>-1</errors>
</root>

Primjer ispravnog odgovora na poziv web servisa :

<root>
	<products>
		<product>
		<reference_partenaire>EEAJBCC</reference_partenaire>
		<status>KO</status>
		<action>not created</action>
		<errors>
			<error>
				<id>14</id>
				<description>Opis proizvoda je prazan</description>
				<level>warning</level>
			</error>
			<error>
				<id>4</id>
				<description>Marka nije određena</description>
				<level>fatal</level>
			</error>
		</errors>
		</product>
		<product>
			<reference_partenaire>KJHGFDS</reference_partenaire>
			<status>OK</status>
			<action>created</action>
		</product>
	</products>
	<errors>1</errors>
</root>

XSD dokumenti

XSD dokument Više zemalja