DelMax
v1.0.0 API Live
Swagger UI Portal Sign In

DelMax REST API Documentation

Integrate your e-commerce storefronts, Shopify or WooCommerce plugins, warehouse management systems (WMS), and enterprise ERPs with the DelMax multi-tenant logistics and dispatch platform.

Production Host https://delmax.24apps.in
API Base Path /api/v1
Authentication JWT Bearer or Client Headers
Format JSON (application/json)
Read Approval Workflow

1. Overview & Architecture

DelMax operates an enterprise multi-tenant delivery management system with strict schema-per-tenant data isolation on PostgreSQL. The ecosystem divides into two core tenant classes:

🛍️ E-Commerce Tenants (ECOM)

Generate orders through Shopify, WooCommerce, or custom REST APIs. Access self-service shipping label printing, real-time consignment status, and return requests.

🚚 Delivery Providers (DELIVERY_PROVIDER)

Carriers and fleet operators managing sorting hubs, vehicle capacity, Bee driver apps, dispatch boards, barcode manifests, and cash-on-delivery (COD) ledgers.

⚡ Default Routing Rule to DelMax: Any order posted without specifying an explicit deliveryTenantId or delivery-tenantId header is automatically assigned to the default carrier: DelMax (Tenant ID: 00000000-0000-0000-0000-000000000002).

2. Merchant Registration & Super Admin Approval

DelMax provides enterprise-grade data isolation using dedicated PostgreSQL schemas per tenant. To protect delivery network SLAs, prevent unauthorized access, and configure custom fulfillment agreements, all new E-Commerce businesses register through a structured 3-phase onboarding pipeline:

1. Merchant Registration

Submit your store credentials, domain URL, e-commerce engine (Shopify, WooCommerce, Custom API), and administrative contact details. Your dedicated database schema is created in Pending approval state.

2. Super Admin Approval

The DelMax platform administration reviews your business profile in the Super Admin Platform Control Tower (/admin). Platform verification ensures carrier routing rules and rate cards are aligned.

3. API Client Keys Unlocked

Upon Super Admin approval, your schema status transitions to Active, and your production clientId and clientSecret are cryptographically generated. You can immediately authenticate and dispatch parcels.

Ready to connect your online store?

Fill out the registration form to start the onboarding process and receive your dedicated API credentials.

3. Base URLs & Global Headers

All requests must be made over secure HTTPS. Provide the mandatory tenant identification header with every request.

Header Name Type Required Description & Example
X-Tenant-Code string Required Your organization tenant code (e.g. delmax, nova_retail, or your assigned store identifier).
Content-Type string Required Must be application/json for all POST / PUT requests.
Authorization string Conditional Bearer <AccessToken> returned from /api/v1/clients/authenticate.
Idempotency-Key UUID / string Optional Unique client request key to prevent duplicate orders in case of network retries.

3. Authentication & API Credentials

DelMax supports two authentication pathways for client applications: OAuth2-style Client Token Exchange and Direct Request Header Authentication.

🔑 Generating Your Client ID & Secret: Log in to the Web Portal at delmax.24apps.in → navigate to Client API Credentials (/clients) → click "Register Client". The portal displays your clientId (e.g. dlm_cli_...) and cryptographically hashed clientSecret (e.g. dlm_sec_...).

Method A: Token Exchange (Recommended)

Exchange your Client ID and Client Secret for a scoped JSON Web Token (JWT) valid for 24 hours.

POST /api/v1/clients/authenticate

Exchanges client credentials for a signed bearer access token.

# Authenticate Client & Obtain JWT Access Token
curl -X POST "https://delmax.24apps.in/api/v1/clients/authenticate" \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Code: delmax" \
  -d '{
    "clientId": "dlm_cli_ff4814ec37f5497bb866657691d7a530",
    "clientSecret": "dlm_sec_58a90f8307945199c836eb62cd0b39bca65aad9d9dbaad6c68db0407280c33ea"
  }'

Example 200 OK Response:

{
  "success": true,
  "tokenType": "Bearer",
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMTcyZDJiMy0...",
  "expiresIn": 86400,
  "clientId": "dlm_cli_ff4814ec37f5497bb866657691d7a530",
  "clientName": "Shopify Store Alpha"
}

Method B: Direct Header Authentication

If you prefer zero-state server-to-server calls without managing JWT lifecycles, you can provide X-Client-Id and X-Client-Secret directly in the headers of your API calls:

# Example of direct credentials on order ingestion
POST /api/v1/orders HTTP/1.1
Host: delmax.24apps.in
X-Tenant-Code: delmax
X-Client-Id: dlm_cli_ff4814ec37f5497bb866657691d7a530
X-Client-Secret: dlm_sec_58a90f8307945199c836eb62cd0b39bca65aad9d9dbaad6c68db0407280c33ea
Content-Type: application/json

