LetsBot Menu
Aan de slag Nederlands Taal

Meta Business Partner Geregistreerd bedrijf in het VK

Taal

Orders (order journey) · API-endpoint

POST /api/v1/orders/{orderId}/cancel Nieuw

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-body

{
  "phone": "966501234567"
}

Voorbeeldverzoek

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())

Antwoorden

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
}

Klaar wanneer jij dat bent

Probeer dit endpoint met je eigen nummer

De API werkt tijdens de gratis proefperiode. Maak een account aan, koppel je WhatsApp-nummer en kopieer je sleutel via API → Authenticatiegegevens.