[NEWS] Parametr GTIN w ofertach oraz produktach / GTIN parameter in offers and products
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 244
- Fork
- 40
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Zgodnie z [wcześniejszą zapowiedzią](https://developer.allegro.pl/news/#gtin-intro) dzisiaj udostępniliśmy parametr **globalny numer jednostki handlowej tzw. [GTIN](https://pl.wikipedia.org/wiki/Global_Trade_Item_Number)**. W większości kategorii oznaczyliśmy go jako parametr podstawowy, czyli taki, który identyfikuje produkt w ofercie. Jeżeli chcesz określić lub zmienić GTIN, w zależności od kategorii, skorzystaj z dostępnych parametrów:
- EAN (id parametru=225693),
- ISBN (id parametru=245669),
- ISSN (id parametru=245673).
Pamiętaj, że parametry dostępne w danej kategorii sprawdzisz za pomocą [GET /sale/categories/{categoryId}/parameters](https://developer.allegro.pl/documentation/#operation/getFlatParametersUsingGET_2).
**GTIN w ofertach**
W ofertach parametr GTIN jest nadrzędny wobec pola “ean”, którego wartości przenieśliśmy do nowego parametru. Wartość EAN, ISBN lub ISSN możesz uzupełnić jedynie w parametrze GTIN, aby to zrobić pobierz aktualny stan oferty poprzez [GET /sale/offers/{offerId}](https://developer.allegro.pl/documentation/#operation/getOfferUsingGET), a następnie edytuj poprzez [PUT /sale/offers/{offerId}](https://developer.allegro.pl/documentation/#operation/updateOfferUsingPUT). Jeśli spróbujesz zmienić wartość pola “ean” w ofercie, otrzymasz komunikat błędu: “Pole ean jest tylko do odczytu. Wartość z pola ean podaj w parametrze o id: {id}.”
**Jeżeli dotychczas w integracji używasz pola “ean” by rozpoznać swoje oferty (jako sygnaturę), wykorzystaj w tym celu dedykowane dla sygnatury pole “external.id”.**
**GTIN w produktach**
Parametr GTIN dla produktów funkcjonuje równolegle z dotychczasową tablicą “eans”. Aktualne wartości “eans” przenieśliśmy do nowego parametru. Zgłaszając propozycję produktu przez [POST /sale/product-proposals](https://developer.allegro.pl/documentation/#operation/proposeSaleProduct) możesz przekazać wartość EAN, ISBN lub ISSN tylko w parametrze GTIN.
Parametr GTIN zyskał flagę “isGTIN” w strukturze “options” parametrów produktu. Dzięki temu podczas dodawania oferty na podstawie produktu rozpoznasz, że jeśli parametr ma wiele wartości, to możesz przekazać tylko jedną z nich.
**Przykładowy request:**
```
curl -X GET \
‘https://api.allegro.pl/sale/products/0ca14fc3-7084-4fa2-83da-d04104e8b162’ \
-H 'Accept: application/vnd.allegro.public.v1+json'
```
**Przykładowy response:**
```
...
"parameters": [
{
"id": "225693",
"name": "EAN",
"valuesLabels": [
"0901362561720"
],
"values": [
"0901362561720"
],
"unit": null,
"options": {
"identifiesProduct": true,
"isGTIN": true
}
}
],
...
```
**Ważne!** W przyszłości pole “ean” w ofercie oraz tablicę “eans” w produkcie usuniemy. Wartość GTIN (czyli EAN, ISBN, ISSN) zmienisz tylko korzystając z parametru, dlatego już dzisiaj rozpocznij prace nad ich poprawną obsługą w swojej aplikacji.
-----
According to our [previous announcement](https://developer.allegro.pl/en/news/#gtin-intro) today we have introduced **the Global Trade Item Number ([GTIN](https://en.wikipedia.org/wiki/Global_Trade_Item_Number)) parameter**. In most categories, we marked it as a basic parameter, which identifies the product in an offer. If you want to add or change GTIN parameter use the available parameters (depending on category):
- EAN (parameter id=225693),
- ISBN (parameter id=245669),
- ISSN (parameter id=245673).
You can check parameters available in a given category by [GET /sale/categories/{categoryId}/parameters](https://developer.allegro.pl/documentation/#operation/getFlatParametersUsingGET_2).
**GTIN in offers**
In offers, GTIN parameter overrode “ean” field, whose values were transferred to the new parameter. You can only fill in the EAN, ISBN, ISSN value in the GTIN parameter. To do so retrieve an offer via [GET /sale/offers/{offerId}](https://developer.allegro.pl/documentation/#operation/getOfferUsingGET) and then edit it by [PUT /sale/offers/{offerId}](https://developer.allegro.pl/documentation/#operation/updateOfferUsingPUT). If you try to change the value of the "ean" field in the offer, you will receive an error message: "Ean field is read-only. Set this value in parameter with id: {id}."
**If you use in your integration the "ean" to recognize your offers (as so-called signature), switch to the "external.id" field, which is dedicated to the signature.**
**GTIN in products**
The GTIN parameter for products functions in parallel with the existing "eans" array. We transferred the current values of "eans" to the new parameter. If you propose a product via [POST /sale/product-proposals](https://developer.allegro.pl/documentation/#operation/proposeSaleProduct) you can submit EAN, ISBN or ISSN value only in the GTIN parameter.
The GTIN parameter received the "isGTIN" flag in the "options" structure of the product parameters. Owing to it, when you will add an offer based on a product, you will recognize if a parameter has many values, you can only use one of them.
**Sample request:**
```
curl -X GET \
‘https://api.allegro.pl/sale/products/0ca14fc3-7084-4fa2-83da-d04104e8b162’ \
-H 'Accept: application/vnd.allegro.public.v1+json'
```
**Sample response:**
```
...
"parameters": [
{
"id": "225693",
"name": "EAN",
"valuesLabels": [
"0901362561720"
],
"values": [
"0901362561720"
],
"unit": null,
"options": {
"identifiesProduct": true,
"isGTIN": true
}
}
],
...
```
**Note!** In the future, we will remove the "ean" field in the offer and the "eans" array in the product. You will change the GTIN value (i.e. EAN, ISBN, ISSN) only using the parameter, so start working on their correct implementation in your application today.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.