Delyvo.live

Integrations

Connect your website or shop with the API

Create packages and check their status automatically from your own systems (Growth and Business plans).

1Step 1

Only the account owner can do this. Open Settings, pick API access in the dropdown. On plans without API access the card shows the Paid feature label and the upgrade button.

2Step 2

Each branch has its own key. Press Create key on the branch row. The full key is shown only once in a popup: press Copy, keep it somewhere safe, then press I saved the key. The list then shows only the start of the key and its date.

3Step 3

Give the API address and the key to your web developer. Every request sends the header Authorization: Bearer followed by the key.

4Step 4

POST /packages with a JSON body creates a package in that branch. Required: recipient_name, phone, address, city, description. Optional fields use the same names as the CSV import template (client, type, weight_kg, payment, cod_amount, delivery_date, collection, latitude, longitude...). Country, area code and currency always come from the branch.

5Step 5

The package goes through the same checks as New package: plan limit, prices, dates and cash on delivery, then the driver search starts. Without latitude and longitude the location is found from the address; if it cannot be found the request is refused. A client name must match a client of that branch. Up to 5,000 packages a day.

6Step 6

GET /packages/DLV-XXXXXX returns the status, the tracking link and the status history of a package of that branch. Packages created this way show API as the creator in their history.

7Step 7

Replace key makes a new key and stops the old one at once. Delete key stops it with no replacement. If the plan no longer includes API access, every key is refused until you upgrade again.

8Step 8

Shopify or WooCommerce shop? You do not need the API: use Settings > Online stores (see the article Connect Shopify or WooCommerce). The API is for any other shop or system (PrestaShop, Wix, YouCan, your own website, an ERP).

9Step 9

Ready-to-copy examples (cURL, JavaScript, Python and PHP), a PHP function that sends each new order of your shop, the list of every field and the possible answers are at the bottom of this page under Sample API calls.

Sample API calls

Replace API_ADDRESS with the API address shown in Settings > API access, and dlv_YOUR_KEY with your branch key. Status values: created, assigned, picked_up, out_for_delivery, delivered, failed, cancelled, on_hold, returned, awaiting_pickup.

Create a package (cURL)

curl -X POST "API_ADDRESS/packages" \
  -H "Authorization: Bearer dlv_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "recipient_name": "Amina Benali",
  "phone": "0550123456",
  "email": "amina@example.com",
  "address": "12 Rue Didouche Mourad",
  "city": "Algiers",
  "postal_code": "16000",
  "description": "2 books",
  "type": "parcel",
  "weight_kg": 1.5,
  "payment": "cod",
  "cod_amount": 3500,
  "delivery_date": "2026-11-05",
  "client": "My Online Shop",
  "language": "fr"
}'

Create a package (JavaScript)

const res = await fetch("API_ADDRESS/packages", {
  method: "POST",
  headers: {
    "Authorization": "Bearer dlv_YOUR_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    recipient_name: "Amina Benali",
    phone: "0550123456",
    address: "12 Rue Didouche Mourad",
    city: "Algiers",
    description: "2 books",
    latitude: 36.7538,
    longitude: 3.0588,
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data.error.message);
console.log(data.reference, data.tracking_url);

Create a package (PHP)

$ch = curl_init("API_ADDRESS/packages");
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer dlv_YOUR_KEY",
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => json_encode([
    "recipient_name" => "Amina Benali",
    "phone" => "0550123456",
    "address" => "12 Rue Didouche Mourad",
    "city" => "Algiers",
    "description" => "2 books",
  ]),
]);
$data = json_decode(curl_exec($ch), true);
echo $data["reference"];

Answer when the package is created (201)

{
  "reference": "DLV-HF2NH2",
  "status": "created",
  "tracking_url": "https://delyvo.live/track/hf2nh2...",
  "recipient_name": "Amina Benali",
  "city": "Algiers",
  "created_at": "2026-11-03T09:12:44.000Z",
  "delivery_date": "2026-11-05",
  "delivered_at": null,
  "delivery_fee": 600,
  "cod_amount": 3500,
  "currency": "DZD",
  "history": [
    { "status": "created", "at": "2026-11-03T09:12:44.000Z", "note": null }
  ]
}

