Loyetta

Ürünler

Hediye Marketi, kullanıcıların sadakat puanlarını fiziksel ürünler ve dijital ödüller için kullanmalarını sağlar. Bu bölüm, ürünleri ve kategorileri listeleme endpoint'lerini kapsar.


Ürünleri Listele

Opsiyonel filtreleme ve sıralama ile mevcut mağaza ürünlerinin sayfalanmış listesini alın.

GET/v1/store/products

Query Parametreleri

ParametreTürAçıklama
page[number]integerSayfa numarası (varsayılan: 1)
page[size]integerSayfa başına öğe (varsayılan: 15)
filter[category]stringKategori ID'sine göre filtrele
filter[title]stringBaşlığa göre ürün ara
filter[minPrice]integerMinimum fiyat filtresi (puan cinsinden)
filter[maxPrice]integerMaksimum fiyat filtresi (puan cinsinden)
filter[newProducts]booleanSadece yeni ürünleri göster
filter[lowStock]booleanSadece düşük stoklu ürünleri göster
filter[onSale]booleanSadece indirimdeki ürünleri göster
filter[onlyPopular]booleanSadece popüler ürünleri göster
sortstringFiyata göre sırala: price (artan) veya -price (azalan)

Örnek İstek

bash
curl -X GET "https://marka.prod.loyetta.com/api/v1/store/products?filter[category]=1&filter[onSale]=true&sort=-price&page[number]=1&page[size]=10" \
  -H "Authorization: Bearer {musteri-tokeni}" \
  -H "Accept: application/json"

Yanıt

json
{
  "data": [
    {
      "id": "1a5c77ff",
      "title": "Kablosuz Kulaklık",
      "sku": "WH-001",
      "description": "<p>Gürültü engelleme özellikli premium kablosuz kulaklık.</p>",
      "regular_price": 5000,
      "sale_price": 4000,
      "thumbnail": "https://example.com/kulaklik.jpg",
      "gallery": [
        "https://example.com/kulaklik-1.jpg",
        "https://example.com/kulaklik-2.jpg"
      ]
    }
  ],
  "links": {
    "first": "https://marka.prod.loyetta.com/api/v1/store/products?page[number]=1",
    "last": "https://marka.prod.loyetta.com/api/v1/store/products?page[number]=5",
    "prev": null,
    "next": "https://marka.prod.loyetta.com/api/v1/store/products?page[number]=2"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 5,
    "path": "https://marka.prod.loyetta.com/api/v1/store/products",
    "per_page": 10,
    "to": 10,
    "total": 50
  }
}

Ürün Nesnesi

AlanTürAçıklama
idstringBenzersiz ürün tanımlayıcısı
titlestringÜrün adı
skustringStok takip kodu
descriptionstringHTML formatında ürün açıklaması
regular_priceintegerNormal fiyat (puan cinsinden)
sale_priceinteger | nullİndirimli fiyat (indirim yoksa null)
thumbnailstringÜrün küçük resmi URL'i
galleryarrayEk resim URL'leri dizisi

Ürün Detayı Getir

Belirli bir ürün hakkında detaylı bilgi alın.

GET/v1/store/products/{productId}

Path Parametreleri

ParametreTürZorunluAçıklama
productIdstringEvetGetirilecek ürünün ID'si

Örnek İstek

bash
curl -X GET "https://marka.prod.loyetta.com/api/v1/store/products/1a5c77ff" \
  -H "Authorization: Bearer {musteri-tokeni}" \
  -H "Accept: application/json"

Yanıt

json
{
  "success": true,
  "data": {
    "id": "1a5c77ff",
    "title": "Kablosuz Kulaklık",
    "sku": "WH-001",
    "description": "<p>Gürültü engelleme özellikli premium kablosuz kulaklık.</p>",
    "regular_price": 5000,
    "sale_price": 4000,
    "thumbnail": "https://example.com/kulaklik.jpg",
    "gallery": [
      "https://example.com/kulaklik-1.jpg",
      "https://example.com/kulaklik-2.jpg"
    ]
  }
}

Hata Yanıtı (404)

json
{
  "success": false,
  "message": "Product not found"
}

Kategorileri Listele

Tüm mağaza kategorilerini alın. Kategoriler alt kategorilerle iç içe olabilir.

GET/v1/store/categories

Query Parametreleri

ParametreTürAçıklama
filter[category]stringBelirli bir kategori ID'sinin alt kategorilerini getir

Örnek İstek

bash
curl -X GET "https://marka.prod.loyetta.com/api/v1/store/categories" \
  -H "Authorization: Bearer {musteri-tokeni}" \
  -H "Accept: application/json"

Yanıt

json
{
  "data": [
    {
      "id": "1",
      "label": "Elektronik",
      "children": [
        {
          "id": "2",
          "label": "Ses Sistemleri",
          "children": []
        },
        {
          "id": "3",
          "label": "Aksesuarlar",
          "children": []
        }
      ]
    },
    {
      "id": "4",
      "label": "Hediye Kartları",
      "children": []
    }
  ]
}

Kategori Nesnesi

AlanTürAçıklama
idstringBenzersiz kategori tanımlayıcısı
labelstringKategori görünen adı
childrenarrayİç içe alt kategoriler dizisi