> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.elall.webland.sk/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.elall.webland.sk/_mcp/server.

# Synchronizácia jedného produktu

PUT https://segat-test.webland.sk/api/v1/elall/products/item
Content-Type: application/json

Aktualizuje jeden produkt podľa **ean** a **stock_code** v tele. Vhodné po ručných úpravách v Elall, pre malú výdajku alebo predaj s jedným riadkom. `request_id` a `sync_context` môžu byť v tele. Povinné: `stock_code`, `status`, `segat_quantity`, `catalog_price`, `eshop_price`. Voliteľné: `ean`.

Reference: https://docs.elall.webland.sk/api/products/sync-product

## Authentication

- `X-API-Key` header (required) — Hodnota premennej prostredia ELALL_API_KEY na strane Segat Sync.

## Request

### Headers

- `X-API-Key` (string, required)

### Body (application/json)

This endpoint expects an ElallProductBody.

- `stock_code` (string, required) — Skladové číslo z Elall — povinný identifikátor (s EAN tvorí kompozitný kľúč).
- `status` (string, required)
- `segat_quantity` (integer, required)
- `catalog_price` (double, required) — Cenníková / listová cena
- `eshop_price` (double, required) — E-shop cena
- `ean` (string, optional, nullable) — EAN — voliteľný. Ak je uvedený, lookup je podľa páru (ean, stock_code); ak chýba alebo je prázdny, lookup je len podľa stock_code.
- `name` (string, optional, nullable)
- `section_width_mm` (string, optional, nullable) — Šírka (mm) — číslo alebo ľubovoľný reťazec z exportu (napr. 215, P245, 30X9.5).
- `aspect_ratio` (string, optional, nullable) — Profil — číslo alebo ľubovoľný reťazec z exportu (napr. 55, 50Z, 31X10.5).
- `rim_inch` (string, optional, nullable) — Priemer ráfika v palcoch (ETRTO). Môže byť číslo (napr. 16), s prefixom R (napr. R21) alebo záporná hodnota (napr. -16).
- `tread_name` (string, optional, nullable) — Názov dezénu
- `name_suffix` (string, optional, nullable) — Doplnok k názvu (variant, ročník, marketingový text).
- `load_index` (string, optional, nullable)
- `speed_index` (string, optional, nullable)
- `special_marking` (string, optional, nullable) — Špeciálne označenie
- `run_on_flat` (boolean, optional, nullable) — ROF
- `brand` (string, optional, nullable) — Výrobca / značka
- `usage` (string, optional, nullable) — Trieda použitia plášťa (napr. osobné, SUV, ľahký úžitkový).
- `season` (string, optional, nullable) — Sezónnosť plášťa — ľubovoľný reťazec (max 32 znakov), bez validácie enumu. Bežné hodnoty napr. summer / winter / all_season, ale aj kódy dodávateľa, lokalizované texty (letná, zimná) alebo skratky podľa vášho katalógu.
- `on_promotion` (boolean, optional, nullable) — Akcia
- `on_clearance` (boolean, optional, nullable) — Výpredaj / clearance (ostatné zásoby).
- `dot_code` (string, optional, nullable) — DOT
- `weight_kg` (ElallProductBodyWeightKg, optional, nullable) — Hmotnosť plášťa v kg (technický list, EU štítok).
- `discontinued` (boolean, optional, nullable) — Nepoužívať / nevyrába sa
- `eu_label` (string, optional, nullable) — EU štítok
- `request_id` (string, optional, nullable)
- `sync_context` (ElallSyncContext, optional, nullable) — Dôvod / kontext syncu na úrovni requestu (príjemka, výdajka, …).

## Response

### 200

Successful Response

- `success` (boolean, required)
- `products_received` (integer, required)
- `products_updated` (integer, required)
- `request_id` (string, optional, nullable)
- `unknown_products` (integer, optional, default: 0)

## Errors

### 400 Bad Request Error

Neplatný request (neznámy/ambiguous kľúč, validácia)

- `any`

### 401 Unauthorized Error

Neplatný alebo chýbajúci X-API-Key

- `any`

### 422 Unprocessable Entity Error

Chýba alebo je prázdny stock_code

- `any`

## Types

### ElallProductBodyWeightKg

Hmotnosť plášťa v kg (technický list, EU štítok).

### ElallSyncContext

Dôvod / kontext syncu na úrovni requestu (príjemka, výdajka, …).

- `source_type` (enum, required)
  - Allowed values: `stock_receipt`, `stock_issue`, `customer_sale`, `catalog_sync`, `stock_adjustment`, `manual`, `scheduled`, `other`
