LetsBot Menu
Inizia ora Italiano Lingua

Meta Business Partner Società registrata nel Regno Unito

Lingua

Orders (order journey) · Endpoint API

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

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.

Corpo JSON

{
  "phone": "966501234567"
}

Esempio di richiesta

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

Risposte

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
}

Pronti quando lo sei tu

Prova questo endpoint con il tuo numero

L’API funziona durante la prova gratuita. Crea un account, collega il tuo numero WhatsApp e copia la chiave da API → Dati di autenticazione.