Developer Documentation
API Documentation
Integrate KingdomBridge shipping capabilities into your application with our REST API
Authentication
All API requests require authentication using an API key. Include your key in the Authorization header:
Authorization: Bearer your_api_key_hereGet your API key: Navigate to Settings → API Keys in your dashboard to generate a new API key.
API Endpoints
POST
/api/shipmentsAuth Required
Create a new shipment
Request Body:
{
"sender_name": "string",
"sender_email": "string",
"sender_phone": "string",
"recipient_name": "string",
"recipient_phone": "string",
"recipient_address": "string",
"recipient_city": "string",
"pickup_city": "string",
"courier_id": "string",
"package_weight": "number",
"items_description": "string"
}Response:
{
"id": "shipment_123",
"tracking_code": "KB1A2B3C",
"status": "pending",
"total_cost": 450
}GET
/api/shipments/:idAuth Required
Get shipment details by ID
Response:
{
"id": "shipment_123",
"tracking_code": "KB1A2B3C",
"status": "in_transit",
"sender_name": "John Doe",
"recipient_name": "Jane Smith",
"total_cost": 450,
"created_date": "2026-02-26T10:00:00Z"
}GET
/api/shipments/track/:codeTrack shipment by tracking code
Response:
{
"tracking_code": "KB1A2B3C",
"status": "in_transit",
"current_location": "Beitbridge Border",
"estimated_delivery": "2026-03-01"
}GET
/api/couriersList all available couriers
Response:
[
{
"id": "courier_123",
"company_name": "Swift Logistics",
"average_rating": 4.8,
"verification_status": "verified",
"pricing": {
"per_kg_rate": 35
}
}
]POST
/api/tracking-updatesAuth Required
Add tracking update (Courier only)
Request Body:
{
"shipment_id": "string",
"status": "string",
"location": "string",
"latitude": "number",
"longitude": "number",
"message": "string"
}Code Examples
import { base44 } from '@/api/base44Client';
// Create a shipment
const shipment = await base44.entities.Shipment.create({
sender_name: "John Doe",
recipient_name: "Jane Smith",
pickup_city: "Johannesburg",
recipient_city: "Harare",
package_weight: 5.5,
courier_id: "courier_123"
});
// Track a shipment
const tracking = await base44.entities.Shipment.filter({
tracking_code: "KB1A2B3C"
});
// List couriers
const couriers = await base44.entities.Courier.list();Rate Limits & Best Practices
Rate Limits
- • 100 requests per minute
- • 5,000 requests per hour
- • 50,000 requests per day
Best Practices
- • Cache responses when possible
- • Use webhooks for real-time updates
- • Implement exponential backoff on errors
- • Keep API keys secure