Ü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

KaynakTabloListeleme ve okumaPOSTPATCHDELETE
attribute_item_optionsattribute_item_option/api/v1/attribute_item_options
attribute_valuesattribute_value/api/v1/attribute_valuesattributes.save_attribute_valueattributes.delete_attribute_value
attributesattribute/api/v1/attributesattributes.save_attributeattributes.delete_attribute
product_attribute_valuesitem_attribute_value/api/v1/product_attribute_values
product_type_attributesproduct_type_attribute/api/v1/product_type_attributes
product_type_linksitem_product_type/api/v1/product_type_links
product_typesproduct_type/api/v1/product_typesattributes.save_product_typeattributes.delete_product_type
variant_attribute_valuesvariant_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

İşlemGereken izinNe yapar
attributes.assign_attributesattributes:manageTipe özellik ekle
attributes.delete_attributeattributes:deleteÖzelliği sil
attributes.delete_attribute_valueattributes:manageSeçeneği kaldır
attributes.delete_product_typeattributes:deleteÜrün tipini sil
attributes.reorder_attribute_valuesattributes:manageSeçenekleri sırala
attributes.reorder_type_attributesattributes:manageTipin özelliklerini sırala
attributes.save_attributeattributes:manageÖzelliği kaydet
attributes.save_attribute_valueattributes:manageSeçeneği kaydet
attributes.save_product_typeattributes:manageÜrün tipini kaydet
attributes.set_item_attributesattributes:writeÜrünün özelliklerini doldur
attributes.set_item_typeattributes:writeÜrüne ürün tipini ver
attributes.set_variant_attributesattributes:writeVaryantın özelliklerini doldur
attributes.unassign_attributeattributes:manageÖzelliği tipten kaldır
attributes.update_assignmentattributes:manageVaryant 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

POSThttps://app.getera.io/api/v1/attribute_item_options/actions/assign_attributes
API anahtarı ya da OAuth token · attributes:manage
  • Asıl adres: POST /api/v1/actions/attributes.assign_attributes

Girdi

