Ürünler
read_products, oluşturma ve güncelleme write_products, silme delete_products. Fiyat alanları ayrıca write_product_prices, stok alanları write_inventory ister (Alan kapsamları). Hata gövdeleri için Hatalar, sayfalama ve filtre söz dizimi için Sorgu Parametreleri.| Uç | Metot | Kapsam |
|---|---|---|
catalog/products | GET | read_products |
catalog/products | POST | write_products |
catalog/products/{id} | GET | read_products |
catalog/products/{id} | PATCH | write_products |
catalog/products/{id} | DELETE | delete_products |
catalog/variants | GET, POST | read_products / write_products |
catalog/variants/{id} | GET, PATCH, DELETE | read_products / write_products |
Ürünleri listeleme
curl 'https://magaza.com/api/v3/admin/2026-01/catalog/products?filter[inStock]=true&sort=-createdAt&page[size]=50' \
-H 'Authorization: Bearer <access_token>' \
-H 'Accept: application/vnd.api+json'
Tek ürün için GET /catalog/products/{id}.
Alanlar
| Alan | Tür | Açıklama |
|---|---|---|
name | string | Ürün adı |
slug | string | Vitrin adresindeki kısa ad |
catalogCode | string | Katalog kodu (aynı ürünün renk/beden gibi kopyalarını gruplar) |
barcode | string | Barkod |
mpn | string | Üretici parça numarası |
seoTitle, seoDescription, searchKeywords | string | SEO ve arama alanları |
categoryId | integer | Ana kategori |
categoryPath, categoryName | string | Ana kategorinin yolu ve adı |
brandId, brand | integer, string | Marka |
modelId, model | integer, string | Model |
stockUnitId | integer | Stok birimi |
price | number | Satış fiyatı |
discountPrice | number | İndirimli fiyat |
purchasePrice | number | Alış fiyatı |
taxRate | number | KDV oranı |
isTaxIncluded | boolean | Fiyatlar KDV dahil mi |
currencyId | integer | Para birimi |
stock | number | Toplam stok |
visibility | integer | Vitrinde görünürlük |
freeShipping, isNew, isBestseller, isFeatured | boolean | Ürün bayrakları |
isCatalogDefault | boolean | Katalog kodu grubunun varsayılan ürünü |
hasImage | boolean | Görseli var mı |
createdAt | datetime | Oluşturulma zamanı |
İlişkiler: category, currency, images (?include=images).
Filtreler
| Filtre | Örnek |
|---|---|
id | filter[id]=12,15,18 |
search | filter[search]=cüzdan (ad, id, entegrasyon kodu, barkod, tedarikçi kodu, katalog kodu ve MPN'de arar; filter[searchFields]=barcode ile daraltılır) |
categoryId | filter[categoryId]=42 |
brandId | filter[brandId]=3,7 |
inStock | filter[inStock]=true |
rangeBetween.price | filter[rangeBetween.price]=100,500 |
rangeBetween.stock | filter[rangeBetween.stock]=,5 (stoğu 5 ve altı) |
rangeBetween.createdAt | filter[rangeBetween.createdAt]=2026-10-01,2026-10-31 |
hasImage, isNew, isFeatured, hasSubProduct | filter[hasSubProduct]=true |
Sıralama: price, discountPrice, stock, createdAt, id.
Ürün oluşturma
curl -X POST 'https://magaza.com/api/v3/admin/2026-01/catalog/products' \
-H 'Authorization: Bearer <access_token>' \
-H 'Accept: application/vnd.api+json' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "products",
"attributes": {
"name": "Klasik Deri Cüzdan",
"categoryId": 352,
"brandId": 3,
"barcode": "8690000000017",
"price": 749.90,
"taxRate": 20,
"isTaxIncluded": true,
"stock": 25
}
}
}'
name ve categoryId zorunludur. categoryId alt kategorisi olmayan (yaprak) bir kategori olmalıdır (Kategori ağacı). Yanıt 201 ile oluşan ürünü döner.
Yazılabilen alanlar: name, slug, catalogCode, barcode, seoTitle, seoDescription, searchKeywords, categoryId, brandId, modelId, modelIds, stockUnitId, price, discountPrice, taxRate, isTaxIncluded, stock, visibility (0/1), freeShipping, isNew, isBestseller, isFeatured, isCatalogDefault. Mağazada barkod tekilliği açıksa aynı barkodla ikinci ürün 422 döner.
Görsel eklemek için Ürün görselleri, seçenekli ürün için Varyantlar.
Ürün güncelleme
curl -X PATCH 'https://magaza.com/api/v3/admin/2026-01/catalog/products/45789' \
-H 'Authorization: Bearer <access_token>' \
-H 'Accept: application/vnd.api+json' \
-H 'Content-Type: application/vnd.api+json' \
-d '{"data": {"type": "products", "id": "45789", "attributes": {"seoTitle": "Klasik Deri Cüzdan | Mağaza", "visibility": 1}}}'
Yalnız gönderdiğiniz alanlar doğrulanır ve yazılır; göndermediğiniz alanlar değişmez.
Ürün silme
DELETE /catalog/products/{id}, delete_products kapsamıyla 204 döner. Bu kapsam onay ekranında hassas olarak işaretlenir; ürünü yalnız vitrinden kaldırmak için silmek yerine visibility: 0 yazın.
Alan kapsamları
Fiyat ve stok alanları write_products'a ek kapsam ister. Bu alanlardan birini içeren istek, gerekli kapsam yoksa bütünüyle 403 döner; detail alanı eksik izni yazar ("Fiyat Güncelle", "Stok Güncelle"). Oluşturma isteği için de aynı kural geçerlidir.
| Alanlar | Ek kapsam |
|---|---|
Ürün: price, discountPrice, taxRate; varyant: salePrice, salePriceDiscount, purchasePrice, vendorSalePrice, vendorDiscount | write_product_prices |
Ürün: stock; varyant: stock, stockNumber2 … stockNumber99, stockTemp | write_inventory |
Depo bazında stok için Stok uçlarını kullanın; stock alanı ana deponun miktarıdır.
Varyantlar
Renk, beden gibi seçenekleri olan ürünlerin her seçeneği bir varyanttır.
curl 'https://magaza.com/api/v3/admin/2026-01/catalog/variants?filter[productId]=45789' \
-H 'Authorization: Bearer <access_token>' \
-H 'Accept: application/vnd.api+json'
| Alan | Açıklama |
|---|---|
productId | Ana ürün |
typeName1, typeName2 | Seçenek değerleri (örn. Kırmızı, M) |
subProductCode | Varyant stok kodu |
wsSubProductCode | Entegrasyon (web servis) stok kodu |
productBarcode | Varyant barkodu |
stock | Stok |
salePrice, salePriceDiscount, purchasePrice | Fiyatlar |
weight, cbm | Ağırlık ve desi |
Filtreler: id, productId (virgülle birden fazla), subProductCode, wsSubProductCode, productBarcode. Bu dört metin filtresi kısmi eşleşir; tam eşleşme için exact. önekini kullanın (filter[exact.subProductCode]=CZD-01-KRM).
Varyant oluşturma ve güncelleme
curl -X POST 'https://magaza.com/api/v3/admin/2026-01/catalog/variants' \
-H 'Authorization: Bearer <access_token>' \
-H 'Accept: application/vnd.api+json' \
-H 'Content-Type: application/vnd.api+json' \
-d '{"data": {"type": "variants", "attributes": {"productId": 45789, "typeId1": 5, "typeId2": 12, "subProductCode": "CZD-01-KRM-M", "productBarcode": "8690000000024"}}}'
| Alan | Açıklama |
|---|---|
productId | Ana ürün; oluştururken zorunlu |
typeId1, typeId2 | Seçenek değerlerinin kimlikleri (Varyant grupları); en az biri zorunlu |
subProductCode, wsSubProductCode | Varyant stok kodu ve entegrasyon kodu; mağazada tekil |
productBarcode | Barkod |
stock, salePrice, salePriceDiscount, purchasePrice | Stok ve fiyatlar (Alan kapsamları) |
weight, cbm | Ağırlık ve desi |
isActive | Satışta mı |
customerMinOrderCount, customerMaxOrderCount | Müşteri başına en az / en çok adet |
Güncelleme PATCH /catalog/variants/{id}, silme DELETE /catalog/variants/{id} ile yapılır; ikisi de write_products ister.
Kategoriler
curl 'https://magaza.com/api/v3/admin/2026-01/catalog/categories?filter[rootOnly]=true' \
-H 'Authorization: Bearer <access_token>' \
-H 'Accept: application/vnd.api+json'
Başlıca alanlar: name, code, slug, parentId, listOrder, visibility. İlişkiler: parent, children. Filtreler: id, parentId, rootOnly, visible.
Markalar
curl 'https://magaza.com/api/v3/admin/2026-01/catalog/brands' \
-H 'Authorization: Bearer <access_token>' \
-H 'Accept: application/vnd.api+json'
Başlıca alanlar: name, isPassive, seoLink, seoTitle, listNo. Filtreler: id, name, isPassive.