Vendor Shipping API

Connect your own website or store to Fast Link's delivery network. Create shipping orders, estimate cost, track deliveries, and receive status webhooks — without using Fast Link's vendor dashboard or storefront.

Introduction

The Vendor Shipping API is for businesses that already have their own website / e-commerce system and only need Fast Link as a shipping provider. You push delivery orders to Fast Link; our riders and shipping companies execute them; you get live tracking and webhooks.

You do not need Fast Link's vendor website, product catalog, or provider dashboard.

Every endpoint below lists its responses: the success body, and each error your request can get. Errors that apply to every endpoint (authentication, not found) are listed once, under Authentication and Errors.

How this differs from the Marketplace API

Vendor Shipping APIMarketplace API
AudienceSingle vendor with own siteMulti-merchant platform
MerchantsNot needed — you are the shipperCRUD merchants under your platform
Prefix/vendor-api/platform-api
API key prefixvk_ / vs_pk_ / sk_

Who this is for

Authentication

Two ways to authenticate — pick per use case:

1) API key (server-to-server) — recommended

Send both headers on every request. Keys are issued by your Fast Link account manager (or from your portal if enabled).

# headers
X-API-Key: vk_xxxxxxxxxxxxxxxx
X-API-Secret: vs_xxxxxxxxxxxxxxxx
The secret is shown only once when generated. Store it securely; if lost, rotate the key.
Authentication errors — any endpoint
401 No X-API-Key / X-API-Secret and no bearer token
{ "error": { "message": "Authentication credentials were not provided.", "errors": [] } }
401 Only one of the two headers sent
{ "error": { "message": "Both X-API-Key and X-API-Secret are required.", "errors": [] } }
401 Unknown, revoked or inactive API key
{ "error": { "message": "Invalid API key.", "errors": [] } }
401 Wrong secret for the key
{ "error": { "message": "Invalid API secret.", "errors": [] } }
401 Your vendor account has been deactivated by Fast Link
{ "error": { "message": "This vendor is deactivated.", "errors": [] } }

2) Portal login (JWT)

A human portal user logs in and calls the same endpoints with a bearer token.

POST /vendor-api/auth/login/
{ "phone": "+201000000002", "password": "••••••" }

# then send on every request
Authorization: Bearer <access token>
Responses
200 Logged in
{
  "access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…",
  "refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…",
  "user": {
    "id": 3,
    "phone": "+201000000002",
    "name": "Omar Nabil",
    "email": "",
    "image": null,
    "role": "owner"
  },
  "vendor": { "id": 1, "name": "ShopX", "slug": "shopx" }
}
400 phone or password missing
{ "detail": "phone and password are required." }
401 Wrong phone or password
{ "detail": "Invalid phone or password." }
403 The account exists but is not an active vendor portal user
{ "detail": "This account is not an active vendor shipping portal user." }

Base URL

https://backend.fastlink.cyparta.com

All endpoints below are prefixed with /vendor-api. Every request and response is JSON. Responses are scoped to your vendor automatically.

List endpoints are paginated, 10 per page, newest first: { "count", "next", "previous", "results": [ … ] }. Use ?page=2 for the next page.

Pickup addresses

Register one or more pickup locations (عناوين الاستلام). When an order omits pickup details, your default pickup address is used.

GET /vendor-api/pickup-addresses/
POST /vendor-api/pickup-addresses/
GET /vendor-api/pickup-addresses/{id}/
PATCH /vendor-api/pickup-addresses/{id}/
DELETE /vendor-api/pickup-addresses/{id}/

Create a pickup address

{
  "label": "Main warehouse",
  "address": "Nasr City, Cairo",
  "latitude": "30.05",
  "longitude": "31.34",
  "contact_phone": "+201111111111",
  "is_default": true
}

Creating an address with "is_default": true clears the flag on your other addresses.

