Schémata
Vytvořit schéma
Vytvoření nového produktového schématu s definicemi sloupců.
POST
/
schemas
cURL
curl --request POST \
--url https://app.productlasso.com/api/v1/schemas \
--header "Authorization: Bearer $LASSO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"name": "Supplier products",
"columns": [
{"attribute_id": "11111111-1111-4111-8111-111111111111", "kind": "attribute", "key": "product_name", "label": "Product name", "type": "text"},
{"kind": "helper", "key": "source_row", "label": "Source row", "type": "text"}
]
}'
const response = await fetch("https://app.productlasso.com/api/v1/schemas", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.LASSO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Supplier products",
columns: [
{ attribute_id: "11111111-1111-4111-8111-111111111111", kind: "attribute", key: "product_name", label: "Product name", type: "text" },
{ kind: "helper", key: "source_row", label: "Source row", type: "text" },
],
}),
});
if (!response.ok) throw new Error(await response.text());
const schema = await response.json();
import os
import requests
response = requests.post(
"https://app.productlasso.com/api/v1/schemas",
headers={"Authorization": f"Bearer {os.environ['LASSO_API_KEY']}"},
json={
"name": "Supplier products",
"columns": [
{"attribute_id": "11111111-1111-4111-8111-111111111111", "kind": "attribute", "key": "product_name", "label": "Product name", "type": "text"},
{"kind": "helper", "key": "source_row", "label": "Source row", "type": "text"},
],
},
timeout=30,
)
response.raise_for_status()
schema = response.json()
{
"id": "9e1c77dd-8f10-41ca-bfe8-e672b89692d1",
"name": "Supplier products",
"description": "Core supplier feed fields",
"is_default": false,
"columns": [
{
"id": "8d79b7da-7134-443e-8110-678fe04de51b",
"attribute_id": "11111111-1111-4111-8111-111111111111",
"kind": "attribute",
"key": "product_name",
"label": "Product name",
"type": "text"
}
],
"created_at": "2026-08-31T09:00:00.000Z",
"updated_at": "2026-08-31T09:00:00.000Z"
}{
"status_code": 123,
"error_type": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"retryable": true,
"attribute_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attribute_key": "<string>",
"details": {},
"current_updated_at": "2023-11-07T05:31:56Z"
}{
"status_code": 123,
"error_type": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"retryable": true,
"attribute_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attribute_key": "<string>",
"details": {},
"current_updated_at": "2023-11-07T05:31:56Z"
}{
"status_code": 404,
"error_type": "not_found",
"message": "Attribute not found",
"request_id": "9de9ae63-7a89-40d0-a101-47e006ea8233",
"code": "attribute_not_found"
}{
"status_code": 123,
"error_type": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"retryable": true,
"attribute_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attribute_key": "<string>",
"details": {},
"current_updated_at": "2023-11-07T05:31:56Z"
}{
"status_code": 123,
"error_type": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"retryable": true,
"attribute_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attribute_key": "<string>",
"details": {},
"current_updated_at": "2023-11-07T05:31:56Z"
}Poznámky k použití
- Product Schema musí mít název a alespoň jeden sloupec.
- Existující firemní Attribute připojíte pomocí jeho
attribute_idakind: attribute. Klíč a typ musí odpovídat. - Pomocný sloupec lokální pro tabulku vytvoříte pomocí
kind: helperbezattribute_id. - Když vynecháte obě pole identity, Lasso zachová starší chování a vytvoří nebo připojí firemní Attribute pro daný klíč sloupce.
columns přes PUT /schemas/{schema_id} zachovejte serverem přidělené id sloupce.Autorizace
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Tělo
application/json
⌘I
cURL
curl --request POST \
--url https://app.productlasso.com/api/v1/schemas \
--header "Authorization: Bearer $LASSO_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"name": "Supplier products",
"columns": [
{"attribute_id": "11111111-1111-4111-8111-111111111111", "kind": "attribute", "key": "product_name", "label": "Product name", "type": "text"},
{"kind": "helper", "key": "source_row", "label": "Source row", "type": "text"}
]
}'
const response = await fetch("https://app.productlasso.com/api/v1/schemas", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.LASSO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Supplier products",
columns: [
{ attribute_id: "11111111-1111-4111-8111-111111111111", kind: "attribute", key: "product_name", label: "Product name", type: "text" },
{ kind: "helper", key: "source_row", label: "Source row", type: "text" },
],
}),
});
if (!response.ok) throw new Error(await response.text());
const schema = await response.json();
import os
import requests
response = requests.post(
"https://app.productlasso.com/api/v1/schemas",
headers={"Authorization": f"Bearer {os.environ['LASSO_API_KEY']}"},
json={
"name": "Supplier products",
"columns": [
{"attribute_id": "11111111-1111-4111-8111-111111111111", "kind": "attribute", "key": "product_name", "label": "Product name", "type": "text"},
{"kind": "helper", "key": "source_row", "label": "Source row", "type": "text"},
],
},
timeout=30,
)
response.raise_for_status()
schema = response.json()
{
"id": "9e1c77dd-8f10-41ca-bfe8-e672b89692d1",
"name": "Supplier products",
"description": "Core supplier feed fields",
"is_default": false,
"columns": [
{
"id": "8d79b7da-7134-443e-8110-678fe04de51b",
"attribute_id": "11111111-1111-4111-8111-111111111111",
"kind": "attribute",
"key": "product_name",
"label": "Product name",
"type": "text"
}
],
"created_at": "2026-08-31T09:00:00.000Z",
"updated_at": "2026-08-31T09:00:00.000Z"
}{
"status_code": 123,
"error_type": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"retryable": true,
"attribute_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attribute_key": "<string>",
"details": {},
"current_updated_at": "2023-11-07T05:31:56Z"
}{
"status_code": 123,
"error_type": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"retryable": true,
"attribute_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attribute_key": "<string>",
"details": {},
"current_updated_at": "2023-11-07T05:31:56Z"
}{
"status_code": 404,
"error_type": "not_found",
"message": "Attribute not found",
"request_id": "9de9ae63-7a89-40d0-a101-47e006ea8233",
"code": "attribute_not_found"
}{
"status_code": 123,
"error_type": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"retryable": true,
"attribute_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attribute_key": "<string>",
"details": {},
"current_updated_at": "2023-11-07T05:31:56Z"
}{
"status_code": 123,
"error_type": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"code": "<string>",
"retryable": true,
"attribute_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"attribute_key": "<string>",
"details": {},
"current_updated_at": "2023-11-07T05:31:56Z"
}