AlanTürZorunluAçıklama
productTypeIduuidevetÜrün türü · kimliği: product_type
attributeIdsobject / arrayevetÖzellikler
levelstring (enum)evetSeviye · İzin verilen değerler: product, variant
variantSelectionbooleanVaryant seçiciyi belirler

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
not_foundTip ve her özellik bulunmalı.
attribute_already_assignedBir özellik bir tipte bir kez, tek seviyede yer alır.
variant_only_attributeYalnızca varyanta ait bir özellik ürüne konamaz.
variant_selection_not_allowedSeç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"}'
Yanıt
{
  "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"}'
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/attributes/{id}/actions/delete_attribute
API anahtarı ya da OAuth token · attributes:delete
  • REST kısayolu: DELETE /api/v1/attributes/{id}
  • Asıl adres: POST /api/v1/actions/attributes.delete_attribute

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Özellik · kimliği: attribute

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe 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 '{}'
Yanıt
{
  "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
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/attribute_values/{id}/actions/delete_attribute_value
API anahtarı ya da OAuth token · attributes:manage
  • REST kısayolu: DELETE /api/v1/attribute_values/{id}
  • Asıl adres: POST /api/v1/actions/attributes.delete_attribute_value

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğu yer: adresteki {id} · Seçenek · kimliği: attribute_value

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
not_foundSeç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 '{}'
Yanıt
{
  "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
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/product_types/{id}/actions/delete_product_type
API anahtarı ya da OAuth token · attributes:delete
  • REST kısayolu: DELETE /api/v1/product_types/{id}
  • Asıl adres: POST /api/v1/actions/attributes.delete_product_type

Girdi

AlanTürZorunluAçıklama
iduuidevetDoldurulduğ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:

KodNe zaman reddedilir
not_foundTip bulunmalı.
product_type_in_useBu 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 '{}'
Yanıt
{
  "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
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/attribute_values/actions/reorder_attribute_values
API anahtarı ya da OAuth token · attributes:manage
  • Asıl adres: POST /api/v1/actions/attributes.reorder_attribute_values

Girdi

AlanTürZorunluAçıklama
attributeIduuidevetÖzellik · kimliği: attribute
valueIdsobject / arrayevetSeçimler

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
not_foundÖzellik bulunmalı.
value_not_of_attributeHer 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":{}}'
Yanıt
{
  "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":{}}'
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/product_type_attributes/actions/reorder_type_attributes
API anahtarı ya da OAuth token · attributes:manage
  • Asıl adres: POST /api/v1/actions/attributes.reorder_type_attributes

Girdi

AlanTürZorunluAçıklama
productTypeIduuidevetÜrün türü · kimliği: product_type
levelstring (enum)evetSeviye · İzin verilen değerler: product, variant
attributeIdsobject / arrayevetÖzellikler

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
not_foundTip bulunmalı.
attribute_not_on_typeHer ö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":{}}'
Yanıt
{
  "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":{}}'
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/attributes/{id}/actions/save_attribute
API anahtarı ya da OAuth token · attributes:manage
  • REST kısayolu: PATCH /api/v1/attributes/{id}
  • Asıl adres: POST /api/v1/actions/attributes.save_attribute

Girdi

AlanTürZorunluAçıklama
iduuidDoldurulduğu yer: adresteki {id} · Özellik · kimliği: attribute
namestringevetAd · en çok 255
slugstringKod · en çok 250
inputTypestring (enum)Tür · İzin verilen değerler: dropdown, multiselect, file, reference, single-reference, numeric, rich-text, plain-text, swatch, boolean, date, date-time
entityTypestringİşaret ettiği kayıt türü · en çok 40
unitstringBirim · en çok 40
valueRequiredbooleanZorunlu
isVariantOnlybooleanYalnızca varyantlar
visibleInStorefrontbooleanVitrinde gösterilir
filterableInStorefrontbooleanMağaza sitesinde filtrele
filterableInDashboardbooleanListelerde filtrele
storefrontSearchPositionnumberPozisyon ara
availableInGridbooleanListelerde sütun
valuesobject / arraySeçimler

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
invalid_nameAd kullanılabilir bir kod üretmeli.
not_foundDüzenlenen özellik bulunmalı.
input_type_lockedTip bir kez seçilir.
slug_takenKod bu çalışma alanında boşta olmalı.
entity_type_requiredBir referans neyi gösterdiğini belirtmeli.
entity_type_not_allowedYalnızca bir referans bir şeyi gösterir ve yalnızca bir ürünü, varyantı veya kategoriyi.
unit_not_allowedYalnızca bir sayının birimi olur ve yalnızca bilinen bir birim.
property_not_allowedFiltreleme, ızgara ve arama konumu yalnızca bunları destekleyen türlerde olur.
attribute_has_no_choicesYalnızca açılır liste, çoklu seçim ve renk örneğinin seçenekleri olur.
value_name_takenBir 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"}'
Yanıt
{
  "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"
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/attribute_values/{id}/actions/save_attribute_value
API anahtarı ya da OAuth token · attributes:manage
  • REST kısayolu: PATCH /api/v1/attribute_values/{id}
  • Asıl adres: POST /api/v1/actions/attributes.save_attribute_value

Girdi

AlanTürZorunluAçıklama
iduuidDoldurulduğu yer: adresteki {id} · Seçenek · kimliği: attribute_value
attributeIduuidevetÖzellik · kimliği: attribute
namestringevetAd · en çok 250
valuestringRenk · #RRGGBB veya #RRGGBBAA — yalnızca renk örnekleri için. · en çok 9
fileIduuidResim · kimliği: file

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe 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_nameSeçeneğin bir adı olmalı.
swatch_only_fieldYalnızca renk örneği seçeneği bir renk veya görsel taşır.
invalid_swatchRenk örneği tek bir geçerli renk ya da tek bir görseldir.
value_name_takenSeç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"}'
Yanıt
{
  "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"
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/product_types/{id}/actions/save_product_type
API anahtarı ya da OAuth token · attributes:manage
  • REST kısayolu: PATCH /api/v1/product_types/{id}
  • Asıl adres: POST /api/v1/actions/attributes.save_product_type

Girdi

AlanTürZorunluAçıklama
iduuidDoldurulduğu yer: adresteki {id} · Ürün türü · kimliği: product_type
namestringevetAd · en çok 250
slugstringAdres · en çok 255
kindstring (enum)Tür · İzin verilen değerler: normal, gift_card
isShippingRequiredbooleanGönderilir
weightGramsnumberAğırlık (gram) · en az 0
taxClassIduuidVergi sınıfı

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
invalid_nameAd kullanılabilir bir adres üretmeli.
slug_takenAdres bu çalışma alanında boşta olmalı.
not_foundDüzenlenen tip bulunmalı.
product_type_in_useBu 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"}'
Yanıt
{
  "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"
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/product_attribute_values/actions/set_item_attributes
API anahtarı ya da OAuth token · attributes:write
  • Asıl adres: POST /api/v1/actions/attributes.set_item_attributes

Girdi

AlanTürZorunluAçıklama
itemIduuidevetKalem · kimliği: item
valuesobject / arrayevetDeğerler

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
item_not_foundÜrün bulunmalı.
item_has_no_typeÜrünün bir ürün tipi olmalı.
attribute_not_on_typeHer özellik bu seviyede tipte olmalı.
attribute_value_invalidDeğer, özelliğinin türüne ve seçeneklerine uymalı.
attribute_value_requiredZorunlu ö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":{}}'
Yanıt
{
  "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":{}}'
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/attribute_item_options/actions/set_item_type
API anahtarı ya da OAuth token · attributes:write
  • Asıl adres: POST /api/v1/actions/attributes.set_item_type

Girdi

AlanTürZorunluAçıklama
itemIduuidevetKalem · kimliği: item
productTypeIduuidevetÜrün türü · kimliği: product_type

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
item_not_foundÜrün bulunmalı.
not_foundTip bulunmalı.
item_type_lockedBir ürünün tipi bir kez seçilir.
type_does_not_fit_itemKargo 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"}'
Yanıt
{
  "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"
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/attribute_item_options/actions/set_variant_attributes
API anahtarı ya da OAuth token · attributes:write
  • Asıl adres: POST /api/v1/actions/attributes.set_variant_attributes

Girdi

AlanTürZorunluAçıklama
itemVariantIduuidevetVaryant · kimliği: item_variant
valuesobject / arrayevetDeğerler

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
variant_not_foundVaryant bulunmalı.
item_has_no_typeÜrünün bir ürün tipi olmalı.
attribute_not_on_typeHer özellik bu seviyede tipte olmalı.
attribute_value_invalidDeğer, özelliğinin türüne ve seçeneklerine uymalı.
attribute_value_requiredZorunlu ö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":{}}'
Yanıt
{
  "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":{}}'
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/product_type_attributes/actions/unassign_attribute
API anahtarı ya da OAuth token · attributes:manage
  • Asıl adres: POST /api/v1/actions/attributes.unassign_attribute

Girdi

AlanTürZorunluAçıklama
productTypeIduuidevetÜrün türü · kimliği: product_type
attributeIduuidevetÖzellik · kimliği: attribute

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
not_foundTip 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"}'
Yanıt
{
  "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"
tools/call
{
  "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

POSThttps://app.getera.io/api/v1/attribute_item_options/actions/update_assignment
API anahtarı ya da OAuth token · attributes:manage
  • Asıl adres: POST /api/v1/actions/attributes.update_assignment

Girdi

AlanTürZorunluAçıklama
productTypeIduuidevetÜrün türü · kimliği: product_type
attributeIduuidevetÖzellik · kimliği: attribute
variantSelectionbooleanevetVaryant seçiciyi belirler

Ön koşullar

Koşul tutmazsa işlem 409 ve şu kodlardan biriyle reddedilir:

KodNe zaman reddedilir
not_foundTip ve özellik bulunmalı.
attribute_not_on_typeTipin bir varyant özelliği olmalı.
variant_selection_not_allowedSeç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}'
Yanıt
{
  "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
tools/call
{
  "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_options
  • GET /api/v1/attribute_item_options/{id}
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
item_idstring (uuid) · uuiditem
attribute_idstring (uuid) · uuidattribute
item_option_idstring (uuid) · uuiditem_option
created_atstring (date-time) · timestamptz

Birincil anahtar: id

Tekil: item_id, attribute_id · item_option_id

AttributeValue

Tablo attribute_value · Kaynak attribute_values

SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
attribute_idstring (uuid) · uuidattribute
namestring · text
slugstring · text
valuestring · text
file_idstring (uuid) · uuidevetfile
sort_orderinteger · int4
external_referencestring · textevet
created_atstring (date-time) · timestamptz

Birincil anahtar: id

Tekil: attribute_id, slug

Denetimler:

  • CHECK (((value = ''::text) OR (file_id IS NULL)))

Attribute

Tablo attribute · Kaynak attributes

SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
namestring · text
slugstring · text
input_typestring · textdropdown, multiselect, file, reference, single-reference, numeric, rich-text, plain-text, swatch, boolean, date, date-time
entity_typestring · textevetProduct, ProductVariant, Category
unitstring · textevetmm, 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_requiredboolean · bool
is_variant_onlyboolean · bool
visible_in_storefrontboolean · bool
filterable_in_storefrontboolean · bool
filterable_in_dashboardboolean · bool
storefront_search_positioninteger · int4
available_in_gridboolean · bool
external_referencestring · textevet
metadataobject · jsonb
created_atstring (date-time) · timestamptz
updated_atstring (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_values
  • GET /api/v1/product_attribute_values/{id}
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
item_idstring (uuid) · uuiditem
attribute_idstring (uuid) · uuidattribute
value_idstring (uuid) · uuidevetattribute_value
text_valuestring · textevet
numeric_valuenumber · float8evet
boolean_valueboolean · boolevet
date_valuestring (date-time) · timestamptzevet
file_idstring (uuid) · uuidevetfile
reference_item_idstring (uuid) · uuidevetitem
reference_variant_idstring (uuid) · uuidevetitem_variant
reference_category_idstring (uuid) · uuidevetitem_category
sort_orderinteger · int4
created_atstring (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_attributes
  • GET /api/v1/product_type_attributes/{id}
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
product_type_idstring (uuid) · uuidproduct_type
attribute_idstring (uuid) · uuidattribute
levelstring · textproduct, variant
variant_selectionboolean · bool
sort_orderinteger · 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_links
  • GET /api/v1/product_type_links/{id}
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
item_idstring (uuid) · uuiditem
product_type_idstring (uuid) · uuidproduct_type
created_atstring (date-time) · timestamptz

Birincil anahtar: id

Tekil: item_id

ProductType

Tablo product_type · Kaynak product_types

SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
namestring · text
slugstring · text
kindstring · textnormal, gift_card
is_shipping_requiredboolean · bool
weight_gramsstring (int64) · int8
tax_class_idstring (uuid) · uuidevet
metadataobject · jsonb
created_atstring (date-time) · timestamptz
updated_atstring (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_values
  • GET /api/v1/variant_attribute_values/{id}
SütunTürBoş olabilirİzin verilen değerlerBağlı olduğu tablo
idstring (uuid) · uuid
organization_idstring (uuid) · uuidorganization
workspace_idstring (uuid) · uuidworkspace
item_variant_idstring (uuid) · uuiditem_variant
attribute_idstring (uuid) · uuidattribute
value_idstring (uuid) · uuidevetattribute_value
text_valuestring · textevet
numeric_valuenumber · float8evet
boolean_valueboolean · boolevet
date_valuestring (date-time) · timestamptzevet
file_idstring (uuid) · uuidevetfile
reference_item_idstring (uuid) · uuidevetitem
reference_variant_idstring (uuid) · uuidevetitem_variant
reference_category_idstring (uuid) · uuidevetitem_category
sort_orderinteger · int4
created_atstring (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.

OlayNe olurTaşıdığı alanlar
attributes.attribute_deletedBir özellik kaldırıldı.id
attributes.attribute_savedBir özellik oluşturuldu ya da düzenlendi.id, slug, inputType
attributes.attribute_values_changedBir özelliğin seçenekleri değişti.attributeId
attributes.item_attributes_changedBir ürünün özellik değerleri değişti.itemId, count
attributes.item_type_setBir ürüne ürün türü verildi.itemId, productTypeId
attributes.product_type_deletedBir ürün türü kaldırıldı.id
attributes.product_type_savedBir ürün türü oluşturuldu ya da düzenlendi.id, slug
attributes.type_attributes_changedBir türün özellik kümesi değişti.productTypeId, count
attributes.variant_attributes_changedBir varyantın özellik değerleri değişti.itemVariantId, itemId, count
attributes.variant_axes_syncedSeçici özellikleri katalog varyant eksenlerine eşlendi.count, itemId
Bu sayfa yardımcı oldu mu?