Responses
201 Created — the pickup address object
{
  "id": 1,
  "label": "Main warehouse",
  "address": "Nasr City, Cairo",
  "latitude": "30.050000",
  "longitude": "31.340000",
  "governorate": null,
  "area": null,
  "contact_phone": "+201111111111",
  "is_default": true,
  "created_at": "2026-09-29T15:09:46.231367Z"
}
400 address missing
{ "error": { "message": "Invalid request", "errors": [ { "field": "address", "message": "This field is required." } ] } }
400 latitude / longitude not a number
{ "error": { "message": "Invalid request", "errors": [ { "field": "latitude", "message": "A valid number is required." } ] } }
200 GET list — paginated pickup address objects
{ "count": 1, "next": null, "previous": null, "results": [ { "id": 1, "label": "Main warehouse", "is_default": true, … } ] }
200 GET /{id}/, PATCH /{id}/ — the pickup address object
{ "id": 1, "label": "HQ", "address": "Nasr City, Cairo", "is_default": true, … }
404 No pickup address with that id on your account
{ "error": { "message": "No VendorPickupAddress matches the given query.", "errors": [] } }
204 DELETE /{id}/ — deleted, empty body

Shipping cost

POST /vendor-api/shipping/calculate/

Estimate the shipping cost for a route using the pricing Fast Link configured for your account (fixed, distance/weight formula, or weight-range tiers). All fields are optional; distance is 0 unless both pickup and destination are sent.

Call this from your checkout before creating the order, then optionally pass the quoted shipping_cost when creating the order.

# request
{
  "pickup": "30.05,31.34",
  "destination": "30.0444,31.2357",
  "weight": "2.5"            // or "items": [{ "weight": 1.5, "quantity": 2 }]
}
Responses
200 Quote (formula pricing shown)
{
  "currency": "EGP",
  "cost": "67.78",
  "distance_km": 10.08,
  "weight_kg": 2.5,
  "breakdown": {
    "type": "formula",
    "base_fee": "20.00",
    "price_per_km": "3.50",
    "price_per_kg": "5.00",
    "min_price": "25.00"
  }
}

breakdown depends on your pricing type: { "type": "fixed", "fixed_price" }, { "type": "weight_range", "weight_tiers", "min_price" }, or the formula fields above.

400 weight isn't a number
{ "error": { "message": "Invalid request", "errors": [ { "field": "weight", "message": "A valid number is required." } ] } }
400 An item's quantity isn't a whole number
{ "error": { "message": "Invalid request", "errors": [ { "field": "items.quantity", "message": "A valid integer is required." } ] } }

Pricing types

TypeHow cost is computed
fixedFlat fixed_price (never below min_price).
formulabase_fee + (price_per_km × distance_km) + (price_per_kg × weight_kg)
weight_rangePrice of the tier where min_weight ≤ weight ≤ max_weight (open-ended max allowed).
Pricing is configured per vendor by your Fast Link account manager. This endpoint is an estimate — it does not create an order.

Orders

Create and manage delivery (shipping) orders from your own system.

GET /vendor-api/orders/
POST /vendor-api/orders/
GET /vendor-api/orders/{id}/
POST /vendor-api/orders/{id}/cancel/

Create a shipping order

{
  "external_order_id": "ORD-1001",
  "customer_name": "Ahmed Ali",
  "phone_number": "+201234567890",
  "email": "ahmed@example.com",
  "delivery_address": "12 Tahrir St, Cairo",
  "coordinates": "30.0444,31.2357",
  "pickup_address": "Nasr City warehouse",
  "pickup_coordinates": "30.05,31.34",
  "delivery_notes": "Call before arrival",
  "building_number": "12",
  "floor": "3",
  "apartment": "8",
  "shipping_cost": "67.78",
  "items": [
    {
      "product_name": "Wireless headphones",
      "quantity": 1,
      "weight": "0.8",
      "price": "450.00"
    },
    {
      "product_name": "Phone case",
      "quantity": 2,
      "weight": "0.1",
      "price": "50.00"
    }
  ]
}

Required: customer_name, phone_number, delivery_address, and at least one item with product_name and quantity. total_amount is optional and defaults to the sum of the items. Coordinates are "lat,lng" strings.

The order is created and handed to Fast Link operations, then flows through the delivery lifecycle.