Check a package status (cURL)

curl "API_ADDRESS/packages/DLV-HF2NH2" \
  -H "Authorization: Bearer dlv_YOUR_KEY"

Create a package (Python)

import requests

res = requests.post(
    "API_ADDRESS/packages",
    headers={"Authorization": "Bearer dlv_YOUR_KEY"},
    json={
        "recipient_name": "Amina Benali",
        "phone": "0550123456",
        "address": "12 Rue Didouche Mourad",
        "city": "Algiers",
        "description": "2 books",
        "payment": "cod",
        "cod_amount": 3500,
    },
    timeout=30,
)
data = res.json()
if res.status_code != 201:
    raise Exception(data["error"]["message"])
print(data["reference"], data["tracking_url"])

Send each new order from a PHP shop (PrestaShop, custom site)

// Call this right after an order is saved. It never blocks the checkout:
// if Delyvo.live refuses the order, the reason is written to the log.
function sendToDelyvo(array $order): void {
  $ch = curl_init("API_ADDRESS/packages");
  curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 20,
    CURLOPT_HTTPHEADER => ["Authorization: Bearer dlv_YOUR_KEY", "Content-Type: application/json"],
    CURLOPT_POSTFIELDS => json_encode([
      "recipient_name" => $order["name"],
      "phone"          => $order["phone"],
      "address"        => $order["address"],
      "city"           => $order["city"],
      "postal_code"    => $order["zip"],
      "description"    => "Order #" . $order["number"],
      "payment"        => $order["paid"] ? "prepaid" : "cod",
      "cod_amount"     => $order["paid"] ? null : $order["total"],
      "client"         => "My Online Shop",
    ]),
  ]);
  $data = json_decode((string) curl_exec($ch), true);
  if (curl_getinfo($ch, CURLINFO_HTTP_CODE) !== 201) error_log("Delyvo.live: " . ($data["error"]["message"] ?? "no answer"));
  curl_close($ch);
}

Every field of POST /packages

Field           Required  Example / allowed values
--------------  --------  -----------------------------------------------
recipient_name  yes       "Amina Benali" (2 to 80 characters)
phone           yes       "0550123456" or "+213550123456"
address         yes       "12 Rue Didouche Mourad"
city            yes       "Algiers"
description     yes       "2 books" (up to 300 characters)
email           no        "amina@example.com" (tracking link by email)
region          no        "Alger"
postal_code     no        "16000"
landmark        no        "Next to the post office"
latitude        no        36.7538  (send with longitude, or neither)
longitude       no        3.0588
client          no        exact client name of the branch
type            no        "parcel" or "document"
weight_kg       no        1.5 (parcels only)
quantity        no        1
parcels         no        1
payment         no        "prepaid" (default) or "cod"
cod_amount      with cod  3500
company_fee     no        600 (when the company fee is visible)
fee_payer       no        "client" (default), "recipient", "cod" or "free"
collection      no        "hub", "pickup" or "none"
pickup_date     pickup    "2026-11-04"
pickup_slot     no        "morning" or "evening"
delivery_date   no        "2026-11-05" (default: next working day)
language        no        "en", "fr" or "ar" (recipient messages)

Answer when something is wrong

// 400 a field is missing or wrong
{ "error": { "code": "invalid_field", "message": "\"phone\" is required" } }

// 401 the key is missing, wrong or replaced
{ "error": { "code": "invalid_key", "message": "The API key is missing or not valid" } }

// 403 the plan has no API access, or the account is suspended
{ "error": { "code": "plan", "message": "Your plan does not include API access. Upgrade your plan to use it." } }

// 422 the address was not found: send latitude and longitude
{ "error": { "code": "address_not_found", "message": "..." } }

// 422 the client name does not match a client of the branch
{ "error": { "code": "unknown_client", "message": "No client named \"My Shop\" in this branch" } }

// 422 a package rule refused it (plan limit, date, cash on delivery...)
{ "error": { "code": "rejected", "message": "Your plan allows 500 packages per month. Upgrade to add more." } }

// 404 no package with this tracking number in this branch
{ "error": { "code": "not_found", "message": "..." } }

Still stuck? Open the Delyvo Assistant from the website footer or sign in and use Support > Contact developer.