Build on the LastMile Public API
Everything a shipping company needs to run its own website or app on top of its LastMile account: create and track shipments, quote prices, check coverage, manage merchants and receive status updates.
https://api.goldrock.live/api/public/v1curl "https://api.goldrock.live/api/public/v1/auth/me" \
-H "X-API-Key: lmc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "X-API-Secret: YOUR_API_SECRET"const response = await fetch("https://api.goldrock.live/api/public/v1/auth/me", {
method: "GET",
headers: {
"X-API-Key": "lmc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"X-API-Secret": "YOUR_API_SECRET"
},
});
const data = await response.json();
console.log(response.status, data);<?php
$url = 'https://api.goldrock.live/api/public/v1/auth/me';
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: lmc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'X-API-Secret: YOUR_API_SECRET',
],
]);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($status, json_decode($result, true));import requests
response = requests.request(
"GET",
"https://api.goldrock.live/api/public/v1/auth/me",
headers={
"X-API-Key": "lmc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"X-API-Secret": "YOUR_API_SECRET",
},
timeout=30,
)
print(response.status_code, response.json())Two ways to connect
API key and secret
Send X-API-Key and X-API-Secret from your server. Best for websites and server-to-server integrations. Each key has its own scopes.
X-API-Key: lmc_live_…X-API-Secret: …
Username and password
Sign in with a dashboard user (including a merchant login) and send a bearer token. Best when you act as a specific user, or for a merchant portal.
POST /auth/loginAuthorization: Bearer …
What you can build
Tracking page
Show the status timeline of any shipment by its tracking number.
Price calculator
Quote the fee for a route and parcel before the customer orders.
Coverage checker
Tell visitors whether you deliver to their city, with names in Arabic or English.
Order form
Validate the address, then create the shipment with a safe retry.
Merchant portal
Let each merchant sign in and see only its own shipments.
Live updates
Receive signed webhooks when a shipment changes status.