Sipariş güncelleme
Mevcut bir sipariş kaydını güncellemek için bu endpoint kullanılır. Yalnızca değiştirmek istediğiniz alanları gönderirsiniz; gönderilmeyen alanlara dokunulmaz.
İstek
PATCH /api/orders/{id}
Accept: application/json
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
PUT de kabul edilir; davranış aynıdır.
Güncellenebilir alanlar
Tüm alanlar isteğe bağlıdır — ancak gönderdiğiniz alan geçerli bir değer taşımak zorundadır (örneğin platform_id gönderiyorsanız boş olamaz). sale_channel_id güncellenemez: sipariş oluşturulduğu kanala bağlı kalır.
| Alan | Tip | Açıklama |
|---|---|---|
platform_id | string | Sizdeki sipariş numarası. |
platform_d_id | string | Görünen sipariş numarası. |
platform_url | string | Siparişin sizdeki adresi. |
platform_status | string | Sipariş durumu. |
platform_date | string | Sipariş tarihi. |
total | number | Sipariş toplamı. |
currency | string | Para birimi. |
payment_method | string | Ödeme yöntemi. |
payment_platform | string | Ödeme altyapısı. |
payment_status | string | Ödeme durumu — bkz. Sabitler. |
payment_date | string | Ödeme tarihi. |
platform_customer_id | string | Müşterinin sizdeki ID’si. |
platform_customer_email | string | Müşteri e-postası. |
customer_note | string | Müşteri notu. |
invoice_url | string | Harici fatura adresi. |
billingAddress | object | Fatura adresi — aşağıdaki nesne kurallarına bakın. |
shippingAddress | object | Teslimat adresi. |
lines | array | Sipariş satırları — aşağıdaki uyarıya bakın. |
shipment | object | Kargo bilgisi. |
lines gönderirseniz mevcut tüm satırlar silinip gönderdikleriniz yeniden oluşturulur — bu yüzden satırların tamamını gönderin, yalnızca değişeni değil. Aynı şekilde billingAddress, shippingAddress ve shipment nesneleri de bütün olarak yazılır.
shippingAddress veya shipment alanını boş (null / []) gönderirseniz ilgili kayıt silinir.
billingAddress gönderirseniz
type, address, city, district, country ve tax_number alanları zorunlu olur. type: "company" ise title, type: "person" ise name ve surname da zorunludur.
lines[] gönderirseniz
Her satırda platform_id, name, quantity, unit, unit_price ve tax_rate zorunludur; sku, discount_type, discount ve description isteğe bağlıdır. En az bir satır bulunmalıdır. Alan açıklamaları için bkz. sipariş oluşturma.
Örnek istek gövdesi
{
"platform_status": "completed",
"payment_status": "paid",
"payment_date": "2026-07-31 09:20:00",
"total": 2499.90,
"lines": [
{
"platform_id": "LINE-1",
"sku": "SKU-001",
"name": "Mavi T-Shirt",
"quantity": 2,
"unit": "C62",
"unit_price": 1000,
"discount_type": "percentage",
"discount": 10,
"tax_rate": 20,
"description": "Beden: M"
},
{
"platform_id": "LINE-2",
"sku": "SKU-002",
"name": "Siyah Kot Pantolon",
"quantity": 1,
"unit": "C62",
"unit_price": 1500,
"discount_type": "amount",
"discount": 500,
"tax_rate": 20
}
],
"shipment": {
"company_title": "Yurtiçi Kargo",
"company_tax_number": "9860008925",
"delivery_date": "2026-08-02"
}
}
Örnek istekler
- 💻 cURL
- 🐘 PHP
- 🟢 Node.js
- 🐍 Python
curl -X PATCH "https://app.faturaentegrator.com/api/orders/30" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"platform_status":"completed","payment_status":"paid"}'
<?php
$body = ['platform_status' => 'completed', 'payment_status' => 'paid'];
$ch = curl_init('https://app.faturaentegrator.com/api/orders/30');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_POSTFIELDS => json_encode($body),
CURLOPT_HTTPHEADER => [
'Accept: application/json',
'Authorization: Bearer YOUR_API_KEY',
'Content-Type: application/json',
],
CURLOPT_RETURNTRANSFER => true,
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
const res = await fetch('https://app.faturaentegrator.com/api/orders/30', {
method: 'PATCH',
headers: {
Accept: 'application/json',
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ platform_status: 'completed', payment_status: 'paid' }),
});
const data = await res.json();
import requests
r = requests.patch(
'https://app.faturaentegrator.com/api/orders/30',
json={'platform_status': 'completed', 'payment_status': 'paid'},
headers={'Accept': 'application/json', 'Authorization': 'Bearer YOUR_API_KEY'},
)
data = r.json()
Örnek yanıt
Güncellenmiş sipariş, tek sipariş detayı ile aynı yapıda döner.