4. Inbound Order Ingestion API

Create consignments, dispatch delivery tasks, and generate package barcodes in a single atomic call.

POST /api/v1/orders

Request Schema Parameters:

Parameter Type Required Description
source string Yes Order origin: SHOPIFY, WOOCOMMERCE, MAGENTO, or API.
externalOrderId string Yes Your store order reference ID (e.g. ORD-99120).
customerName string Yes Full recipient customer name.
customerPhone string Yes E.164 phone number for driver SMS/call navigation and OTP verification.
destinationAddress string Yes Full street address, building, city, and zip code.
destinationLat / Lng double Yes Geographical coordinates for automated route planning & dispatching.
isCod boolean Yes Set true if delivery executive must collect cash upon delivery.
codAmount decimal If COD Total monetary amount rider must remit into cashier drawer.
items array Yes List of parcel line items (sku, title, quantity, unitPrice).
# Ingest New Delivery Order into DelMax
curl -X POST "https://delmax.24apps.in/api/v1/orders" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "X-Tenant-Code: delmax" \
  -H "Idempotency-Key: e82f1b4a-89a3-48b2-8419-f027814b62dc" \
  -H "Content-Type: application/json" \
  -d '{
    "source": "SHOPIFY",
    "externalOrderId": "SHOP-99214",
    "customerName": "Sarah Jenkins",
    "customerPhone": "+15552345678",
    "customerEmail": "sarah.j@example.com",
    "destinationAddress": "742 Evergreen Terrace, Springfield",
    "destinationLat": 37.7749,
    "destinationLng": -122.4194,
    "totalAmount": 89.50,
    "isCod": false,
    "items": [
      {
        "sku": "SKU-DRESS-BLUE",
        "title": "Summer Blue Floral Dress",
        "quantity": 1,
        "unitPrice": 89.50
      }
    ]
  }'

Example 201 Created Response:

{
  "id": "1172d2b3-bc78-4c71-bd7e-6ea446173019",
  "orderNumber": "ORD-20261123-265937",
  "deliveryTenantId": "00000000-0000-0000-0000-000000000002",
  "status": "ORDER_CREATED",
  "totalAmount": 89.50,
  "isCod": false,
  "shipments": [
    {
      "id": "54bc2e31-8e01-44bb-9fa3-172152341999",
      "trackingNumber": "BEE-20261123-570221",
      "barcode": "PKG77260334",
      "status": "OrderCreated",
      "labelUrl": "https://delmax.24apps.in/api/v1/shipments/54bc2e31-8e01-44bb-9fa3-172152341999/label"
    }
  ]
}

Specifying a Custom Delivery Carrier

If your e-commerce store contracts with an independent carrier on DelMax instead of the default fleet, specify their Tenant ID in the request body or via header:

# Either pass in JSON body:
{
  "deliveryTenantId": "83f3dfd6-22a5-456d-ac7d-1eb5b134fcd9",
  ...
}

# OR pass via HTTP header:
delivery-tenantId: 83f3dfd6-22a5-456d-ac7d-1eb5b134fcd9

5. Tracking & Shipping Labels

A. Public Tracking API

Check consignment milestones and delivery status in real-time:

GET /api/v1/tracking/{trackingNumber}
curl -X GET "https://delmax.24apps.in/api/v1/tracking/BEE-20261123-570221"

Consignees can also view interactive visual tracking directly in any browser at:
https://delmax.24apps.in/track/BEE-20261123-570221

B. Thermal 4x6 Label Generation (QuestPDF)

Retrieve high-resolution, print-ready 4x6 inch thermal shipping labels generated with QuestPDF and QRCoder.

GET /api/v1/shipments/{shipmentId}/label

Returns standard application/pdf binary stream ready for direct thermal printer spooling (Zebra, Rollo, Dymo).

curl -X GET "https://delmax.24apps.in/api/v1/shipments/54bc2e31-8e01-44bb-9fa3-172152341999/label" \
  -H "X-Tenant-Code: delmax" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  --output shipping_label.pdf

6. Webhooks & Event Notification Engine

DelMax uses the transactional Outbox pattern to deliver idempotent, real-time HTTP POST notifications to your server whenever parcel states transition.

POST /api/v1/webhooks/subscriptions
curl -X POST "https://delmax.24apps.in/api/v1/webhooks/subscriptions" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "X-Tenant-Code: delmax" \
  -H "Content-Type: application/json" \
  -d '{
    "targetUrl": "https://mystore.com/api/delmax-webhook",
    "subscribedEvents": ["shipment.out_for_delivery", "shipment.delivered", "cod.collected"]
  }'

Supported Event Catalog