If you leave out pickup_address or pickup_coordinates, the missing value is taken from your default pickup address. Register a default pickup address before sending orders: without one, an order that has no pickup details has no collection point.
Responses
201 Created — the order object, nested under order
{
  "detail": "Order created successfully.",
  "order": {
    "id": 3,
    "order_number": "886FF6542D1F454AA336",
    "external_order_id": "ORD-1001",
    "status": "pending",
    "assignment_type": "pending_admin",
    "total_amount": "550.00",
    "shipping_cost": "67.78",
    …   // full order object
  }
}
400 Required fields missing — every missing field is listed
{ "error": { "message": "Invalid request", "errors": [
  { "field": "customer_name", "message": "This field is required." },
  { "field": "phone_number", "message": "This field is required." },
  { "field": "delivery_address", "message": "This field is required." },
  { "field": "items", "message": "At least one item is required." }
] } }
400 items empty
{ "error": { "message": "Invalid request", "errors": [ { "field": "items", "message": "At least one item is required." } ] } }
400 An item is invalid (field names are prefixed with items.)
{ "error": { "message": "Invalid request", "errors": [
  { "field": "items.product_name", "message": "This field is required." },
  { "field": "items.quantity", "message": "Ensure this value is greater than or equal to 1." }
] } }
400 coordinates not in lat,lng format
{ "error": { "message": "Invalid request", "errors": [ { "field": "coordinates", "message": "Must be in 'lat,lng' format." } ] } }

List orders

GET /vendor-api/orders/ is paginated and newest first. Search and filters can be combined, and an order must match all of them.

GET /vendor-api/orders/?search=ahmed&status=pending,confirmed&created_from=2026-09-01
QueryMatches
?search=ahmedCase-insensitive text search in the order number, your external_order_id, customer name, phone and email, delivery address and product names. Several words must all match.
?status=deliveredOrders in that status. Comma-separate several: ?status=pending,confirmed.
?external_order_id=ORD-1001Your own order reference (exact).
?order_number=…Fast Link's order number (exact).
?created_from=2026-09-01Created on or after that date (YYYY-MM-DD).
?created_to=2026-09-30Created on or before that date (YYYY-MM-DD).
?page=2Next page of results.
Responses
200 Paginated order objects. No match gives "count": 0 and "results": [].
{ "count": 2, "next": null, "previous": null, "results": [ { "id": 4, "external_order_id": "ORD-1002", "status": "pending", … }, … ] }
400 ?created_from= / ?created_to= isn't a YYYY-MM-DD date
{ "error": { "message": "Invalid request", "errors": [ { "field": "created_to", "message": "Enter a valid date." } ] } }

Retrieve an order

Responses
200 GET /orders/{id}/ — the order object
404 No order with that id on your account (also for /cancel/ and /tracking/)
{ "error": { "message": "No Order matches the given query.", "errors": [] } }

Cancel an order

Allowed while the order is pending, confirmed, or preparing. The optional reason is stored in cancellation_reason, which defaults to "Cancelled by vendor". Orders can't be deleted: DELETE /orders/{id}/ returns 405.

POST /vendor-api/orders/{id}/cancel/
{ "reason": "Customer changed mind" }
Responses
200 Cancelled — the updated order object under order
{
  "detail": "Order cancelled.",
  "order": { "id": 3, "status": "cancelled", "status_display": "Cancelled", "cancellation_reason": "Customer changed mind", … }
}
400 The order has moved past preparing, or is already cancelled
{ "detail": "Order in status 'cancelled' cannot be cancelled." }

If Fast Link operations cancel an order, they must enter a reason, and it arrives in the same cancellation_reason field. For failed, no_response and postponed orders, the rider's reason is carried there too.

Order tracking

GET /vendor-api/orders/{id}/tracking/

Returns the order with its current status, driver and trip info, items, and the full status timeline.

Responses
200 The order object plus timeline, oldest first
{
  "id": 3,
  "order_number": "886FF6542D1F454AA336",
  "external_order_id": "ORD-1001",
  "status": "in_transit",
  "rider": { "id": 7, "name": "…", "phone": "…", "vehicle_type": "…", "vehicle_number": "…", "is_online": true },
  …   // full order object
  "timeline": [
    { "old_status": "pending", "new_status": "confirmed", "reason": "", "created_at": "2026-09-29T15:20:00+00:00" },
    { "old_status": "confirmed", "new_status": "in_transit", "reason": "", "created_at": "2026-09-29T16:05:00+00:00" }
  ]
}
404 No order with that id on your account
{ "error": { "message": "No Order matches the given query.", "errors": [] } }

Webhooks

Register webhook URLs with your account manager, or from the portal while logged in. /vendor-api/webhooks/ accepts a portal login only; calling it with an API key returns 401 "Authentication credentials were not provided."

Fast Link POSTs a JSON event to each active webhook on every order transition:

{
  "data": { "id": 3, "status": "cancelled", "cancellation_reason": "…", /* … full order object, without timeline */ },
  "event": "order.status_changed",
  "sent_at": "2026-01-01T10:00:00.000000+00:00"
}

