List Orders
Returns orders for your store. Date range and status filters can be applied.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number |
status | string | No | pending, shipped, delivered, cancelled |
date_from | string | No | Start date (YYYY-MM-DD) |
date_to | string | No | End date (YYYY-MM-DD) |
PHP
<?php
$baseUrl = 'https://example.com/api/v1/';
$apiKey = ''; // You need to obtain a token from the admin for the API Key.
$result = '';
function apiRequest($method, $url, $apiKey, $data = null)
{
$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 => false,
]);
if ($data !== null) {
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_UNICODE));
}
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);
return [
'http_code' => $httpCode,
'curl_error' => $error,
'response' => json_decode($response, true) ?: $response,
];
}
$result = apiRequest('GET', $baseUrl . '/orders?page=0&size=20', $apiKey);
Sample Response (JSON)
Array
(
[http_code] => 200
[curl_error] =>
[response] => Array
(
[totalElements] => 1
[totalPages] => 1
[page] => 0
[size] => 20
[content] => Array
(
[0] => Array
(
[id] => 1
[orderNumber] => FS260621361B
[shipmentAddress] => Array
(
[id] => 1
[firstName] => Ramazan
[lastName] => Benek
[company] => Frisay
[address1] => Edremit havaalanı kavşağı no:12/2
[address2] =>
[city] => Van
[district] => Edremit
[phone] => 05001234567
[fullAddress] => Van / Edremit — Edremit havaalanı kavşağı no:12/2
[fullName] => Ramazan Benek
[countryCode] => TR
)
[invoiceAddress] => Array
(
[id] => 1
[firstName] => Ramazan
[lastName] => Benek
[company] => Frşisay
[address1] => Edremit havaalanı kavşağı no:12/2
[address2] =>
[city] => Van
[district] => Edremit
[phone] => 05001234567
[fullAddress] => Van / Edremit — Edremit havaalanı kavşağı no:12/2
[fullName] => Ramazan Benek
[countryCode] => TR
[taxOffice] => Kalekapı
[taxNumber] => 1234567899
)
[customerFirstName] => Ramazan
[customerLastName] => Benek
[customerEmail] => admin@frisay.com
[customerId] => 2
[customerPhone] => 05001234567
[packageGrossAmount] => 329
[packageSellerDiscount] => 0
[packageTotalDiscount] => 0
[packageShipping] => 79.9
[packageTotalPrice] => 408.9
[couponCode] =>
[paymentMethod] => bank_transfer
[paymentLabel] => Havale / EFT
[lines] => Array
(
[0] => Array
(
[quantity] => 1
[stockCode] => DEMO-MULTI60
[productName] => Multivitamin Complex 60 Tablet
[contentId] => 5
[lineGrossAmount] => 329
[lineTotalDiscount] => 0
[lineSellerDiscount] => 0
[lineUnitPrice] => 329
[lineId] => 1
[vatRate] => 10
[barcode] => 8690000000059
[orderLineItemStatusName] => AwaitingPayment
[currencyCode] => TRY
[lineAmount] => 329
)
)
[orderDate] => 1782045422000
[identityNumber] => 1234567899
[taxNumber] => 1234567899
[currencyCode] => TRY
[shipmentPackageStatus] => AwaitingPayment
[status] => AwaitingPayment
[statusCode] => 1
[statusLabel] => Ödeme Bekliyor
[cargoCompany] =>
[trackingNumber] =>
[commercial] => 1
[note] => Komşuma bırakılabilir
)
)
)
)