REST API v1
Kurumsal sistemlerinizden sipariş oluşturma, takip ve raporlama için JSON REST API.
Tüm korumalı uçlara istek atarken API anahtarınızı şu başlıkla gönderin:
Authorization: Bearer <API_ANAHTARI>
Anahtarları kurumsal panelden oluşturabilirsiniz. Test ve canlı anahtarlar ayrıdır; test anahtarıyla oluşturulan siparişler canlı kurye havuzuna düşmez.
| Method | Path | Açıklama |
|---|---|---|
| GET | /api/v1/health | Sağlık kontrolü (kimlik doğrulama gerekmez) |
| POST | /api/v1/orders | Sipariş oluştur |
| GET | /api/v1/orders | Sipariş listesi |
| GET | /api/v1/orders/{id} | Sipariş detayı |
| POST | /api/v1/orders/{id}/cancel | Sipariş iptal |
| GET | /api/v1/orders/{id}/tracking | Canlı takip |
| GET | /api/v1/reports/summary | Rapor özeti |
| GET | /api/v1/statements/{y}/{m} | Dönem ekstresi |
Yükleniyor…
stops[] veya deliveries[] ile 2+ varış gönderin. Tek çıkış noktası; her durak ayrı teslimat kodu alır (OrderGroup). Tek-durak alanları (dropoff_address …) geriye uyumlu kalır.
{
"pickup_address": "Kadıköy, İstanbul",
"payment_type": "cari",
"stops": [
{
"address": "Beşiktaş, İstanbul",
"recipient_name": "Ayşe Yılmaz",
"recipient_phone": "05321234567",
"note": "Kat 3"
},
{
"address": "Şişli, İstanbul",
"recipient_name": "Can Demir",
"recipient_phone": "05339876543"
}
]
}
Yanıtta group_id, stop_count, total_price_try ve orders[] döner. Tek-durakta yanıt düz sipariş objesi olarak kalır.
<API_ANAHTARI> yerine panelden aldığınız anahtarı yazın. Aşağıda sağlık kontrolü ve sipariş oluşturma iskeleti var.
# Sağlık (auth gerekmez)
curl -s https://api.mikrokurye.net/api/v1/health
# Sipariş oluştur
curl -X POST https://api.mikrokurye.net/api/v1/orders \
-H "Authorization: Bearer <API_ANAHTARI>" \
-H "Content-Type: application/json" \
-d '{
"pickup_address": "Kadıköy, İstanbul",
"dropoff_address": "Beşiktaş, İstanbul",
"recipient_name": "Ayşe Yılmaz",
"recipient_phone": "05321234567",
"product_type": "evrak"
}'
import requests
BASE = "https://api.mikrokurye.net/api/v1"
API_KEY = "<API_ANAHTARI>"
# Sağlık
print(requests.get(f"{BASE}/health").json())
# Sipariş oluştur
r = requests.post(
f"{BASE}/orders",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={
"pickup_address": "Kadıköy, İstanbul",
"dropoff_address": "Beşiktaş, İstanbul",
"recipient_name": "Ayşe Yılmaz",
"recipient_phone": "05321234567",
"product_type": "evrak",
},
)
print(r.status_code, r.json())
const BASE = "https://api.mikrokurye.net/api/v1";
const API_KEY = "<API_ANAHTARI>";
// Sağlık
const health = await fetch(`${BASE}/health`);
console.log(await health.json());
// Sipariş oluştur
const res = await fetch(`${BASE}/orders`, {
method: "POST",
headers: {
Authorization: `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
pickup_address: "Kadıköy, İstanbul",
dropoff_address: "Beşiktaş, İstanbul",
recipient_name: "Ayşe Yılmaz",
recipient_phone: "05321234567",
product_type: "evrak",
}),
});
console.log(res.status, await res.json());
<?php
$base = "https://api.mikrokurye.net/api/v1";
$apiKey = "<API_ANAHTARI>";
// Sipariş oluştur
$payload = json_encode([
"pickup_address" => "Kadıköy, İstanbul",
"dropoff_address" => "Beşiktaş, İstanbul",
"recipient_name" => "Ayşe Yılmaz",
"recipient_phone" => "05321234567",
"product_type" => "evrak",
]);
$ch = curl_init("$base/orders");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $apiKey",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "$status\n$response\n";
using System.Net.Http.Headers;
using System.Net.Http.Json;
const string Base = "https://api.mikrokurye.net/api/v1";
const string ApiKey = "<API_ANAHTARI>";
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", ApiKey);
// Sipariş oluştur
var body = new {
pickup_address = "Kadıköy, İstanbul",
dropoff_address = "Beşiktaş, İstanbul",
recipient_name = "Ayşe Yılmaz",
recipient_phone = "05321234567",
product_type = "evrak",
};
var res = await client.PostAsJsonAsync($"{Base}/orders", body);
var json = await res.Content.ReadAsStringAsync();
Console.WriteLine($"{(int)res.StatusCode} {json}");
$Base = "https://api.mikrokurye.net/api/v1"
$ApiKey = "<API_ANAHTARI>"
# Sağlık
Invoke-RestMethod -Uri "$Base/health" -Method GET
# Sipariş oluştur
$headers = @{
Authorization = "Bearer $ApiKey"
"Content-Type" = "application/json"
}
$body = @{
pickup_address = "Kadıköy, İstanbul"
dropoff_address = "Beşiktaş, İstanbul"
recipient_name = "Ayşe Yılmaz"
recipient_phone = "05321234567"
product_type = "evrak"
} | ConvertTo-Json
Invoke-RestMethod -Uri "$Base/orders" -Method POST -Headers $headers -Body $body