Cancel an order
खाते के एक सामान्य ऑर्डर या खाते के अधिकतम 100 ID वाले क्रमिक बैच को रद्द करता है। हर सामान्य API ऑर्डर केवल अपनी 15 सेकंड की प्रेषण से पहले वाली छूट अवधि में ही पात्र होता है।
https://notpanel.com/api/v3action=cancelapplication/x-www-form-urlencodedorder ID या अल्पविराम से अलग किए गए अधिकतम 100 orders ID दें। बैच मोड किसी ऑर्डर की रद्दीकरण अवधि कभी नहीं बढ़ाता।पैरामीटर
| नाम | टाइप | विवरण |
|---|---|---|
| keyआवश्यक | string | आपकी API की। |
| actionआवश्यक | string | लिटरल स्ट्रिंग "cancel" होना चाहिए। |
| orderशर्ती | string | action=add से लौटाया गया, खाते के एक सामान्य ऑर्डर का संख्यात्मक ID। |
| ordersशर्ती | string (CSV) | अल्पविराम से अलग किए गए सामान्य ऑर्डर ID, अधिकतम 100। उत्तर इनपुट का क्रम बनाए रखता है और हर आइटम के लिए सफलता या त्रुटि लौटाता है। |
उदाहरण रिक्वेस्ट
YOUR_API_KEY को अपने डैशबोर्ड के API पेज के तहत जनरेट की गई की से बदलें।
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));
उदाहरण रिस्पॉन्स
{
"order": 7001,
"status": "Canceled",
"status_key": "cancelled",
"cancel": 1,
"refund": "0.50",
"refund_pending": 0
}सामान्य एरर
| स्टेटस | बॉडी | कारण |
|---|---|---|
| 409 | {"error":"Cancellation window has ended or the order has already started"} | सामान्य order 15-second cancellation window से बाहर जा चुका है या अब pending नहीं है। Single request 409 लौटाता है। |
| 409 | {"error":"Order is already completed"} | Item पहले से non-cancellable terminal state में है। पहले सफल cancellation का retry वही सफल result लौटाता है। |
| 409 | {"error":"Order is already refunded"} | Item पहले से non-cancellable terminal state में है। पहले सफल cancellation का retry वही सफल result लौटाता है। |
| 404 | {"error":"Order not found"} | इस पहचान वाला कोई सामान्य ऑर्डर इस खाते का नहीं है। एकल अनुरोध 404 लौटाता है। |
| 429 | {"error":"Rate limit exceeded for cancel"} | Cancellation action limit पूरी हो गई। बताई गई delay के बाद retry करें; response 429 है। |