- `source_ref` (string, optional, nullable)
- `note` (string, optional, nullable)
- `actor` (string, optional, nullable)

## Examples

**Request**

```json
{
  "stock_code": "ELALL-SKU-001",
  "status": "active",
  "segat_quantity": 47,
  "catalog_price": 129.9,
  "eshop_price": 119,
  "ean": "5452000792440",
  "request_id": "VY-2025-00456",
  "sync_context": {
    "source_type": "customer_sale",
    "source_ref": "VY-2025-00456"
  }
}
```

**Response**

```json
{
  "success": true,
  "products_received": 1,
  "products_updated": 1,
  "request_id": "string",
  "unknown_products": 0
}
```

**SDK Code**

```python
import requests

url = "https://segat-test.webland.sk/api/v1/elall/products/item"

payload = {
    "stock_code": "ELALL-SKU-001",
    "status": "active",
    "segat_quantity": 47,
    "catalog_price": 129.9,
    "eshop_price": 119,
    "ean": "5452000792440",
    "request_id": "VY-2025-00456",
    "sync_context": {
        "source_type": "customer_sale",
        "source_ref": "VY-2025-00456"
    }
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://segat-test.webland.sk/api/v1/elall/products/item';
const options = {
  method: 'PUT',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"stock_code":"ELALL-SKU-001","status":"active","segat_quantity":47,"catalog_price":129.9,"eshop_price":119,"ean":"5452000792440","request_id":"VY-2025-00456","sync_context":{"source_type":"customer_sale","source_ref":"VY-2025-00456"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://segat-test.webland.sk/api/v1/elall/products/item"

	payload := strings.NewReader("{\n  \"stock_code\": \"ELALL-SKU-001\",\n  \"status\": \"active\",\n  \"segat_quantity\": 47,\n  \"catalog_price\": 129.9,\n  \"eshop_price\": 119,\n  \"ean\": \"5452000792440\",\n  \"request_id\": \"VY-2025-00456\",\n  \"sync_context\": {\n    \"source_type\": \"customer_sale\",\n    \"source_ref\": \"VY-2025-00456\"\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("X-API-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://segat-test.webland.sk/api/v1/elall/products/item")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"stock_code\": \"ELALL-SKU-001\",\n  \"status\": \"active\",\n  \"segat_quantity\": 47,\n  \"catalog_price\": 129.9,\n  \"eshop_price\": 119,\n  \"ean\": \"5452000792440\",\n  \"request_id\": \"VY-2025-00456\",\n  \"sync_context\": {\n    \"source_type\": \"customer_sale\",\n    \"source_ref\": \"VY-2025-00456\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://segat-test.webland.sk/api/v1/elall/products/item")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"stock_code\": \"ELALL-SKU-001\",\n  \"status\": \"active\",\n  \"segat_quantity\": 47,\n  \"catalog_price\": 129.9,\n  \"eshop_price\": 119,\n  \"ean\": \"5452000792440\",\n  \"request_id\": \"VY-2025-00456\",\n  \"sync_context\": {\n    \"source_type\": \"customer_sale\",\n    \"source_ref\": \"VY-2025-00456\"\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://segat-test.webland.sk/api/v1/elall/products/item', [
  'body' => '{
  "stock_code": "ELALL-SKU-001",
  "status": "active",
  "segat_quantity": 47,
  "catalog_price": 129.9,
  "eshop_price": 119,
  "ean": "5452000792440",
  "request_id": "VY-2025-00456",
  "sync_context": {
    "source_type": "customer_sale",
    "source_ref": "VY-2025-00456"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://segat-test.webland.sk/api/v1/elall/products/item");
var request = new RestRequest(Method.PUT);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"stock_code\": \"ELALL-SKU-001\",\n  \"status\": \"active\",\n  \"segat_quantity\": 47,\n  \"catalog_price\": 129.9,\n  \"eshop_price\": 119,\n  \"ean\": \"5452000792440\",\n  \"request_id\": \"VY-2025-00456\",\n  \"sync_context\": {\n    \"source_type\": \"customer_sale\",\n    \"source_ref\": \"VY-2025-00456\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "stock_code": "ELALL-SKU-001",
  "status": "active",
  "segat_quantity": 47,
  "catalog_price": 129.9,
  "eshop_price": 119,
  "ean": "5452000792440",
  "request_id": "VY-2025-00456",
  "sync_context": [
    "source_type": "customer_sale",
    "source_ref": "VY-2025-00456"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://segat-test.webland.sk/api/v1/elall/products/item")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```