Ürün türleri API
Ürün türleri modülünün tüm işlemleri (14) ve veri modelleri (8): adresler, izinler, girdiler, ön koşullar, olaylar ve örnekler.
Ürün türleri ve renk, beden, malzeme gibi yeniden kullanılabilir özellikler.
Modül kodu attributes · 14 işlem · 8 veri modeli · 10 olay. Bir anahtar ya da token, arkasındaki kişinin bu modülde yapabildiğinden fazlasını asla yapamaz; satır düzeyindeki güvenlik uygulamadakiyle birebir aynıdır. Yetki kapsamları: attributes (hepsi), attributes:read (yalnız okuma) ya da attributes:<yetenek>.
Kaynaklar
| Kaynak | Tablo | Listeleme ve okuma | POST | PATCH | DELETE |
|---|---|---|---|---|---|
attribute_item_options | attribute_item_option | /api/v1/attribute_item_options | |||
attribute_values | attribute_value | /api/v1/attribute_values | attributes.save_attribute_value | attributes.delete_attribute_value | |
attributes | attribute | /api/v1/attributes | attributes.save_attribute | attributes.delete_attribute | |
product_attribute_values | item_attribute_value | /api/v1/product_attribute_values | |||
product_type_attributes | product_type_attribute | /api/v1/product_type_attributes | |||
product_type_links | item_product_type | /api/v1/product_type_links | |||
product_types | product_type | /api/v1/product_types | attributes.save_product_type | attributes.delete_product_type | |
variant_attribute_values | variant_attribute_value | /api/v1/variant_attribute_values |
Listeler limit (en çok 200), cursor, order (ör. -created_at), fields ve q alır; diğer her sorgu parametresi bir sütun süzgecidir: ?status=paid, ?total[gte]=100, ?id[in]=a,b, ?x=null.
İşlemler
| İşlem | Gereken izin | Ne yapar |
|---|---|---|
attributes.assign_attributes | attributes:manage | Tipe özellik ekle |
attributes.delete_attribute | attributes:delete | Özelliği sil |
attributes.delete_attribute_value | attributes:manage | Seçeneği kaldır |
attributes.delete_product_type | attributes:delete | Ürün tipini sil |
attributes.reorder_attribute_values | attributes:manage | Seçenekleri sırala |
attributes.reorder_type_attributes | attributes:manage | Tipin özelliklerini sırala |
attributes.save_attribute | attributes:manage | Özelliği kaydet |
attributes.save_attribute_value | attributes:manage | Seçeneği kaydet |
attributes.save_product_type | attributes:manage | Ürün tipini kaydet |
attributes.set_item_attributes | attributes:write | Ürünün özelliklerini doldur |
attributes.set_item_type | attributes:write | Ürüne ürün tipini ver |
attributes.set_variant_attributes | attributes:write | Varyantın özelliklerini doldur |
attributes.unassign_attribute | attributes:manage | Özelliği tipten kaldır |
attributes.update_assignment | attributes:manage | Varyant seçiciyi değiştir |
attributes.assign_attributes
Tipe özellik ekle — Ürün seviyesinde ya da varyant seviyesinde — isteğe bağlı olarak varyant seçiciyi yönlendirir.
Gereken izin attributes:manage · veriyi değiştirir
https://app.getera.io/api/v1/attribute_item_options/actions/assign_attributes- Asıl adres:
POST /api/v1/actions/attributes.assign_attributes
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
productTypeId | uuid | evet | Ürün türü · kimliği: product_type |
attributeIds | object / array | evet | Özellikler |
level | string (enum) | evet | Seviye · İzin verilen değerler: product, variant |
variantSelection | boolean | Varyant seçiciyi belirler |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
not_found | Tip ve her özellik bulunmalı. |
attribute_already_assigned | Bir özellik bir tipte bir kez, tek seviyede yer alır. |
variant_only_attribute | Yalnızca varyanta ait bir özellik ürüne konamaz. |
variant_selection_not_allowed | Seçiciyi yalnızca varyant seviyesindeki açılır liste, evet/hayır, renk örneği veya sayı özellikleri yönlendirir. |
Yayımladığı olaylar: attributes.type_attributes_changed, attributes.variant_axes_synced
Neye yazar: attribute_item_option (upsert) — Maps a picker attribute onto the catalogue axis (item.md §9b); product_type_attribute (insert) — Assigns the attributes
curl -X POST https://app.getera.io/api/v1/attribute_item_options/actions/assign_attributes \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"productTypeId":"PRODUCT_TYPE_ID","attributeIds":{},"level":"product"}'{
"ok": true,
"result": "…",
"events": [
"attributes.type_attributes_changed",
"attributes.variant_axes_synced"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.attributeItemOptions.assignAttributes({
productTypeId: "PRODUCT_TYPE_ID",
attributeIds: {},
level: "product"
})era attribute_item_options assign_attributes --data '{"productTypeId":"PRODUCT_TYPE_ID","attributeIds":{},"level":"product"}'{
"name": "era__attributes__assign_attributes",
"arguments": {
"productTypeId": "PRODUCT_TYPE_ID",
"attributeIds": {},
"level": "product"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 not_found, attribute_already_assigned, variant_only_attribute, variant_selection_not_allowed · 429 çok sık istek
attributes.delete_attribute
Özelliği sil — Seçenekleri, atamaları ve her ürünün buna ait değeri de gider.
Gereken izin attributes:delete · siler ya da geri alınamaz · Era çalıştırırken bir kişiye onaylatır
https://app.getera.io/api/v1/attributes/{id}/actions/delete_attribute- REST kısayolu:
DELETE /api/v1/attributes/{id} - Asıl adres:
POST /api/v1/actions/attributes.delete_attribute
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | evet | Doldurulduğu yer: adresteki {id} · Özellik · kimliği: attribute |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
not_found | Özellik bulunmalı. |
Yayımladığı olaylar: attributes.attribute_deleted
Neye yazar: attribute (delete) — Removes it; the FKs remove what hangs off it
curl -X POST https://app.getera.io/api/v1/attributes/ATTRIBUTE_ID/actions/delete_attribute \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'{
"ok": true,
"result": "…",
"events": [
"attributes.attribute_deleted"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.attributes.deleteAttribute("ATTRIBUTE_ID")era attributes delete_attribute ATTRIBUTE_ID{
"name": "era__attributes__delete_attribute",
"arguments": {
"id": "ATTRIBUTE_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:delete izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 not_found · 429 çok sık istek
attributes.delete_attribute_value
Seçeneği kaldır — Onu seçmiş ürünler o değeri kaybeder.
Gereken izin attributes:manage · siler ya da geri alınamaz · Era çalıştırırken bir kişiye onaylatır
https://app.getera.io/api/v1/attribute_values/{id}/actions/delete_attribute_value- REST kısayolu:
DELETE /api/v1/attribute_values/{id} - Asıl adres:
POST /api/v1/actions/attributes.delete_attribute_value
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | evet | Doldurulduğu yer: adresteki {id} · Seçenek · kimliği: attribute_value |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
not_found | Seçenek bulunmalı. |
Yayımladığı olaylar: attributes.attribute_values_changed
Neye yazar: attribute_value (delete) — Removes the choice
curl -X POST https://app.getera.io/api/v1/attribute_values/ATTRIBUTE_VALUE_ID/actions/delete_attribute_value \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'{
"ok": true,
"result": "…",
"events": [
"attributes.attribute_values_changed"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.attributeValues.deleteAttributeValue("ATTRIBUTE_VALUE_ID")era attribute_values delete_attribute_value ATTRIBUTE_VALUE_ID{
"name": "era__attributes__delete_attribute_value",
"arguments": {
"id": "ATTRIBUTE_VALUE_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 not_found · 429 çok sık istek
attributes.delete_product_type
Ürün tipini sil — Yalnızca o tipte hiç ürün yokken. Ürünleri de silmek yerine reddeder.
Gereken izin attributes:delete · siler ya da geri alınamaz · Era çalıştırırken bir kişiye onaylatır
https://app.getera.io/api/v1/product_types/{id}/actions/delete_product_type- REST kısayolu:
DELETE /api/v1/product_types/{id} - Asıl adres:
POST /api/v1/actions/attributes.delete_product_type
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | evet | Doldurulduğu yer: adresteki {id} · Ürün türü · kimliği: product_type |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
not_found | Tip bulunmalı. |
product_type_in_use | Bu tipte hiçbir ürün olmamalı. |
Yayımladığı olaylar: attributes.product_type_deleted
Neye yazar: product_type (delete) — Removes the type and its assignments
curl -X POST https://app.getera.io/api/v1/product_types/PRODUCT_TYPE_ID/actions/delete_product_type \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{}'{
"ok": true,
"result": "…",
"events": [
"attributes.product_type_deleted"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.productTypes.deleteProductType("PRODUCT_TYPE_ID")era product_types delete_product_type PRODUCT_TYPE_ID{
"name": "era__attributes__delete_product_type",
"arguments": {
"id": "PRODUCT_TYPE_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:delete izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 not_found, product_type_in_use · 429 çok sık istek
attributes.reorder_attribute_values
Seçenekleri sırala — Bir seçicinin onları listelediği sıra.
Gereken izin attributes:manage · veriyi değiştirir
https://app.getera.io/api/v1/attribute_values/actions/reorder_attribute_values- Asıl adres:
POST /api/v1/actions/attributes.reorder_attribute_values
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
attributeId | uuid | evet | Özellik · kimliği: attribute |
valueIds | object / array | evet | Seçimler |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
not_found | Özellik bulunmalı. |
value_not_of_attribute | Her seçenek bu özelliğe ait olmalı. |
Yayımladığı olaylar: attributes.attribute_values_changed
Neye yazar: attribute_value (update) — Rewrites sort_order
curl -X POST https://app.getera.io/api/v1/attribute_values/actions/reorder_attribute_values \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"attributeId":"ATTRIBUTE_ID","valueIds":{}}'{
"ok": true,
"result": "…",
"events": [
"attributes.attribute_values_changed"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.attributeValues.reorderAttributeValues({
attributeId: "ATTRIBUTE_ID",
valueIds: {}
})era attribute_values reorder_attribute_values --data '{"attributeId":"ATTRIBUTE_ID","valueIds":{}}'{
"name": "era__attributes__reorder_attribute_values",
"arguments": {
"attributeId": "ATTRIBUTE_ID",
"valueIds": {}
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 not_found, value_not_of_attribute · 429 çok sık istek
attributes.reorder_type_attributes
Tipin özelliklerini sırala — Ürün ve varyant formlarının onları gösterdiği sıra.
Gereken izin attributes:manage · veriyi değiştirir
https://app.getera.io/api/v1/product_type_attributes/actions/reorder_type_attributes- Asıl adres:
POST /api/v1/actions/attributes.reorder_type_attributes
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
productTypeId | uuid | evet | Ürün türü · kimliği: product_type |
level | string (enum) | evet | Seviye · İzin verilen değerler: product, variant |
attributeIds | object / array | evet | Özellikler |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
not_found | Tip bulunmalı. |
attribute_not_on_type | Her özellik o seviyede tipte olmalı. |
Yayımladığı olaylar: attributes.type_attributes_changed
Neye yazar: product_type_attribute (update) — Rewrites sort_order
curl -X POST https://app.getera.io/api/v1/product_type_attributes/actions/reorder_type_attributes \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"productTypeId":"PRODUCT_TYPE_ID","level":"product","attributeIds":{}}'{
"ok": true,
"result": "…",
"events": [
"attributes.type_attributes_changed"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.productTypeAttributes.reorderTypeAttributes({
productTypeId: "PRODUCT_TYPE_ID",
level: "product",
attributeIds: {}
})era product_type_attributes reorder_type_attributes --data '{"productTypeId":"PRODUCT_TYPE_ID","level":"product","attributeIds":{}}'{
"name": "era__attributes__reorder_type_attributes",
"arguments": {
"productTypeId": "PRODUCT_TYPE_ID",
"level": "product",
"attributeIds": {}
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 not_found, attribute_not_on_type · 429 çok sık istek
attributes.save_attribute
Özelliği kaydet — Yeniden kullanılabilir bir özellik — renk, beden, malzeme — ve nasıl girilip gösterildiği.
Gereken izin attributes:manage · veriyi değiştirir
https://app.getera.io/api/v1/attributes/{id}/actions/save_attribute- REST kısayolu:
PATCH /api/v1/attributes/{id} - Asıl adres:
POST /api/v1/actions/attributes.save_attribute
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | Doldurulduğu yer: adresteki {id} · Özellik · kimliği: attribute | |
name | string | evet | Ad · en çok 255 |
slug | string | Kod · en çok 250 | |
inputType | string (enum) | Tür · İzin verilen değerler: dropdown, multiselect, file, reference, single-reference, numeric, rich-text, plain-text, swatch, boolean, date, date-time | |
entityType | string | İşaret ettiği kayıt türü · en çok 40 | |
unit | string | Birim · en çok 40 | |
valueRequired | boolean | Zorunlu | |
isVariantOnly | boolean | Yalnızca varyantlar | |
visibleInStorefront | boolean | Vitrinde gösterilir | |
filterableInStorefront | boolean | Mağaza sitesinde filtrele | |
filterableInDashboard | boolean | Listelerde filtrele | |
storefrontSearchPosition | number | Pozisyon ara | |
availableInGrid | boolean | Listelerde sütun | |
values | object / array | Seçimler |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
invalid_name | Ad kullanılabilir bir kod üretmeli. |
not_found | Düzenlenen özellik bulunmalı. |
input_type_locked | Tip bir kez seçilir. |
slug_taken | Kod bu çalışma alanında boşta olmalı. |
entity_type_required | Bir referans neyi gösterdiğini belirtmeli. |
entity_type_not_allowed | Yalnızca bir referans bir şeyi gösterir ve yalnızca bir ürünü, varyantı veya kategoriyi. |
unit_not_allowed | Yalnızca bir sayının birimi olur ve yalnızca bilinen bir birim. |
property_not_allowed | Filtreleme, ızgara ve arama konumu yalnızca bunları destekleyen türlerde olur. |
attribute_has_no_choices | Yalnızca açılır liste, çoklu seçim ve renk örneğinin seçenekleri olur. |
value_name_taken | Bir seçenek bir kez verilebilir. |
Yayımladığı olaylar: attributes.attribute_saved
Neye yazar: attribute (upsert) — Creates or edits the attribute; attribute_value (insert) — Writes the first choices on create
curl -X POST https://app.getera.io/api/v1/attributes/ATTRIBUTE_ID/actions/save_attribute \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"name":"Name"}'{
"ok": true,
"result": "…",
"events": [
"attributes.attribute_saved"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.attributes.saveAttribute("ATTRIBUTE_ID", {
name: "Name"
})era attributes save_attribute ATTRIBUTE_ID \
--name "Name"{
"name": "era__attributes__save_attribute",
"arguments": {
"id": "ATTRIBUTE_ID",
"name": "Name"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 invalid_name, not_found, input_type_locked, slug_taken, entity_type_required, entity_type_not_allowed, unit_not_allowed, property_not_allowed, attribute_has_no_choices, value_name_taken · 429 çok sık istek
attributes.save_attribute_value
Seçeneği kaydet — Bir açılır listenin, çoklu seçimin veya renk örneğinin bir seçeneği.
Gereken izin attributes:manage · veriyi değiştirir
https://app.getera.io/api/v1/attribute_values/{id}/actions/save_attribute_value- REST kısayolu:
PATCH /api/v1/attribute_values/{id} - Asıl adres:
POST /api/v1/actions/attributes.save_attribute_value
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | Doldurulduğu yer: adresteki {id} · Seçenek · kimliği: attribute_value | |
attributeId | uuid | evet | Özellik · kimliği: attribute |
name | string | evet | Ad · en çok 250 |
value | string | Renk · #RRGGBB veya #RRGGBBAA — yalnızca renk örnekleri için. · en çok 9 | |
fileId | uuid | Resim · kimliği: file |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
not_found | Özellik ve düzenlenen seçenek bulunmalı. |
attribute_has_no_choices | Özellik bir açılır liste, çoklu seçim veya renk örneği olmalı. |
invalid_name | Seçeneğin bir adı olmalı. |
swatch_only_field | Yalnızca renk örneği seçeneği bir renk veya görsel taşır. |
invalid_swatch | Renk örneği tek bir geçerli renk ya da tek bir görseldir. |
value_name_taken | Seçenek adları, büyük-küçük harf gözetmeksizin, özellik içinde benzersizdir. |
Yayımladığı olaylar: attributes.attribute_values_changed, attributes.variant_axes_synced
Neye yazar: attribute_item_option (upsert) — Maps a picker attribute onto the catalogue axis (item.md §9b); attribute_value (upsert) — Creates or edits the choice
curl -X POST https://app.getera.io/api/v1/attribute_values/ATTRIBUTE_VALUE_ID/actions/save_attribute_value \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"attributeId":"ATTRIBUTE_ID","name":"Name"}'{
"ok": true,
"result": "…",
"events": [
"attributes.attribute_values_changed",
"attributes.variant_axes_synced"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.attributeValues.saveAttributeValue("ATTRIBUTE_VALUE_ID", {
attributeId: "ATTRIBUTE_ID",
name: "Name"
})era attribute_values save_attribute_value ATTRIBUTE_VALUE_ID \
--attribute-id "ATTRIBUTE_ID" \
--name "Name"{
"name": "era__attributes__save_attribute_value",
"arguments": {
"id": "ATTRIBUTE_VALUE_ID",
"attributeId": "ATTRIBUTE_ID",
"name": "Name"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 not_found, attribute_has_no_choices, invalid_name, swatch_only_field, invalid_swatch, value_name_taken · 429 çok sık istek
attributes.save_product_type
Ürün tipini kaydet — Bir ürün türü ve ürünlerinin taşıdığı özellik seti.
Gereken izin attributes:manage · veriyi değiştirir
https://app.getera.io/api/v1/product_types/{id}/actions/save_product_type- REST kısayolu:
PATCH /api/v1/product_types/{id} - Asıl adres:
POST /api/v1/actions/attributes.save_product_type
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
id | uuid | Doldurulduğu yer: adresteki {id} · Ürün türü · kimliği: product_type | |
name | string | evet | Ad · en çok 250 |
slug | string | Adres · en çok 255 | |
kind | string (enum) | Tür · İzin verilen değerler: normal, gift_card | |
isShippingRequired | boolean | Gönderilir | |
weightGrams | number | Ağırlık (gram) · en az 0 | |
taxClassId | uuid | Vergi sınıfı |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
invalid_name | Ad kullanılabilir bir adres üretmeli. |
slug_taken | Adres bu çalışma alanında boşta olmalı. |
not_found | Düzenlenen tip bulunmalı. |
product_type_in_use | Bu tipte ürünler varken tür değişemez. |
Yayımladığı olaylar: attributes.product_type_saved
Neye yazar: product_type (upsert) — Creates or edits the type
curl -X POST https://app.getera.io/api/v1/product_types/PRODUCT_TYPE_ID/actions/save_product_type \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"name":"Name"}'{
"ok": true,
"result": "…",
"events": [
"attributes.product_type_saved"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.productTypes.saveProductType("PRODUCT_TYPE_ID", {
name: "Name"
})era product_types save_product_type PRODUCT_TYPE_ID \
--name "Name"{
"name": "era__attributes__save_product_type",
"arguments": {
"id": "PRODUCT_TYPE_ID",
"name": "Name"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 invalid_name, slug_taken, not_found, product_type_in_use · 429 çok sık istek
attributes.set_item_attributes
Ürünün özelliklerini doldur — Ürün seviyesindeki değerler — malzeme, marka serisi, bakım talimatı.
Gereken izin attributes:write · veriyi değiştirir
https://app.getera.io/api/v1/product_attribute_values/actions/set_item_attributes- Asıl adres:
POST /api/v1/actions/attributes.set_item_attributes
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
itemId | uuid | evet | Kalem · kimliği: item |
values | object / array | evet | Değerler |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
item_not_found | Ürün bulunmalı. |
item_has_no_type | Ürünün bir ürün tipi olmalı. |
attribute_not_on_type | Her özellik bu seviyede tipte olmalı. |
attribute_value_invalid | Değer, özelliğinin türüne ve seçeneklerine uymalı. |
attribute_value_required | Zorunlu özelliklerin sonunda bir değeri olmalı. |
Yayımladığı olaylar: attributes.item_attributes_changed
Neye yazar: item_attribute_value (upsert) — Replaces the values of each attribute sent
curl -X POST https://app.getera.io/api/v1/product_attribute_values/actions/set_item_attributes \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"itemId":"ITEM_ID","values":{}}'{
"ok": true,
"result": "…",
"events": [
"attributes.item_attributes_changed"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.productAttributeValues.setItemAttributes({
itemId: "ITEM_ID",
values: {}
})era product_attribute_values set_item_attributes --data '{"itemId":"ITEM_ID","values":{}}'{
"name": "era__attributes__set_item_attributes",
"arguments": {
"itemId": "ITEM_ID",
"values": {}
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 item_not_found, item_has_no_type, attribute_not_on_type, attribute_value_invalid, attribute_value_required · 429 çok sık istek
attributes.set_item_type
Ürüne ürün tipini ver — Bir kez seçilir — ürünün hangi özellikleri taşıyacağına karar verir.
Gereken izin attributes:write · veriyi değiştirir
https://app.getera.io/api/v1/attribute_item_options/actions/set_item_type- Asıl adres:
POST /api/v1/actions/attributes.set_item_type
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
itemId | uuid | evet | Kalem · kimliği: item |
productTypeId | uuid | evet | Ürün türü · kimliği: product_type |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
item_not_found | Ürün bulunmalı. |
not_found | Tip bulunmalı. |
item_type_locked | Bir ürünün tipi bir kez seçilir. |
type_does_not_fit_item | Kargo ve hediye kartı türü ürünle uyuşmalı. |
Yayımladığı olaylar: attributes.item_type_set, attributes.variant_axes_synced
Neye yazar: attribute_item_option (upsert) — Maps a picker attribute onto the catalogue axis (item.md §9b); item_product_type (insert) — Records the item’s type
curl -X POST https://app.getera.io/api/v1/attribute_item_options/actions/set_item_type \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"itemId":"ITEM_ID","productTypeId":"PRODUCT_TYPE_ID"}'{
"ok": true,
"result": "…",
"events": [
"attributes.item_type_set",
"attributes.variant_axes_synced"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.attributeItemOptions.setItemType({
itemId: "ITEM_ID",
productTypeId: "PRODUCT_TYPE_ID"
})era attribute_item_options set_item_type \
--item-id "ITEM_ID" \
--product-type-id "PRODUCT_TYPE_ID"{
"name": "era__attributes__set_item_type",
"arguments": {
"itemId": "ITEM_ID",
"productTypeId": "PRODUCT_TYPE_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 item_not_found, not_found, item_type_locked, type_does_not_fit_item · 429 çok sık istek
attributes.set_variant_attributes
Varyantın özelliklerini doldur — Varyant seviyesindeki değerler — beden, renk — seçiciyi yönlendirenler dâhil.
Gereken izin attributes:write · veriyi değiştirir
https://app.getera.io/api/v1/attribute_item_options/actions/set_variant_attributes- Asıl adres:
POST /api/v1/actions/attributes.set_variant_attributes
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
itemVariantId | uuid | evet | Varyant · kimliği: item_variant |
values | object / array | evet | Değerler |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
variant_not_found | Varyant bulunmalı. |
item_has_no_type | Ürünün bir ürün tipi olmalı. |
attribute_not_on_type | Her özellik bu seviyede tipte olmalı. |
attribute_value_invalid | Değer, özelliğinin türüne ve seçeneklerine uymalı. |
attribute_value_required | Zorunlu özelliklerin sonunda bir değeri olmalı. |
Yayımladığı olaylar: attributes.variant_attributes_changed, attributes.variant_axes_synced
Neye yazar: attribute_item_option (upsert) — Maps a picker attribute onto the catalogue axis (item.md §9b); variant_attribute_value (upsert) — Replaces the values of each attribute sent
curl -X POST https://app.getera.io/api/v1/attribute_item_options/actions/set_variant_attributes \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"itemVariantId":"ITEM_VARIANT_ID","values":{}}'{
"ok": true,
"result": "…",
"events": [
"attributes.variant_attributes_changed",
"attributes.variant_axes_synced"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.attributeItemOptions.setVariantAttributes({
itemVariantId: "ITEM_VARIANT_ID",
values: {}
})era attribute_item_options set_variant_attributes --data '{"itemVariantId":"ITEM_VARIANT_ID","values":{}}'{
"name": "era__attributes__set_variant_attributes",
"arguments": {
"itemVariantId": "ITEM_VARIANT_ID",
"values": {}
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:write izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 variant_not_found, item_has_no_type, attribute_not_on_type, attribute_value_invalid, attribute_value_required · 429 çok sık istek
attributes.unassign_attribute
Özelliği tipten kaldır — O tipteki ürünlerin bu özellik için taşıdığı değerler de gider.
Gereken izin attributes:manage · siler ya da geri alınamaz · Era çalıştırırken bir kişiye onaylatır
https://app.getera.io/api/v1/product_type_attributes/actions/unassign_attribute- Asıl adres:
POST /api/v1/actions/attributes.unassign_attribute
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
productTypeId | uuid | evet | Ürün türü · kimliği: product_type |
attributeId | uuid | evet | Özellik · kimliği: attribute |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
not_found | Tip ve özellik bulunmalı. |
attribute_not_on_type | Özellik tipte olmalı. |
Yayımladığı olaylar: attributes.type_attributes_changed
Neye yazar: product_type_attribute (delete) — Removes the assignment; item_attribute_value (delete) — Removes products’ values for it; variant_attribute_value (delete) — Removes variants’ values for it
curl -X POST https://app.getera.io/api/v1/product_type_attributes/actions/unassign_attribute \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"productTypeId":"PRODUCT_TYPE_ID","attributeId":"ATTRIBUTE_ID"}'{
"ok": true,
"result": "…",
"events": [
"attributes.type_attributes_changed"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.productTypeAttributes.unassignAttribute({
productTypeId: "PRODUCT_TYPE_ID",
attributeId: "ATTRIBUTE_ID"
})era product_type_attributes unassign_attribute \
--product-type-id "PRODUCT_TYPE_ID" \
--attribute-id "ATTRIBUTE_ID"{
"name": "era__attributes__unassign_attribute",
"arguments": {
"productTypeId": "PRODUCT_TYPE_ID",
"attributeId": "ATTRIBUTE_ID"
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 not_found, attribute_not_on_type · 429 çok sık istek
attributes.update_assignment
Varyant seçiciyi değiştir — Bir varyant özelliğinin sitede “Beden: S M L” düğmeleri olarak görünüp görünmediği.
Gereken izin attributes:manage · veriyi değiştirir
https://app.getera.io/api/v1/attribute_item_options/actions/update_assignment- Asıl adres:
POST /api/v1/actions/attributes.update_assignment
Girdi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
productTypeId | uuid | evet | Ürün türü · kimliği: product_type |
attributeId | uuid | evet | Özellik · kimliği: attribute |
variantSelection | boolean | evet | Varyant seçiciyi belirler |
Ön koşullar
Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:
| Kod | Ne zaman reddedilir |
|---|---|
not_found | Tip ve özellik bulunmalı. |
attribute_not_on_type | Tipin bir varyant özelliği olmalı. |
variant_selection_not_allowed | Seçiciyi yalnızca açılır liste, evet/hayır, renk örneği veya sayı yönlendirir. |
Yayımladığı olaylar: attributes.type_attributes_changed, attributes.variant_axes_synced
Neye yazar: attribute_item_option (upsert) — Maps a picker attribute onto the catalogue axis (item.md §9b); product_type_attribute (update) — Sets variant_selection
curl -X POST https://app.getera.io/api/v1/attribute_item_options/actions/update_assignment \
-H "Authorization: Bearer $ERA_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"productTypeId":"PRODUCT_TYPE_ID","attributeId":"ATTRIBUTE_ID","variantSelection":true}'{
"ok": true,
"result": "…",
"events": [
"attributes.type_attributes_changed",
"attributes.variant_axes_synced"
]
}import { createEra } from "@getera/sdk"
const era = createEra({ apiKey: process.env.ERA_API_KEY })
const res = await era.attributeItemOptions.updateAssignment({
productTypeId: "PRODUCT_TYPE_ID",
attributeId: "ATTRIBUTE_ID",
variantSelection: true
})era attribute_item_options update_assignment \
--product-type-id "PRODUCT_TYPE_ID" \
--attribute-id "ATTRIBUTE_ID" \
--variant-selection true{
"name": "era__attributes__update_assignment",
"arguments": {
"productTypeId": "PRODUCT_TYPE_ID",
"attributeId": "ATTRIBUTE_ID",
"variantSelection": true
}
}Hatalar: 401 kimlik bilgisi yok ya da süresi dolmuş · 403 kimlik bilgisinde attributes:manage izni yok · 404 kayıt ya da modül erişim dışında · 422 geçersiz girdi (problems[]) · 409 not_found, attribute_not_on_type, variant_selection_not_allowed · 429 çok sık istek
Veri modelleri
AttributeItemOption
Tablo attribute_item_option · Kaynak attribute_item_options
GET /api/v1/attribute_item_optionsGET /api/v1/attribute_item_options/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
item_id | string (uuid) · uuid | item | ||
attribute_id | string (uuid) · uuid | attribute | ||
item_option_id | string (uuid) · uuid | item_option | ||
created_at | string (date-time) · timestamptz |
Birincil anahtar: id
Tekil: item_id, attribute_id · item_option_id
AttributeValue
Tablo attribute_value · Kaynak attribute_values
GET /api/v1/attribute_valuesGET /api/v1/attribute_values/{id}PATCH /api/v1/attribute_values/{id}→attributes.save_attribute_valueDELETE /api/v1/attribute_values/{id}→attributes.delete_attribute_value
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
attribute_id | string (uuid) · uuid | attribute | ||
name | string · text | |||
slug | string · text | |||
value | string · text | |||
file_id | string (uuid) · uuid | evet | file | |
sort_order | integer · int4 | |||
external_reference | string · text | evet | ||
created_at | string (date-time) · timestamptz |
Birincil anahtar: id
Tekil: attribute_id, slug
Denetimler:
CHECK (((value = ''::text) OR (file_id IS NULL)))
Attribute
Tablo attribute · Kaynak attributes
GET /api/v1/attributesGET /api/v1/attributes/{id}PATCH /api/v1/attributes/{id}→attributes.save_attributeDELETE /api/v1/attributes/{id}→attributes.delete_attribute
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
name | string · text | |||
slug | string · text | |||
input_type | string · text | dropdown, multiselect, file, reference, single-reference, numeric, rich-text, plain-text, swatch, boolean, date, date-time | ||
entity_type | string · text | evet | Product, ProductVariant, Category | |
unit | string · text | evet | mm, cm, dm, m, km, ft, yd, inch, sq_mm, sq_cm, sq_dm, sq_m, sq_km, sq_ft, sq_yd, sq_inch, cubic_millimeter, cubic_centimeter, cubic_decimeter, cubic_meter, liter, cubic_foot, cubic_inch, cubic_yard, qt, pint, fl_oz, acre_in, acre_ft, g, lb, oz, kg, tonne | |
value_required | boolean · bool | |||
is_variant_only | boolean · bool | |||
visible_in_storefront | boolean · bool | |||
filterable_in_storefront | boolean · bool | |||
filterable_in_dashboard | boolean · bool | |||
storefront_search_position | integer · int4 | |||
available_in_grid | boolean · bool | |||
external_reference | string · text | evet | ||
metadata | object · jsonb | |||
created_at | string (date-time) · timestamptz | |||
updated_at | string (date-time) · timestamptz |
Birincil anahtar: id
Denetimler:
CHECK (((input_type = ANY (ARRAY['reference'::text, 'single-reference'::text])) = (entity_type IS NOT NULL)))CHECK (((unit IS NULL) OR (input_type = 'numeric'::text)))
ItemAttributeValue
Tablo item_attribute_value · Kaynak product_attribute_values
GET /api/v1/product_attribute_valuesGET /api/v1/product_attribute_values/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
item_id | string (uuid) · uuid | item | ||
attribute_id | string (uuid) · uuid | attribute | ||
value_id | string (uuid) · uuid | evet | attribute_value | |
text_value | string · text | evet | ||
numeric_value | number · float8 | evet | ||
boolean_value | boolean · bool | evet | ||
date_value | string (date-time) · timestamptz | evet | ||
file_id | string (uuid) · uuid | evet | file | |
reference_item_id | string (uuid) · uuid | evet | item | |
reference_variant_id | string (uuid) · uuid | evet | item_variant | |
reference_category_id | string (uuid) · uuid | evet | item_category | |
sort_order | integer · int4 | |||
created_at | string (date-time) · timestamptz |
Birincil anahtar: id
Denetimler:
CHECK ((num_nonnulls(value_id, text_value, numeric_value, boolean_value, date_value, file_id, reference_item_id, reference_variant_id, reference_category_id) = 1))
ProductTypeAttribute
Tablo product_type_attribute · Kaynak product_type_attributes
GET /api/v1/product_type_attributesGET /api/v1/product_type_attributes/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
product_type_id | string (uuid) · uuid | product_type | ||
attribute_id | string (uuid) · uuid | attribute | ||
level | string · text | product, variant | ||
variant_selection | boolean · bool | |||
sort_order | integer · int4 |
Birincil anahtar: id
Tekil: product_type_id, attribute_id
Denetimler:
CHECK (((level = 'variant'::text) OR (NOT variant_selection)))
ItemProductType
Tablo item_product_type · Kaynak product_type_links
GET /api/v1/product_type_linksGET /api/v1/product_type_links/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
item_id | string (uuid) · uuid | item | ||
product_type_id | string (uuid) · uuid | product_type | ||
created_at | string (date-time) · timestamptz |
Birincil anahtar: id
Tekil: item_id
ProductType
Tablo product_type · Kaynak product_types
GET /api/v1/product_typesGET /api/v1/product_types/{id}PATCH /api/v1/product_types/{id}→attributes.save_product_typeDELETE /api/v1/product_types/{id}→attributes.delete_product_type
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
name | string · text | |||
slug | string · text | |||
kind | string · text | normal, gift_card | ||
is_shipping_required | boolean · bool | |||
weight_grams | string (int64) · int8 | |||
tax_class_id | string (uuid) · uuid | evet | ||
metadata | object · jsonb | |||
created_at | string (date-time) · timestamptz | |||
updated_at | string (date-time) · timestamptz |
Birincil anahtar: id
Denetimler:
CHECK ((weight_grams >= 0))
VariantAttributeValue
Tablo variant_attribute_value · Kaynak variant_attribute_values
GET /api/v1/variant_attribute_valuesGET /api/v1/variant_attribute_values/{id}
| Sütun | Tür | Boş olabilir | İzin verilen değerler | Bağlı olduğu tablo |
|---|---|---|---|---|
id | string (uuid) · uuid | |||
organization_id | string (uuid) · uuid | organization | ||
workspace_id | string (uuid) · uuid | workspace | ||
item_variant_id | string (uuid) · uuid | item_variant | ||
attribute_id | string (uuid) · uuid | attribute | ||
value_id | string (uuid) · uuid | evet | attribute_value | |
text_value | string · text | evet | ||
numeric_value | number · float8 | evet | ||
boolean_value | boolean · bool | evet | ||
date_value | string (date-time) · timestamptz | evet | ||
file_id | string (uuid) · uuid | evet | file | |
reference_item_id | string (uuid) · uuid | evet | item | |
reference_variant_id | string (uuid) · uuid | evet | item_variant | |
reference_category_id | string (uuid) · uuid | evet | item_category | |
sort_order | integer · int4 | |||
created_at | string (date-time) · timestamptz |
Birincil anahtar: id
Denetimler:
CHECK ((num_nonnulls(value_id, text_value, numeric_value, boolean_value, date_value, file_id, reference_item_id, reference_variant_id, reference_category_id) = 1))
Olaylar
İş akışları ve webhook'lar bu olaylara tepki verir.
| Olay | Ne olur | Taşıdığı alanlar |
|---|---|---|
attributes.attribute_deleted | Bir özellik kaldırıldı. | id |
attributes.attribute_saved | Bir özellik oluşturuldu ya da düzenlendi. | id, slug, inputType |
attributes.attribute_values_changed | Bir özelliğin seçenekleri değişti. | attributeId |
attributes.item_attributes_changed | Bir ürünün özellik değerleri değişti. | itemId, count |
attributes.item_type_set | Bir ürüne ürün türü verildi. | itemId, productTypeId |
attributes.product_type_deleted | Bir ürün türü kaldırıldı. | id |
attributes.product_type_saved | Bir ürün türü oluşturuldu ya da düzenlendi. | id, slug |
attributes.type_attributes_changed | Bir türün özellik kümesi değişti. | productTypeId, count |
attributes.variant_attributes_changed | Bir varyantın özellik değerleri değişti. | itemVariantId, itemId, count |
attributes.variant_axes_synced | Seçici özellikleri katalog varyant eksenlerine eşlendi. | count, itemId |