Partner Shipping API
Integrate Haulstow delivery into your platform. Get quotes, create orders, track status, and receive real-time webhooks for delivery events across Accra.
https://www.haulstow.coAuthentication
All API requests require an x-partner-key header containing your API key. Keys are issued by the Haulstow admin team. Contact us at info@haulstow.co to request access.
curl -X POST https://www.haulstow.co/api/partner/shipping/quote \
-H "Content-Type: application/json" \
-H "x-partner-key: hst_abc123def456ghi789" \
-d '{"pickupAddress": "...", "deliveryAddress": "..."}'Get Quote
/api/partner/shipping/quoteCalculate a delivery price estimate between two addresses. Pricing is based on distance and vehicle type.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| pickupAddress | string | Required | Full pickup address |
| deliveryAddress | string | Required | Full delivery address |
| vehicleType | string | Optional | "bike" (default) or "minivan" |
| volumeTier | number | Optional | 1-3, for minivan orders only |
Example
curl -X POST https://www.haulstow.co/api/partner/shipping/quote \
-H "Content-Type: application/json" \
-H "x-partner-key: hst_abc123def456ghi789" \
-d '{
"pickupAddress": "Osu Oxford Street, Accra",
"deliveryAddress": "Achimota Mall, Accra",
"vehicleType": "bike"
}'Response
{
"distanceKm": 8.4,
"durationMinutes": 25,
"price": 18.50,
"currency": "GHS",
"vehicleType": "bike"
}Create Order
/api/partner/shipping/create-orderBook a delivery. If distanceKm and price are not provided, they are auto-calculated via Google Maps.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| pickupAddress | string | Required | Full pickup address |
| pickupLat | number | Optional | Pickup latitude |
| pickupLng | number | Optional | Pickup longitude |
| pickupContact | string | Optional | Pickup contact phone number |
| deliveryAddress | string | Required | Full delivery address |
| deliveryLat | number | Optional | Delivery latitude |
| deliveryLng | number | Optional | Delivery longitude |
| deliveryRecipient | string | Required | Recipient's full name |
| deliveryContact | string | Required | Recipient's phone number |
| cargoDescription | string | Optional | Description of items being delivered |
| quantity | number | Optional | Number of items |
| vehicleType | string | Optional | "bike" (default) or "minivan" |
| volumeTier | number | Optional | 1-3, for minivan orders only |
| distanceKm | number | Optional | Pre-calculated distance (skips Maps lookup) |
| price | number | Optional | Pre-calculated price (skips pricing) |
| paymentStatus | string | Optional | Payment status to set on the order |
| partnerOrderId | string | Optional | Your internal order ID for reference |
| clientId | string | Optional | Your customer/client identifier |
Example
curl -X POST https://www.haulstow.co/api/partner/shipping/create-order \
-H "Content-Type: application/json" \
-H "x-partner-key: hst_abc123def456ghi789" \
-d '{
"pickupAddress": "Osu Oxford Street, Accra",
"deliveryAddress": "Achimota Mall, Accra",
"deliveryRecipient": "Kwame Mensah",
"deliveryContact": "+233201234567",
"cargoDescription": "Electronics package",
"vehicleType": "bike",
"partnerOrderId": "ORD-2024-001"
}'Response
{
"orderId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"partnerId": "p9r8q7w6-e5t4-3210-zyxw-vu0987654321",
"status": "booked",
"price": 18.50,
"currency": "GHS",
"distanceKm": 8.4,
"trackingUrl": "https://www.haulstow.co/track/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}Order Status
/api/partner/shipping/status?orderId=UUIDCheck the current status of an order. Returns rider assignment info, delivery fee, and a tracking URL.
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| orderId | string (UUID) | Required | The order ID returned from create-order |
Example
curl "https://www.haulstow.co/api/partner/shipping/status?orderId=a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-H "x-partner-key: hst_abc123def456ghi789"Response
{
"orderId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "dispatched",
"paymentStatus": "paid",
"pickupAddress": "Osu Oxford Street, Accra",
"deliveryAddress": "Achimota Mall, Accra",
"deliveryRecipient": "Kwame Mensah",
"deliveryFee": 18.50,
"distanceKm": 8.4,
"riderName": "Kofi Asante",
"hasRider": true,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-15T10:45:00Z",
"trackingUrl": "https://www.haulstow.co/track/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}Statuses
Cancel Order
/api/partner/shipping/cancelCancel an order that has not yet been dispatched. Only works when the current status is "booked". Returns 409 Conflict if the order is already dispatched, delivered, or failed.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| orderId | string (UUID) | Required | The order ID to cancel |
Example
curl -X POST https://www.haulstow.co/api/partner/shipping/cancel \
-H "Content-Type: application/json" \
-H "x-partner-key: hst_abc123def456ghi789" \
-d '{
"orderId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}'Response
{
"success": true,
"orderId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "cancelled"
}Address Autocomplete
/api/partner/places/autocomplete?input=TEXTSearch for addresses in Ghana. Returns a list of matching place predictions powered by Google Places.
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| input | string | Required | Address search text |
Example
curl "https://www.haulstow.co/api/partner/places/autocomplete?input=Osu%20Oxford" \
-H "x-partner-key: hst_abc123def456ghi789"Response
{
"predictions": [
{
"placeId": "ChIJx8k9tmqKOxARkVcUnSN_wgg",
"description": "Oxford Street, Osu, Accra, Ghana"
},
{
"placeId": "ChIJy7k2tmqKOxARpVcUnSN_wgg",
"description": "Oxford Street Mall, Osu, Accra, Ghana"
}
]
}Place Details
/api/partner/places/details?placeId=IDGet the full address and coordinates for a place. Use the placeId from the autocomplete endpoint.
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| placeId | string | Required | Google Place ID from autocomplete results |
Example
curl "https://www.haulstow.co/api/partner/places/details?placeId=ChIJx8k9tmqKOxARkVcUnSN_wgg" \
-H "x-partner-key: hst_abc123def456ghi789"Response
{
"formattedAddress": "Oxford Street, Osu, Accra, Ghana",
"street": "Oxford Street",
"city": "Accra",
"state": "Greater Accra",
"country": "Ghana",
"zip": "",
"lat": 5.5560,
"lng": -0.1789
}Webhooks
Configure a webhook URL to receive real-time updates when an order status changes. Haulstow will send a POST request to your URL with a JSON payload. Failed deliveries are retried up to 3 times.
Events
order.dispatchedorder.deliveredorder.failedPayload
{
"event": "order.delivered",
"orderId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"data": {
"status": "delivered",
"riderName": "Kofi Asante",
"deliveredAt": "2025-01-15T11:30:00Z"
},
"timestamp": "2025-01-15T11:30:05Z"
}Signature Verification
Every webhook request includes an x-haulstow-signature header. Verify it using your webhook secret to ensure the request is authentic.
// Node.js verification example
const crypto = require('crypto');
function verifyWebhook(req, rawBody) {
const secret = process.env.HAULSTOW_WEBHOOK_SECRET;
const signature = crypto
.createHmac('sha256', secret)
.update(rawBody)
.digest('hex');
const expected = `sha256=${signature}`;
return req.headers['x-haulstow-signature'] === expected;
}Error Handling
All errors return a JSON object with an error field and an appropriate HTTP status code.
| Status | Meaning | Example |
|---|---|---|
| 400 | Bad Request | Missing required fields |
| 401 | Unauthorized | Invalid or missing API key |
| 404 | Not Found | Order not found |
| 409 | Conflict | Cancelling a non-booked order |
| 422 | Unprocessable | Distance out of service range |
| 500 | Server Error | Internal server error |
Error Response Format
{
"error": "Missing required field: deliveryContact"
}