feat: Add custom_label_4 handling in API and update documentation for new endpoints
This commit is contained in:
@@ -304,7 +304,7 @@ Bledy specyficzne:
|
||||
- Brak parametru identyfikujacego klienta: `422` z `"Missing required param: client_id, google_ads_id or merchant_id"`
|
||||
- Klient nie znaleziony: `404` z `"Client not found"`
|
||||
|
||||
### 4.6 Ustawienie custom_label_4 (istniejacy endpoint)
|
||||
### 4.6 Ustawienie custom_label_4
|
||||
|
||||
- `action=product_custom_label_4_set`
|
||||
- Cel: zapisuje `products.custom_label_4`
|
||||
@@ -313,7 +313,13 @@ Parametry:
|
||||
- `api_key` (string, wymagany)
|
||||
- `offer_id` (string, wymagany)
|
||||
- `client_id` (int, wymagany)
|
||||
- `custom_label_4` (string, opcjonalny)
|
||||
- `custom_label_4` (string, opcjonalny) - wartosc etykiety; alias: `value`
|
||||
|
||||
Uwagi:
|
||||
- wartosc jest przycinana (`trim`)
|
||||
- pusta wartosc ustawia pusty string (czyszczenie pola)
|
||||
- zmiana zapisuje komentarz techniczny w `products_comments`
|
||||
- jesli zapis sie nie powiedzie, API zwraca blad 500
|
||||
|
||||
Przyklad:
|
||||
|
||||
@@ -330,7 +336,55 @@ Przyklad odpowiedzi:
|
||||
|
||||
```json
|
||||
{
|
||||
"result": "ok"
|
||||
"result": "ok",
|
||||
"product_id": 987,
|
||||
"offer_id": "SKU-123",
|
||||
"client_id": 12,
|
||||
"custom_label_4": "bestseller"
|
||||
}
|
||||
```
|
||||
|
||||
### 4.6b Odczyt custom_label_4
|
||||
|
||||
- `action=product_custom_label_4_get`
|
||||
- Cel: odczytuje `products.custom_label_4`
|
||||
|
||||
Parametry:
|
||||
- `api_key` (string, wymagany)
|
||||
- `offer_id` (string, wymagany)
|
||||
- `client_id` (int, wymagany)
|
||||
|
||||
Przyklad:
|
||||
|
||||
```bash
|
||||
curl -G "https://example.com/api.php" \
|
||||
--data-urlencode "action=product_custom_label_4_get" \
|
||||
--data-urlencode "api_key=YOUR_API_KEY" \
|
||||
--data-urlencode "client_id=12" \
|
||||
--data-urlencode "offer_id=SKU-123"
|
||||
```
|
||||
|
||||
Przyklad odpowiedzi:
|
||||
|
||||
```json
|
||||
{
|
||||
"result": "ok",
|
||||
"product_id": 987,
|
||||
"offer_id": "SKU-123",
|
||||
"client_id": 12,
|
||||
"custom_label_4": "bestseller"
|
||||
}
|
||||
```
|
||||
|
||||
Jesli etykieta nie jest ustawiona:
|
||||
|
||||
```json
|
||||
{
|
||||
"result": "ok",
|
||||
"product_id": 987,
|
||||
"offer_id": "SKU-123",
|
||||
"client_id": 12,
|
||||
"custom_label_4": ""
|
||||
}
|
||||
```
|
||||
|
||||
@@ -478,6 +532,7 @@ Przy integracji AI zawsze ustawiaj jawnie `action` i weryfikuj, czy odpowiedz to
|
||||
- Zawsze wysylaj `api_key`, `action`, `client_id`, `offer_id`.
|
||||
- Po `product_title_set` od razu wywolaj `product_title_changed_check`.
|
||||
- Po `product_google_category_set` od razu wywolaj `product_google_category_get`.
|
||||
- Po `product_custom_label_4_set` od razu wywolaj `product_custom_label_4_get`.
|
||||
- Traktuj `null` jako brak wartosci.
|
||||
- Przy statusach `401`, `404`, `422` przerywaj workflow i zwracaj czytelny blad operatorowi.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user