Cancel an order
Hesaba ait tek bir normal siparişi veya en fazla 100 ID'den oluşan sıralı bir grubu iptal eder. Her normal API siparişi yalnızca sevk öncesindeki kendine ait 15 saniyelik süre içinde iptale uygundur.
POST
https://notpanel.com/api/v3action=cancelAPI anahtarı gerekliHız sınırlı (paylaşılan hesap + IP + işlem)Gövde:
application/x-www-form-urlencodedTek bir sayısal
order ID'si veya virgülle ayrılmış en fazla 100 orders ID'si sağlayın. Toplu mod hiçbir zaman siparişin iptal süresini uzatmaz.Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
| keyZorunlu | string | API anahtarınız. |
| actionZorunlu | string | Birebir "cancel" dizesi olmalıdır. |
| orderKoşullu | string | action=add tarafından döndürülen, hesaba ait normal bir siparişin sayısal ID'si. |
| ordersKoşullu | string (CSV) | Virgülle ayrılmış normal sipariş ID'leri, en fazla 100. Yanıt girdi sırasını korur ve her öğe için başarı veya hata döndürür. |
Örnek istek
YOUR_API_KEY değerini panonuzun API sayfası altında oluşturulan anahtarla değiştirin.
curl -X POST https://notpanel.com/api/v3 \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "key=YOUR_API_KEY&action=cancel&order=7001"const res = await fetch("https://notpanel.com/api/v3", {
method: "POST",
headers: { "Content-Type": "application/x-www-form-urlencoded" },
body: new URLSearchParams({
key: "YOUR_API_KEY",
action: "cancel",
order: "7001",
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://notpanel.com/api/v3",
data={
"key": "YOUR_API_KEY",
"action": "cancel",
"order": "7001",
},
)
print(res.json())<?php
$body = http_build_query([
'key' => 'YOUR_API_KEY',
'action' => 'cancel',
'order' => '7001',
]);
$response = file_get_contents('https://notpanel.com/api/v3', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/x-www-form-urlencoded\r\n",
'content' => $body,
'ignore_errors' => true,
],
]));
print_r(json_decode($response, true));
Örnek yanıt
{
"order": 7001,
"status": "Canceled",
"status_key": "cancelled",
"cancel": 1,
"refund": "0.50",
"refund_pending": 0
}Yaygın hatalar
| Durum | Gövde | Neden |
|---|---|---|
| 409 | {"error":"Cancellation window has ended or the order has already started"} | Normal sipariş 15 saniyelik iptal süresini geçti veya artık pending değil. Tekil istek 409 döndürür. |
| 409 | {"error":"Order is already completed"} | Öğe iptal edilemeyen nihai durumdadır. Daha önce başarılı iptalin yeniden denemesi aynı sonucu döndürür. |
| 409 | {"error":"Order is already refunded"} | Öğe iptal edilemeyen nihai durumdadır. Daha önce başarılı iptalin yeniden denemesi aynı sonucu döndürür. |
| 404 | {"error":"Order not found"} | Bu tanımlayıcıya sahip normal bir sipariş bu hesaba ait değil. Tekil istek 404 döndürür. |
| 429 | {"error":"Rate limit exceeded for cancel"} | İptal eylemi limitine ulaşıldı. Bildirilen gecikmeden sonra deneyin; yanıt 429'dur. |