T-SOFT/Storefront API/Siparişler

Siparişler

Bu kaynak, kimliği doğrulanmış müşterinin geçmiş siparişlerini döner. Sipariş listeleme ve tek sipariş görüntüleme desteklenir; kayıtlar salt okunurdur. Uç noktalar storefront/account/2026-01 önekindedir ve kimliği doğrulanmış müşteri token'ı gerektirir (yalnızca okuma token'ı yetmez). Ödeme adımı tamamlanmamış, sepet aşamasında kalmış siparişler listeye girmez; bu kayıtlara id ile yapılan istek de 404 döner.

Yetki:storefront:account — müşteri token'ı zorunlu.

Listeleme

GET /orders
curl -s 'https://<domain>/api/v3/storefront/account/2026-01/orders' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer <CUSTOMER_TOKEN>'

Varsayılan sıralama -orderDate (en yeni sipariş önce). Sayfa boyutu varsayılan 20, en fazla 100.

Örnek bir sipariş kaydı:

{
  "type": "orders",
  "id": "9012",
  "attributes": {
    "orderCode": "TS-2026-9012",
    "status": "Kargoya Verildi",
    "statusId": 4,
    "orderDate": 1767225600,
    "totalPrice": { "amount": "1499.90", "currencyCode": "TRY", "decimalPlaces": 2 },
    "cargoTrackingCode": "1234567890",
    "cargoCompany": "Yurtiçi Kargo",
    "cargoTrackingUrl": "https://kargo.example/takip/1234567890",
    "hasReturnRequest": false,
    "firstProductName": "Ahşap Sehpa",
    "firstProductImageUrl": "https://<domain>/Data/Urunler/sehpa.jpg",
    "productCount": 3,
    "paymentMethod": "Kredi Kartı",
    "installment": 3,
    "bank": "Örnek Bank",
    "coupon": "%10 WELCOME10",
    "subtotal": { "amount": "1200.00", "currencyCode": "TRY", "decimalPlaces": 2 },
    "shippingCost": { "amount": "50.00", "currencyCode": "TRY", "decimalPlaces": 2 },
    "discount": { "amount": "0.00", "currencyCode": "TRY", "decimalPlaces": 2 }
  }
}

Tek sipariş

GET /orders/{id}
curl -s 'https://<domain>/api/v3/storefront/account/2026-01/orders/9012' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer <CUSTOMER_TOKEN>'

Alanlar

AlanAçıklama
orderCodeSipariş kodu
statusSipariş durumu (görünen metin)
statusIdSipariş durum id'si
orderDateSipariş tarihi (Unix timestamp; create_date'e karşılık gelir)
totalPriceMoney nesnesi: { "amount", "currencyCode", "decimalPlaces" }
cargoTrackingCodeKargo takip kodu
cargoCompanyKargo firması adı
cargoTrackingUrlKargo takip bağlantısı
hasReturnRequestSiparişte iade talebi var mı?
firstProductNameListede özet için ilk ürünün adı
firstProductImageUrlİlk ürünün görsel URL'si
productCountSiparişteki ürün adedi
paymentMethodÖdeme yöntemi (görünen metin)
installmentTaksit sayısı (tek çekim ise 0)
bankÖdemenin geçtiği banka adı (bilinmiyorsa boş)
couponSiparişte kullanılan kupon (yoksa boş)
subtotalÜrünler ara toplamı — Money nesnesi
shippingCostKargo tutarı — Money nesnesi
discountToplam indirim tutarı — Money nesnesi

Filtreler

FiltreÖrnekDavranış
filter[id]filter[id]=9012,9013Virgülle ayrılmış sipariş id'leri
filter[status]filter[status]=5,6Sipariş durum kodu veya virgülle ayrılmış liste. Sayı olmayan değer verilirse liste boş döner
filter[orderDateFrom]filter[orderDateFrom]=2025-01-01Bu tarihten itibaren verilen siparişler. Tarih metni veya epoch saniye kabul edilir
filter[orderDateTo]filter[orderDateTo]=2025-12-31Bu tarihe kadar verilen siparişler. Tarih metni veya epoch saniye kabul edilir

Sıralama

SortAnlamı
orderDateSipariş tarihine göre (varsayılan -orderDate)

İlişkiler

Sipariş ürünlerini, teslimat/fatura adresini ve iade taleplerini tek istekte almak için include kullan:

GET /orders/{id}?include=...
curl -s 'https://<domain>/api/v3/storefront/account/2026-01/orders/9012?include=products,deliveryAddress,invoiceAddress,returns' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer <CUSTOMER_TOKEN>'
İlişkiTipAnlamı
productsorder-productsSiparişteki ürün satırları (hasMany)
deliveryAddressorder-addressesTeslimat adresi (hasOne)
invoiceAddressorder-addressesFatura adresi (hasOne)
returnsorder-returnsSiparişe bağlı iade talepleri (hasMany)
Bu kaynakta include derinliği maxDepth=2 ile sınırlıdır; iç içe iki seviyeden derin ilişki zinciri çekmeye çalışma.