Partner API v1

Siparişleri Listele

Bu endpoint, yetkili partner uygulamasının bağlı olduğu satıcının siparişlerini ERP, muhasebe, depo, stok ve operasyon sistemlerine aktarmak için kullanılır.

GET /orders.php
Authentication HMAC SHA256 required
Scope Seller scoped
Permission orders:read

Overview

Sipariş listesi seller scope ile çalışır. Partner uygulaması hangi satıcıya kuruluysa sadece o satıcının siparişlerini görebilir. Client ID ve Client Secret BaZaaRDan tarafından onaylı entegratöre verilir.

Bu endpoint frontend, mobil uygulama veya tarayıcı içinde doğrudan kullanılmamalıdır. Client Secret sadece entegratörün backend sunucusunda saklanmalıdır.

Base URL

Environment
Production:
https://bazaardan.com/api/partner/v1

Endpoint:
GET /orders.php

Required Headers

Header Required Description
X-BZ-CLIENT-ID Yes Partner uygulaması için üretilen Client ID.
X-BZ-TIMESTAMP Yes Unix timestamp. İmza üretiminde kullanılır.
X-BZ-SIGNATURE Yes Client Secret ile üretilen HMAC SHA256 imzası.
Accept Recommended application/json

Signature Base String

HMAC Base String
METHOD + "
" + PATH + "
" + TIMESTAMP + "
" + RAW_BODY

GET isteklerinde RAW_BODY boş string olmalıdır. PATH query string dahil endpoint path bilgisidir.

Query Parameters

Parameter Type Required Description
limit integer No Dönecek kayıt sayısı. Önerilen: 50, maksimum: 100.
offset integer No Sayfalama başlangıç değeri. İlk sayfa için 0.
status string No Sipariş durumuna göre filtreleme.
updated_after datetime No Belirli tarihten sonra güncellenen siparişleri döndürür.

Example Request

cURL
curl -X GET "https://bazaardan.com/api/partner/v1/orders.php?limit=50&offset=0&status=accepted" \
  -H "Accept: application/json" \
  -H "X-BZ-CLIENT-ID: YOUR_CLIENT_ID" \
  -H "X-BZ-TIMESTAMP: 1778269200" \
  -H "X-BZ-SIGNATURE: GENERATED_HMAC_SIGNATURE"

Example Response

JSON
{
  "ok": true,
  "data": {
    "orders": [
      {
        "order_item_id": 1024,
        "order_no": "BD-202605080001",
        "status": "accepted",
        "payment_status": "paid",
        "currency": "TRY",
        "unit_price": 1499.90,
        "quantity": 1,
        "created_at": "2026-05-08 18:30:00",
        "updated_at": "2026-05-08 18:45:00",
        "product": {
          "product_id": 356,
          "title": "Örnek Ürün",
          "sku": "SKU-001"
        },
        "customer": {
          "city": "İstanbul",
          "district": "Kadıköy"
        }
      }
    ],
    "pagination": {
      "limit": 50,
      "offset": 0,
      "returned": 1,
      "has_more": false
    }
  }
}

PHP Example

PHP
<?php

$clientId = 'YOUR_CLIENT_ID';
$clientSecret = 'YOUR_CLIENT_SECRET';

$method = 'GET';
$path = '/orders.php?limit=50&offset=0&status=accepted';
$timestamp = (string) time();
$body = '';

$baseString = strtoupper($method) . "\n" . $path . "\n" . $timestamp . "\n" . $body;
$signature = hash_hmac('sha256', $baseString, $clientSecret);

$ch = curl_init('https://bazaardan.com/api/partner/v1' . $path);

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Accept: application/json',
        'X-BZ-CLIENT-ID: ' . $clientId,
        'X-BZ-TIMESTAMP: ' . $timestamp,
        'X-BZ-SIGNATURE: ' . $signature,
    ],
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo $httpCode . PHP_EOL;
echo $response . PHP_EOL;

Node.js Example

Node.js
import crypto from "node:crypto";

const clientId = "YOUR_CLIENT_ID";
const clientSecret = "YOUR_CLIENT_SECRET";

const method = "GET";
const path = "/orders.php?limit=50&offset=0&status=accepted";
const timestamp = Math.floor(Date.now() / 1000).toString();
const body = "";

const baseString = [
  method.toUpperCase(),
  path,
  timestamp,
  body
].join("\n");

const signature = crypto
  .createHmac("sha256", clientSecret)
  .update(baseString)
  .digest("hex");

const response = await fetch(`https://bazaardan.com/api/partner/v1${path}`, {
  method,
  headers: {
    "Accept": "application/json",
    "X-BZ-CLIENT-ID": clientId,
    "X-BZ-TIMESTAMP": timestamp,
    "X-BZ-SIGNATURE": signature
  }
});

console.log(response.status);
console.log(await response.json());

Python Example

Python
import time
import hmac
import hashlib
import requests

client_id = "YOUR_CLIENT_ID"
client_secret = "YOUR_CLIENT_SECRET"

method = "GET"
path = "/orders.php?limit=50&offset=0&status=accepted"
timestamp = str(int(time.time()))
body = ""

base_string = "\n".join([
    method.upper(),
    path,
    timestamp,
    body,
])

signature = hmac.new(
    client_secret.encode("utf-8"),
    base_string.encode("utf-8"),
    hashlib.sha256
).hexdigest()

response = requests.get(
    "https://bazaardan.com/api/partner/v1" + path,
    headers={
        "Accept": "application/json",
        "X-BZ-CLIENT-ID": client_id,
        "X-BZ-TIMESTAMP": timestamp,
        "X-BZ-SIGNATURE": signature,
    },
    timeout=30,
)

print(response.status_code)
print(response.json())

Related Endpoints

Sipariş listesinden dönen order_item_id ile detay almak için GET /order_detail.php?order_item_id={order_item_id} endpointini kullanın.

Stok güncellemesi için POST /stock_update.php endpointini kullanın.