GET https://example.com/api/v1/orders

Siparişleri Listele

Siparişleri Trendyol benzeri bir yapıda döndürür: totalElements, content[], ayrıca shipmentAddress, invoiceAddress ve lines[].

Sayfa numaralandırması 0 tabanlıdır.

Durum Kodları

KodEtiketAPI status
1Ödeme BekliyorAwaitingPayment
2HazırlanıyorPicking
3KargodaShipped
4Teslim EdildiDelivered
5İptal EdildiCancelled

Query Parametreleri

ParametreTipZorunluAçıklama
pageintegerHayır0 tabanlı sayfa (varsayılan: 0)
size / limitintegerHayırSayfa boyutu (varsayılan: 30, en fazla: 100)
statusintegerHayır1–5, veya tümü için 0
date_fromstringHayırBaşlangıç tarihi (YYYY-MM-DD veya datetime)
date_tostringHayırBitiş tarihi
startDateintegerHayırUnix ms (Trendyol uyumlu)
endDateintegerHayırUnix ms
PHP
<?php

$baseUrl = 'https://example.com/api/v1';
$apiKey  = 'YOUR_API_KEY';

function apiRequest(string $method, string $url, string $apiKey, ?array $data = null): array
{
    $ch = curl_init();
    $headers = [
        'X-API-Key: ' . trim($apiKey),
        'Accept: application/json',
    ];
    if ($data !== null) {
        $headers[] = 'Content-Type: application/json';
    }
    curl_setopt_array($ch, [
        CURLOPT_URL => $url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_CUSTOMREQUEST => $method,
        CURLOPT_HTTPHEADER => $headers,
        CURLOPT_SSL_VERIFYPEER => true,
    ]);
    if ($data !== null) {
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_UNICODE));
    }
    $response = curl_exec($ch);
    $httpCode = (int) curl_getinfo($ch, CURLINFO_HTTP_CODE);
    $error = curl_error($ch);
    curl_close($ch);
    $decoded = json_decode((string) $response, true);
    return [
        'http_code' => $httpCode,
        'curl_error' => $error,
        'response' => is_array($decoded) ? $decoded : $response,
    ];
}

$result = apiRequest(
    'GET',
    $baseUrl . '/orders?page=0&size=20&status=2&date_from=2026-06-10&date_to=2026-07-30',
    $apiKey
);
print_r($result);
cURL
curl -s -H "X-API-Key: YOUR_API_KEY" \
  -H "Accept: application/json" \
  "https://example.com/api/v1/orders?page=0&size=20&status=2&date_from=2026-06-10&date_to=2026-07-30"
Örnek Yanıt (JSON)
{
  "totalElements": 1,
  "totalPages": 1,
  "page": 0,
  "size": 20,
  "content": [
    {
      "id": 15,
      "orderNumber": "FS-20260617-0015",
      "customerFirstName": "Ali",
      "customerLastName": "Yılmaz",
      "customerEmail": "ali@ornek.com",
      "customerPhone": "05551234567",
      "packageTotalPrice": 899.0,
      "paymentMethod": "bankwire",
      "paymentLabel": "Havale / EFT",
      "statusCode": 2,
      "status": "Picking",
      "statusLabel": "Hazırlanıyor",
      "cargoCompany": "",
      "trackingNumber": "",
      "commercial": false,
      "orderDate": 1718611200000,
      "invoice": null,
      "shipmentAddress": {
        "firstName": "Ali",
        "lastName": "Yılmaz",
        "city": "İstanbul",
        "district": "Kadıköy",
        "address1": "Moda Cad. No:5",
        "fullAddress": "İstanbul / Kadıköy — Moda Cad. No:5",
        "phone": "05551234567",
        "countryCode": "TR"
      },
      "lines": [
        {
          "lineId": 42,
          "contentId": 1,
          "productName": "SolNutrof Total 30 Kapsül",
          "quantity": 1,
          "stockCode": "SOLNUTROF30",
          "barcode": "8690000000011",
          "lineUnitPrice": 899.0,
          "lineAmount": 899.0,
          "vatRate": 20.0,
          "orderLineItemStatusName": "Picking"
        }
      ]
    }
  ]
}