API - Genel bakış

API - Siparişler

Müşteri siparişlerini alın, durumları ve miktarları güncelleyin, siparişleri silin.

Uç noktalara genel bakış

YöntemUç noktaAçıklamaErişim
GET/public-api/v1/customer-ordersSayfalanmış ve filtrelenebilir müşteri sipariş listesini döndürür.orders:read
GET/public-api/v1/customer-orders/:idYapılandırılmış ürün öğeleriyle tek müşteri siparişini döndürür.orders:read
POST/public-api/v1/customer-orders/batchKimliklere göre en fazla 100 sipariş döndürür.orders:read
PATCH/public-api/v1/customer-orders/:id/statusSipariş durumunu günceller.orders:write
PATCH/public-api/v1/customer-orders/:orderId/quantitySeçili sipariş ayrıntılarının miktarlarını günceller.orders:write
PATCH/public-api/v1/customer-orders/:orderId/quantity/allSiparişteki tüm öğelere tek bir miktar atar.orders:write
DELETE/public-api/v1/customer-orders/:idMağaza sahibine ait müşteri siparişini siler.orders:write

Müşteri siparişleri

Müşteri siparişi uç noktaları, dış mağazanın yapılandırılmış satırları okumasını, miktarları güncellemesini, siparişi karşılama durumları arasında ilerletmesini ve terk edilmiş siparişleri kaldırmasını sağlar.

ParametreGerekliAyrıntılar
namehayırTasarım adı ve sayısal sipariş kimliğinde arama yapar.
category_idhayırÜrün kategorisi kimliğine göre filtreler.
order_statushayırİzin verilen sipariş durumlarından biri.
offsethayırVarsayılan 0. >= 0 olmalıdır.
limithayırBu denetleyici için varsayılan 9, en fazla 50.
order_byhayırid, created_at veya design_name.
directionhayırASC veya DESC.

Örnek istek (fetch)

const params = new URLSearchParams({
  limit: '20',
  offset: '0',
  order_status: 'shopping_cart',
  order_by: 'created_at',
  direction: 'DESC'
});

const orders = await alterFetch(`/customer-orders?${params.toString()}`);

const order = await alterFetch('/customer-orders/123');

const batch = await alterFetch('/customer-orders/batch', {
  method: 'POST',
  body: JSON.stringify({
    customerOrderIds: [123, 124, 125]
  })
});

İzin verilen değerler

DurumAçıklama
shopping_cartSepet akışı; müşteri yapılandırmayı hâlâ düzenleyebilir.
editableSipariş müşteri tarafından düzenlenebilir durumda kalır.
paidSipariş ödendi ve hazırlanmaya hazır.
processingSipariş hazırlanıyor.
completedSipariş tamamlandı.
cancelledSipariş iptal edildi.

Örnek istek (fetch)

await alterFetch('/customer-orders/123/status', {
  method: 'PATCH',
  body: JSON.stringify({
    status: 'processing'
  })
});

await alterFetch('/customer-orders/123/quantity', {
  method: 'PATCH',
  body: JSON.stringify({
    items: [
      { orderDetailId: 987, quantity: 3 }
    ]
  })
});

await alterFetch('/customer-orders/123/quantity/all', {
  method: 'PATCH',
  body: JSON.stringify({
    quantity: 2
  })
});

await alterFetch('/customer-orders/123', {
  method: 'DELETE'
});

Örnek yanıt

{
  "order": {
    "id": 123,
    "customizerId": 381,
    "orderStatus": "shopping_cart",
    "createdAt": "2026-05-28T10:15:00.000Z",
    "customizerOrderURL": "https://alterproduct.com/app/customizer/381/123",
    "productItems": [
      {
        "id": 987,
        "model3d": { "id": 381 },
        "size": {
          "id": 395,
          "name": { "pl": "M", "en": "M" },
          "measureSize": null
        },
        "material": {
          "id": 2,
          "name": { "pl": "Bawełna", "en": "Cotton" }
        },
        "printType": {
          "id": 1,
          "name": { "pl": "DTG", "en": "DTG" }
        },
        "color": {
          "id": 418,
          "name": { "pl": "Domyślny", "en": "Default" },
          "hex": "#ffffff"
        },
        "variant": {
          "id": 531,
          "metadata": null,
          "stockQuantity": 25
        },
        "unitPrice": { "value": 12.5, "currency": "EUR" },
        "totalPrice": { "value": 37.5, "currency": "EUR" },
        "quantity": 3
      }
    ],
    "customizerName": "Men's T-Shirt",
    "productGroup": {
      "id": 4,
      "name": { "pl": "Koszulka", "en": "T-Shirt" }
    },
    "totalPrice": { "value": 37.5, "currency": "EUR" }
  }
}