Skip to main content

Logistics API Documentation

Overview

The Logistics API allows vendors to manage orders and retrieve branch information securely using token-based authentication and JSON data.
  • Base URL: https://your-api-domain.com
  • API Version: v1

๐Ÿ” Authentication

API Credentials

Each vendor receives:
  • API Key: Unique account identifier
  • Secret Key: Private key for secure access

Token Generation

Before making API calls, generate an access token. Endpoint: POST /v1/token Headers:
Request Body:
Response:

Using the Token

Add the token to the Authorization header:

Orders

Get Orders List

Retrieve a paginated list of orders. Endpoint: GET /v1/orders Headers:
Query Parameters:
  • page (optional): Page number (default: 1)
  • limit (optional): Items per page (default: 20, max: 100)
  • status (optional): Filter by status (pending, confirmed, in_transit, delivered, cancelled)
  • fromDate (optional): Filter start date (YYYY-MM-DD)
  • toDate (optional): Filter end date (YYYY-MM-DD)
Example:
Response:

Create New Order

Endpoint: POST /v1/order Headers:
Request Body:
Response:

Add Comment to Order

POST /v1/orders/:orderId/comments Add a new text comment to a specific order.

๐Ÿงพ Path Parameters

Request Body

Example:
Response:

Branches

Get Provider Branches

Endpoint: GET /v1/branches/:providerId Headers:
Query Parameters:
  • active (optional): true or false
  • search (optional): Search by branch name, city, district, address
Example:
Response:

Get Branch Details

Endpoint: GET /v1/branch/:providerId/:branchId Response:

Error Handling

Error Format:
Common Error Codes:

Rate Limiting

  • Rate Limit: 1000 requests per hour per API key
  • Burst Limit: 50 requests per minute
Headers Returned:
  • X-RateLimit-Limit: Max requests per hour
  • X-RateLimit-Remaining: Remaining requests in current window
  • X-RateLimit-Reset: Reset time (Unix timestamp)

๐Ÿ›  Support


Changelog

Version 1.0.0

  • Initial API release
  • Order management endpoints
  • Branch information endpoints
  • Token-based authentication