The body is serialized with its keys sorted alphabetically, so data comes first and event / sent_at come after the full order. Read the order from data, e.g. data.id.

EventWhen
order.createdAn order was created for your vendor.
order.status_changedThe order status changed (confirmed → … → delivered / cancelled).
order.assignedA rider or shipping company was assigned.

Reply with any 2xx within 8 seconds to acknowledge a delivery.

Verifying signatures

If you set a signing secret on a webhook, each delivery includes an X-FastLink-Signature header — an HMAC-SHA256 of the raw request body using your secret. Recompute and compare to verify authenticity. The event type is also sent in X-FastLink-Event.

# Python example
import hmac, hashlib

def verify(secret, body_bytes, signature_header):
    expected = hmac.new(secret.encode(), body_bytes, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature_header)

The order object

Returned by create, retrieve, list, cancel and tracking, and sent as data in webhooks. Money, weights and coordinates are strings; unknown values are null.

{
  "id": 3,
  "order_number": "886FF6542D1F454AA336",
  "external_order_id": "ORD-1001",
  "order_source": "vendor_api",
  "status": "pending",
  "status_display": "Pending",
  "assignment_type": "pending_admin",
  "total_amount": "550.00",
  "shipping_cost": "67.78",
  "cancellation_reason": null,
  "vendor": { "id": 1, "name": "ShopX", "slug": "shopx" },
  "customer": { "name": "Ahmed Ali", "phone": "+201234567890", "email": "ahmed@example.com" },
  "delivery": {
    "address": "12 Tahrir St, Cairo",
    "notes": "Call before arrival",
    "latitude": "30.044400",
    "longitude": "31.235700",
    "building_number": "12",
    "floor": "3",
    "apartment": "8",
    "destination_address": "12 Tahrir St, Cairo"
  },
  "pickup": { "address": "Nasr City warehouse", "latitude": "30.050000", "longitude": "31.340000" },
  "rider": null,                 // once assigned: { "id", "name", "phone", "vehicle_type", "vehicle_number", "is_online" }
  "shipping_company": null,      // once assigned: { "id", "name" }
  "items": [
    { "id": 5, "product_name": "Wireless headphones", "quantity": 1, "weight": "0.800", "price": "450.00", "total_price": "450.00" },
    { "id": 6, "product_name": "Phone case", "quantity": 2, "weight": "0.100", "price": "50.00", "total_price": "100.00" }
  ],
  "created_at": "2026-09-29T15:12:26.392192+00:00",
  "confirmed_at": null,
  "delivered_at": null,
  "updated_at": "2026-09-29T15:12:26.392209+00:00"
}

Order statuses

StatusMeaning
pendingReceived, awaiting operations.
confirmed / preparingAccepted / being prepared.
arrived_at_pickup / in_transit / out_for_deliveryIn progress.
deliveredCompleted.
postponed / no_response / failedDelivery issues. The reason is in cancellation_reason.
cancelledCancelled. The reason is in cancellation_reason.

Errors

Standard HTTP status codes are used. Validation, authentication and not-found errors come in this envelope, with one entry per invalid field:

{
  "error": {
    "message": "Invalid request",
    "errors": [ { "field": "coordinates", "message": "Must be in 'lat,lng' format." } ]
  }
}

For authentication and not-found errors, errors is empty and message says what went wrong. The portal login and order cancellation return { "detail": "…" } instead; their cases are listed with those endpoints.

CodeMeaning
200 / 201Success.
204Deleted — empty body.
400Validation error — check error.errors.
401Missing/invalid API key, secret, or token, or your vendor account is deactivated.
403Portal login refused, or not enough access.
404Resource not found (or not on your vendor account).
405Method not supported on that endpoint, e.g. deleting an order: { "error": { "message": "Method \"DELETE\" not allowed.", "errors": [] } }

Recommended integration flow

  1. Receive API key + secret from Fast Link; store the secret securely.
  2. POST /vendor-api/pickup-addresses/ — register your warehouse(s), mark one default.
  3. At checkout: POST /vendor-api/shipping/calculate/ — show the quote to the customer.
  4. On payment success: POST /vendor-api/orders/ with items + optional shipping_cost.
  5. Store Fast Link order.id / order_number against your external_order_id.
  6. Listen to webhooks (or poll /orders/{id}/tracking/) to update your UI.
  7. Cancel via API only while status is pending / confirmed / preparing.