Uvozni proizvod Asynchrone
Webservice URL : https://sws.spartoo.com.hr/mp/xml_import_products_async.phpOva se web-usluga mora koristiti na isti način kao xml_import_products
Jedina razlika s ovom web uslugom je ta što integrira proizvode asinkrono
Način rada
Asinkroni uvoz radi u dva koraka:
- Slanje feeda: pozovite web-uslugu s parametrom xml. Feed se stavlja u red čekanja, a web-usluga odmah odgovara s URL-om (oznaka url) koji sadrži identifikator vašeg uvoza (parametar export).
- Praćenje i dohvaćanje rezultata: pozovite web-uslugu s parametrom export dok ne dobijete rezultat obrade (pogledajte popis statusa u nastavku).
Feed se može poslati u sirovom XML formatu ili komprimiran u ZIP formatu: ZIP format se automatski prepoznaje.
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
| Parametar | Korak | Opis |
|---|---|---|
| xml | 1 | Sadržaj feeda proizvoda (sirovi XML ili ZIP). Pogledajte formate ispod. |
| export | 2 | Identifikator uvoza, vraćen u koraku 1 u URL-u odgovora. |
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 500x500 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 |
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>
Flow transfer via file
It is also possible to transfer the flow (XML or ZIP) via a file. To do this, the body of the request must contain only the file.
The various parameters (such as ‘partner’, “force_description”, ‘force_overwrite’, etc.) must be transmitted using GET.
Price and discount by size
Price and discount tags by size have been implemented to enable precise price differentiation within the same product.They should only be used when a size has a price that differs from the general price of the product.
The price defined at the product level is the main reference. Size-specific tags are intended to override this price only when an exception is necessary (e.g., special sizes, additional material costs, partial end of line, etc.).
It is strictly prohibited to use price or discount tags by size when all sizes share the same price as the main product. In this case, the price must be defined only at the overall product level.
Multi-Country Format
In the multi-country format, theThis tag defines the countries in which the product is offered for sale, as well as its name, description, and reference price (product_price) for each country. This price must be strictly positive.
The
If the
Odgovor na 1. korak: slanje feeda
XML format returned
<root> <url>string</url> <errors>int</errors> </root>
Primjer:
<root> <url><![CDATA[https://sws.spartoo.com/mp/xml_import_products_async.php?partenaire=XXXX&export=123456]]></url> <errors>1</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
This webservice return you the url to call to get back the webservice responses. If there was an error, it will be printed in a status markup. Otherwise, you will get an xml contening the import result.
This result will be the same format as xml_import_products. Below is the list of statuses returned by the webservice:
| Status id | Status |
|---|---|
| 1 | Fichier pas encore traité |
| 2 | Aucune difference trouvé dans le fichier transferé |
| 3 | Resultat plus disponible |
| 4 | Erreur lors du transfert de fichier |
Odgovor 2. koraka: praćenje obrade
Dok god obrada nije dovršena, web servis vraća status:
<root> <status_id>int</status_id> <status>string</status> <errors>int</errors> </root>
| status_id | status | Značenje |
|---|---|---|
| 1 | Not Update Yet | Feed čeka na obradu ili je u obradi. Pokušajte ponovo kasnije. |
| 2 | No change found in file transfered. | Obrada završena: u feedu nisu otkrivene nikakve promjene. |
| 3 | Result not available anymore | Feed je obrađen, ali datoteka s rezultatom više nije dostupna. |
| 4 | Error on file transfert | Feed nije bilo moguće pročitati: pošaljite ga ponovo. |
| 4 | Skipped cause newer file found | Feed ignoriran jer je poslan noviji feed. |
Kada je obrada završena, webservice izravno vraća datoteku s rezultatima: ima isti format kao rezultat klasičnog uvoza (vidi dolje).
Format rezultata
<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>
| 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:
|
| errors |
Lista grešaka u obrađivanju
|
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 € ) |
| 195 | Fatal | The new price cannot contain more than xxx digits |
| 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 |
| 200 | Warning | Veličina xxx ne postoji za marku xxx. |
| 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 |
| 32 | Fatal | no product information found for this country |
| 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. |
| 194 | Fatal | The discount of the new price cannot be higher than xxx% |
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
Saitoo Marketplace