LetsBot मेन्यू
शुरू करें हिन्दी भाषा

Meta Business Partner UK में रजिस्टर्ड कंपनी

भाषा

Orders (order journey) · API एंडपॉइंट

POST /api/v1/orders/{orderId}/cancel नया

Cancel an order (stop its journey)

Stops the order journey for a cancelled or refunded order: no further journey messages are sent for it.

Stops the order journey for a cancelled or refunded order: no further journey messages are sent for it. Send the same customer phone used when the order was recorded. cancelled is false when no open order matches this id and phone.

JSON बॉडी

{
  "phone": "966501234567"
}

उदाहरण अनुरोध

curl -X POST "https://letsbot.net/api/v1/orders/ORD-1042/cancel" \
  -H "Authorization: Bearer YOUR_LB_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "phone": "966501234567"
}'
const response = await fetch("https://letsbot.net/api/v1/orders/ORD-1042/cancel", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_LB_API_KEY",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "phone": "966501234567"
  }),
});

const data = await response.json();
console.log(data);
<?php

$ch = curl_init('https://letsbot.net/api/v1/orders/ORD-1042/cancel');

curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer YOUR_LB_API_KEY',
        'Accept: application/json',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
    {
        "phone": "966501234567"
    }
    JSON,
]);

$data = json_decode(curl_exec($ch), true);
curl_close($ch);

print_r($data);
import requests

response = requests.request(
    "POST",
    "https://letsbot.net/api/v1/orders/ORD-1042/cancel",
    headers={
        "Authorization": "Bearer YOUR_LB_API_KEY",
        "Accept": "application/json",
        "Content-Type": "application/json",
    },
    json={
        "phone": "966501234567",
    },
)

print(response.json())

प्रतिक्रियाएँ

Cancelled200
{
  "Status": true,
  "Message": "No further messages will be sent for this order.",
  "cancelled": true
}
No open order200
{
  "Status": true,
  "Message": "No open order with this id and phone.",
  "cancelled": false
}

जब आप तैयार हों, हम तैयार हैं

इस एंडपॉइंट को अपने नंबर पर आज़माएँ

API मुफ़्त ट्रायल के दौरान काम करता है। खाता बनाएँ, अपना WhatsApp नंबर जोड़ें और API → प्रमाणीकरण डेटा से अपनी कुंजी कॉपी करें।