REST API v1
StableOrganik Pazar platformu ile entegre olmak için REST API'mizi kullanın. JSON formatında istek ve yanıt.
Base URL:
https://demo2.bulvaronline.com.tr/public/api/v1/Auth: Bearer Token
Format: JSON
Rate Limit: 1000/saat
API anahtarı almak için Cüzdanım sayfasına gidin.
İçindekiler
Kimlik Doğrulama
Tüm istekler Authorization: Bearer {api_key} header'ı gerektirir. API key'inizi müşteri panelindeki Cüzdanım sayfasından alabilirsiniz.
curl -X GET https://demo2.bulvaronline.com.tr/public/api/v1/?resource=products \
-H "Authorization: Bearer tpk_xxxxxxxxxxxxxxxx"
Ürünler (products)
GET
/products
Ürün listesi
200
Params: page: Sayfa (default: 1), per_page: Sayfa başına (max: 100, default: 20), category: Kategori slug, search: Arama terimi
Response: data: Product[], pagination: {page, per_page, total, total_pages}
GET
/products&id={id}
Ürün detayı
200
Params: id: Ürün ID
Response: product: Product (organic_info dahil)
POST
/products
Yeni ürün (yalnızca admin)
201
Params: name*: Ürün adı, price*: Fiyat, stock: Stok, category_id: Kategori, brand_id: Marka, description: Açıklama, image: Görsel URL
Response: id, slug
PUT
/products&id={id}
Ürün güncelle
200
Params: 0: name, 1: price, 2: stock, 3: description, 4: image
Response: success: true
DELETE
/products&id={id}
Ürün sil
204
Response: (boş yanıt)
PATCH
/products&id={id}&field=stock
Stok güncelle
200
Params: stock: Yeni stok
Response: stock
PATCH
/products&id={id}&field=price
Fiyat güncelle
200
Params: price: Yeni fiyat, old_price: Eski fiyat (opsiyonel)
Response: price
Örnek: Ürün Oluştur
curl -X POST "https://demo2.bulvaronline.com.tr/public/api/v1/?resource=products" \
-H "Authorization: Bearer tpk_xxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Organik Bal 450g",
"price": 189.90,
"stock": 50,
"category_id": 4,
"brand_id": 1,
"description": "Saf organik çiçek balı",
"image": "https://..."
}'
# Yanıt:
{ "success": true, "id": 42, "slug": "organik-bal-450g-abc123" }
Siparişler (orders)
GET
/orders
Sipariş listesi (kullanıcının kendi siparişleri)
GET
/orders&id={id}
Sipariş detayı (items dahil)
POST
/orders&id={id}&action=status
Body: { "status": "shipped", "tracking_no": "YK123", "cargo_company": "yurtici" }
Kategoriler & Markalar
GET
/categories — Tüm kategoriler (ağaç yapısı)
GET
/brands — Tüm markalar
POST
/categories — Yeni kategori (yalnızca admin)
POST
/brands — Yeni marka (yalnızca admin)
Webhook
Dış sistem entegrasyonu için otomatik sipariş aktarımı webhook'u. Yeni sipariş geldiğinde bu URL'ye POST isteği gönderilir.
POST https://demo2.bulvaronline.com.tr/public/api/v1/?resource=webhook&action=order
# Payload:
{
"event": "new_order",
"order_id": 12345,
"order_no": "OP260620ABC123",
"items": [...],
"total": 2224.50
}
Kargo Entegrasyonları
5 kargo firması entegre. API credentials ayarlandığında gerçek API çağrıları yapılır.
🚚
Yurtiçi
API Ready
🚚
Aras
API Ready
🚚
MNG
API Ready
🚚
PTT
API Ready
🚚
Sürat
API Ready
Ödeme Entegrasyonları
Iyzico - 3D Secure, Taksit, İade
PayTR - Iframe, Taksit, İade
Param POS - 3D Secure, Taksit
Havale/EFT - 3 banka hesabı
Kapıda Ödeme - +15₺ COD ücreti
Cüzdan - Bakiye ile ödeme
Hata Kodları
| HTTP Kod | Anlamı |
|---|---|
| 200 | Başarılı |
| 201 | Oluşturuldu (POST başarılı) |
| 204 | İçerik yok (DELETE başarılı) |
| 400 | Geçersiz istek |
| 401 | Yetkisiz (API key gerekli/hatalı) |
| 403 | Yasaklı (yetki yetersiz) |
| 404 | Bulunamadı |
| 429 | Rate limit aşıldı |
| 500 | Sunucu hatası |
SDK Örnekleri
PHP
$ch = curl_init("https://demo2.bulvaronline.com.tr/public/api/v1/?resource=products");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer tpk_xxx",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch), true);
Python
import requests
r = requests.get("https://demo2.bulvaronline.com.tr/public/api/v1/?resource=products",
headers={"Authorization": "Bearer tpk_xxx"})
print(r.json())
JavaScript (fetch)
fetch("https://demo2.bulvaronline.com.tr/public/api/v1/?resource=products", {
headers: { "Authorization": "Bearer tpk_xxx" }
}).then(r => r.json()).then(console.log)