Dodawanie pojedynczego produktu
Sposób działania
Za pomocą endpointu POST/import/products/v2/load_data, można dodać produkty do instancji. Endpointem tym wgrywamy zbiór definicji produktów do bufora danych. Następnie, aby dodać produkty do instancji musimy użyć endpointu POST/import/products/v2/run. Podczas przenoszenia danych z bufora do bazy produkcyjnej, system sprawdzi czy dany kod produktu (pole “code
") już istnieje. Jeśli tak się wydarzy to system pominie ten produkt podczas importu.
Typy produktów
Rozróżniamy dwa typu produktów, które można zaimportować.
Za pomocą tego endpointu, można dodać dwa typy produktów do instancji:
Produkt pojedynczy
Rodzina produktów
Produkt pojedynczy
Dokumentacja produktu pojedynczego
Poniżej znajduje się dokumentacja, z wyszczególnionymi następującymi polami:
description
- Jest to krótki opis czy dane pole jest,example
- przykładowa wartość polatype
- format* - pole wymagane
X - wszystkie znaki
[0-1] - tylko 0 lub 1
[0-9] - tylko liczby
R2 - liczba w systemie dziesiętnym z dwoma miejscami po przecinku
JSON - format JSON
(x) - limit znaków wynosi x, np: “(1) - limit znaków wynosi 1”
date (YYYY-mm-dd) - format daty
code*
description: "Unique identifier code of product for the Saly",
example: "5907595646406",
type: "X (255) *"
additional_code
ean
description: "International Article Number - thirteen-digit number used to identify product",
example: "5907595646406",
type: "[0-9] (13)"
sku
description: "Stock keeping unit - identifier code of product",
example: "Mac Book Air 13,3",
type: "X (45)"
supplier_product_code
description: "Unique number issued by supplier to identify individual product",
example: "5907595646406",
type: "X (255)"
information
name
description: "Name identify product in different languages (available languages: pl, en, de, ru, es, fr, it). Data format must be preserved from the example",
example: {
"pl": "MacBook Air 13 gwiezdna szarość",
"en": "MacBook Air 13 Space Gray",
"de": "MacBook Air 13 Space Grua"
},
type: "JSON"
description
description: "Description identify product in different languages (available languages: pl, en, de, ru, es, fr, it). Data format must be preserved from the example",
example: {
"pl": "<h4>MacBook Air 13 gwiezdna szarość</h4><p>przykładowy tekst</p>",
"en": "<h4>MacBook Air 13 Space Gray</h4><p>example text</p>",
"de": "<h4>MacBook Air 13 Space Grua</h4><p>Beispieltext</p>"
},
type: "JSON"
is_active
description: "whether the product is published on frontOffice (available values: 0 - unpublished (default option), 1 - published)",
example: "1",
type: "[0-1] (1)"
is_promoted
description: "whether the product is promoted on frontOffice (available values: 0 - unpromoted (default option), 1 - promoted)",
example: "0",
type: "[0-1] (1)"
metadata
metatitle
description: "SEO data - Metatitle identify product in different languages (available languages: pl, en, de, ru, es, fr, it). Data format must be preserved from the example",
example: {
"pl": "MacBook Air 13 gwiezdna szarość",
"en": "MacBook Air 13 Space Gray",
"de": "MacBook Air 13 Space Grua"
},
type: "JSON"
keywords
description: "SEO data - Keywords identify product in different languages (available languages: pl, en, de, ru, es, fr, it). Data format must be preserved from the example",
example: {
"pl": "MacBook,Air,13,gwiezdna szarość",
"en": "MacBook,Air,13,Space Gray",
"de": "MacBook,Air,13,Space Grua"
},
type: "JSON"
metadescription
description: "SEO data - metadescription identify product in different languages (available languages: pl, en, de, ru, es, fr, it). Data format must be preserved from the example",
example: {
"pl": "MacBook Air 13 gwiezdna szarość - najlepsza cena",
"en": "MacBook Air 13 Space Gray - Best Price",
"de": "MacBook Air 13 Space Grua - bester Preis"
},
type: "JSON"
slug
description: "Name used to friendly URL (english example: https://domain/en,productView,MacBook_Air_13_Space_Gray,8,42161.html. Data format must be preserved from the example",
example: {
"pl": "MacBook_Air_13_gwiezdna_szarosc",
"en": "MacBook_Air_13_Space_Gray",
"de": "MacBook_Air_13_Space_Grua"
},
type: "JSON"
categories
paths
description: "All categories in which the product exists. The first category will be the main category. Enter the full path of the category, where '/' is used as a separator (available languages: pl, en, de, ru, es, fr, it). Data format must be preserved from the example",
example: [
{
"pl": "Laptopy/Apple/MacBook Air 13",
"en": "Laptops/Apple/MacBook Air 13",
"de": "Laptops/Apple/MacBook Air 13"
},
{
"pl": "Apple/Laptopy/MacBook Air 13",
"en": "Apple/Laptops/MacBook Air 13",
"de": "Apple/Laptops/MacBook Air 13"
}
],
type: "JSON"
price
base_netto
description: "The minimum net price for which a product can be sold",
example: "4000.00",
type: "R2"
purchase_netto
description: "The net price at which the product was purchased",
example: "3300.99",
type: "R2"
srp_netto
description: "Suggested retail price net for which the product can be sold",
example: "4499.99",
type: "R2"
vat
description: "vat rate of the product",
example: "23",
type: "[0-9]"
manufacturer
name
description: "The name of the manufacturer of the specified product",
example: "Apple",
type: "X (45)"
logo
description: "Url, where the logo of a particular manufacturer is located",
example: "https://www.apple.com/logo.png",
type: "X (255)"
energy_class
energy_class
description: "Energy class of a specific product",
example: "A",
type: "[A-G] (1)"
energy_label_link
description: "Link to energy class label pdf of a specific product",
example: "https://link_to_energy_class_label.pdf",
type: "X (255)"
energy_card_information_link
description: "Link to energy card information pdf of a specific product",
example: "https://link_to_energy_card_information_link.pdf",
type: "X (255)"
stock
delivery_date
delivery_format
description: "Delivery time for this product. This information is saved to any existing warehouse. If this information is empty, the information is propagated from the warehouse.",
example: {"pl": "7 dni", "en": "7 days", "de": "7 Tage"},
type: "JSON"
delivery_hour
description: "Delivery time of this product, given in hours",
example: "168",
type: "[0-9]"
warehouse_external_id
description: "External id of the warehouse to which the delivery data relates",
example: "1",
type: "[0-9]"
restocking_date
description: "Expected date of restock",
example: "2025-02-02",
type: "date (YYYY-mm-dd)"
package
name
description: "The name of the package previously defined in the system in which the product should be transported",
example: "Euro-pallet",
type: "X (255)"
dimensions
height
description: "The packaging height of a given product in centimeters",
example: "100.00",
type: "R2"
width
description: "The packaging width of a given product in centimeters",
example: "100.00",
type: "R2"
length
description: "The packaging length of a given product in centimeters",
example: "100.00",
type: "R2"
weight
description: "The packaging weight of a given product in kilograms",
example: "10.00",
type: "R2"
attributes
description: "Product technical parameters arranged in groups and in the target order in which they are to be displayed on FrontOffice. These parameters can be in different languages (available languages: pl, en, de, ru, es, fr, it). Data format must be preserved from the example",
example: {
"pl": [
{
"Dane techniczne": [
["Kolor", "czerwony"],
["Rozmiar", "średni"]
]
},
{
"Dane dodatkowe" : [
["Produkt wyprodukowany w UE", "tak"]
]
}
],
"en": [
{
"Technical data": [
["Color", "red"],
["Size", "medium"]
]
},
{
"Additional data" : [
["Product manufactured in the EU", "yes"]
]
}
]
},
type: "JSON"
multimedia
photos
description: "Urls, where the photos of a particular product is located. The number of this urls is not limited. Data format must be preserved from the example",
example: [
"https://example.com/photo1.jpg",
"https://example.com/photo2.jpg",
"https://example.com/photo3.jpg"
],
type: "JSON"
files
description: "Urls, where the files of a particular product is located, with they name representation. The number of this urls is not limited. Data format must be preserved from the example",
example: [
["file1.pdf","https://example.com/file1.pdf"],
["file2.pdf","https://example.com/file2.pdf"],
["file3.pdf","https://example.com/file3.pdf"]
],
type: "JSON"
units
Dodanie sekcji units jest opcjonalne. Brak dodania tej sekcji, spowoduje ustawienie jednostek na nowych produktach zgodnie z ustawieniami Jednostek sprzedażowych w Słownikach w panelu administratora
Definiując jednostki sprzedażowe w imporcie należy upewnić się, że jednostka o danym external_id została wcześniej zdefiniowana w Słownikach w panelu administratora
external_id
description: "Unique code identifying the sales unit. The unit must already exist and be defined in the system.",
example: "szt.",
type: "X (20)"
primary_unit
description: "Specifies whether the unit is the primary unit for the product. All conversion rates are calculated relative to this unit, and stock levels are tracked in this unit.",
example: "1",
type: "[0-1] (1)"
default_unit
description: "Specifies whether the unit is the default unit for the product. The default unit is automatically selected for the user when the product is displayed, but can be changed to another active unit.",
example: "1",
type: "[0-1] (1)"
active
description: "Indicates whether the unit is active. Active units are visible to users and can be selected when placing an order.",
example: "1",
type: "[0-1] (1)"
rate
description: "Conversion rate of this unit in relation to the product's primary unit.",
example: "10.00",
type: "R2"
discount
description: "Discount percentage applied when this unit is selected.",
example: "10",
type: "[0-9]"
minimum_sales_quantity
description: "Minimum number of items that must be ordered when using this unit.",
example: "1",
type: "[0-9]"
Przykładowy plik
[
{
"code": "5907595646406",
"additional_code": {
"ean": "5907595646406",
"sku": "Mac Book Air 13,3",
"supplier_product_code": "5907595646406"
},
"information": {
"name": {
"pl": "MacBook Air 13 gwiezdna szarość",
"en": "MacBook Air 13 Space Gray",
"de": "MacBook Air 13 Space Grua"
},
"description": {
"pl": "<h4>MacBook Air 13 gwiezdna szarość</h4><p>przykładowy tekst</p>",
"en": "<h4>MacBook Air 13 Space Gray</h4><p>example text</p>",
"de": "<h4>MacBook Air 13 Space Grua</h4><p>Beispieltext</p>"
},
"is_active": "1",
"is_promoted": "0"
},
"metadata": {
"metatitle": {
"pl": "MacBook Air 13 gwiezdna szarość",
"en": "MacBook Air 13 Space Gray",
"de": "MacBook Air 13 Space Grua"
},
"keywords": {
"pl": "MacBook,Air,13,gwiezdna szarość",
"en": "MacBook,Air,13,Space Gray",
"de": "MacBook,Air,13,Space Grua"
},
"metadescription": {
"pl": "MacBook Air 13 gwiezdna szarość - najlepsza cena",
"en": "MacBook Air 13 Space Gray - Best Price",
"de": "MacBook Air 13 Space Grua - bester Preis"
},
"slug": {
"pl": "MacBook_Air_13_gwiezdna_szarosc",
"en": "MacBook_Air_13_Space_Gray",
"de": "MacBook_Air_13_Space_Grua"
}
},
"categories": {
"paths": [
{
"pl": "Laptopy/Apple/MacBook Air 13",
"en": "Laptops/Apple/MacBook Air 13",
"de": "Laptops/Apple/MacBook Air 13"
},
{
"pl": "Apple/Laptopy/MacBook Air 13",
"en": "Apple/Laptops/MacBook Air 13",
"de": "Apple/Laptops/MacBook Air 13"
}
]
},
"price":{
"base_netto": "4000.00",
"purchase_netto": "3300.99",
"srp_netto": "4499.99",
"vat": "23"
},
"manufacturer": {
"name": "Apple",
"logo": "https://www.apple.com/logo.png"
},
"energy_class": {
"energy_class": "A",
"energy_label_link": "https://link_to_energy_class_label.pdf",
"energy_card_information_link": "https://link_to_energy_card_information_link.pdf"
},
"stock": {
"delivery_date": [
{
"delivery_format": {"pl": "7 dni", "en": "7 days", "de": "7 Tage"},
"delivery_hour": "168",
"warehouse_external_id": "1",
"restocking_date": "2025-02-02"
},
{
"delivery_format": {"pl": "7 dni", "en": "7 days", "de": "7 Tage"},
"delivery_hour": "168",
"warehouse_external_id": "2",
"restocking_date": "2025-02-02"
}
]
},
"package": {
"name": "Euro-pallet",
"dimensions": {
"height": "100.00",
"width": "100.00",
"length": "100.00",
"weight": "10.00"
}
},
"attributes": {
"pl": [
{
"Dane techniczne": [
["Kolor", "czerwony"],
["Rozmiar", "średni"]
]
},
{
"Dane dodatkowe" : [
["Produkt wyprodukowany w UE", "tak"]
]
}
],
"en": [
{
"Technical data": [
["Color", "red"],
["Size", "medium"]
]
},
{
"Additional data" : [
["Product manufactured in the EU", "yes"]
]
}
]
},
"multimedia": {
"photos": [
"https://example.com/photo1.jpg",
"https://example.com/photo2.jpg",
"https://example.com/photo3.jpg"
],
"files": [
["file1.pdf","https://example.com/file1.pdf"],
["file2.pdf","https://example.com/file2.pdf"],
["file3.pdf","https://example.com/file3.pdf"]
]
},
"units": [
{
"external_id": "szt.",
"primary_unit": "1",
"default_unit": "1",
"active": "1",
"rate": "1.0",
"discount": "0",
"minimum_sales_quantity": "1"
},
{
"external_id": "opk",
"primary_unit": "0",
"default_unit": "0",
"active": "1",
"rate": "10.0",
"discount": "10",
"minimum_sales_quantity": "1"
}
]
}
]