Event Type Trigger Moment Key Payload Data
order.created Consignment ingested and schema record verified. orderNumber, externalOrderId
shipment.manifested Hub warehouse scans item into outbound bag manifest. manifestId, hubCode
shipment.out_for_delivery Bee rider accepts trip and begins final mile stop. riderName, estimatedArrival
shipment.delivered Driver captures POD signature / photo at doorstep. signatureUrl, photoUrl, deliveredAt
cod.collected Rider verifies and accepts cash from customer. amountCollected, receiptNumber

Verifying HMAC-SHA256 Signatures

DelMax includes an X-DelMax-Signature header with every webhook delivery computed with your secret key. Verify it in Node.js:

const crypto = require('crypto');

function verifyWebhook(rawBody, signatureHeader, secretKey) {
  const expected = crypto
    .createHmac('sha256', secretKey)
    .update(rawBody)
    .digest('hex');
  return crypto.timingSafeEqual(Buffer.from(signatureHeader), Buffer.from(expected));
}

7. Multi-Language Integration Samples

Node.js / TypeScript Example

import axios from 'axios';

const DELMAX_URL = 'https://delmax.24apps.in/api/v1';
const TENANT = 'delmax';

async function ingestOrder() {
  // 1. Authenticate
  const authRes = await axios.post(`${DELMAX_URL}/clients/authenticate`, {
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET'
  }, { headers: { 'X-Tenant-Code': TENANT } });

  const token = authRes.data.accessToken;

  // 2. Post Order
  const orderRes = await axios.post(`${DELMAX_URL}/orders`, {
    source: 'API',
    externalOrderId: 'ORD-5541',
    customerName: 'Alex Rivera',
    customerPhone: '+15559871122',
    destinationAddress: '100 Market St, San Francisco, CA',
    destinationLat: 37.7925,
    destinationLng: -122.3995,
    totalAmount: 120.00,
    isCod: false,
    items: [{ sku: 'SKU-1', title: 'Smart Sensor', quantity: 1, unitPrice: 120.00 }]
  }, {
    headers: {
      'Authorization': `Bearer ${token}`,
      'X-Tenant-Code': TENANT
    }
  });

  console.log('Order Created:', orderRes.data.orderNumber);
}

Python 3 Example

import requests

DELMAX_BASE = "https://delmax.24apps.in/api/v1"
HEADERS = {"X-Tenant-Code": "delmax"}

# 1. Authenticate
auth_payload = {
    "clientId": "YOUR_CLIENT_ID",
    "clientSecret": "YOUR_CLIENT_SECRET"
}
auth_resp = requests.post(f"{DELMAX_BASE}/clients/authenticate", json=auth_payload, headers=HEADERS)
token = auth_resp.json()["accessToken"]

# 2. Ingest Order
HEADERS["Authorization"] = f"Bearer {token}"
order_payload = {
    "source": "API",
    "externalOrderId": "ORD-PY-99",
    "customerName": "Emma Watson",
    "customerPhone": "+15559091212",
    "destinationAddress": "500 Howard St, San Francisco, CA",
    "destinationLat": 37.7885,
    "destinationLng": -122.3962,
    "totalAmount": 45.00,
    "isCod": False,
    "items": [{"sku": "BOOK-01", "title": "Clean Architecture", "quantity": 1, "unitPrice": 45.00}]
}

resp = requests.post(f"{DELMAX_BASE}/orders", json=order_payload, headers=HEADERS)
print("Order Created:", resp.json())

8. HTTP Error Codes & Schemas

Code Status Meaning & Recommended Action
200 OK Success Request executed successfully.
201 Created Created New resource (order, webhook, client) successfully created.
400 Bad Request Validation Error Missing mandatory fields or malformed payload. Inspect message field.
401 Unauthorized Authentication Error Invalid or expired JWT token or invalid client credentials. Re-authenticate.
402 Payment Required Quota Exceeded Monthly delivery quota on current subscription plan has been reached. Upgrade tier.
403 Forbidden Insufficient Scope Attempted operation requires Admin/Operator roles.
409 Conflict Conflict Resource already exists (e.g. duplicate custom Client ID).
429 Too Many Requests Rate Limited Request threshold reached. Honor Retry-After response header.

9. Sandbox Test Accounts Matrix

Persona / Role Email / Username Password Tenant Code Scope
Platform SuperAdmin superadmin@bee-delivery.io SuperAdminBee2026!# * (Global) Full platform management & impersonation
DelMax Provider Admin admin@delmax.24apps.in BeeDevPass2026!# delmax Primary carrier fleet & dispatch
E-Commerce Shipper Admin orders@novaretail.com BeeDevPass2026!# nova_retail ECOM order generation & tracking
Driver / Rider Bee rider@acme-global.com BeeDevPass2026!# delmax Mobile app, POD & delivery execution
Snippet copied to clipboard!