Authentication and request signing
Obtain an access token and sign each protected Partner API request.
All Partner API credentials are server-side secrets. Do not place them in browser, mobile, source-control, analytics, or support logs.
1. Obtain a token
POST /integration/oauth2/token is the only gateway endpoint that is not signed. Send grant_type=client_credentials, client_id, client_secret, and optionally a space-delimited scope string.
{
"grant_type": "client_credentials",
"client_id": "cli_…",
"client_secret": "sec_…",
"scope": "catalog:read quotes:read bookings:create bookings:read"
}The response contains access_token, token_type, expires_in, and the effective scope. Tokens currently expire after 15 minutes. Request a new token before expiry.
2. Sign every protected request
Every request after token issuance, including GET and /health, needs these headers:
Authorization: Bearer <access_token>
X-Merchant-Id: <merchant_id>
X-Key-Id: <signing_key_id>
X-Timestamp: <ISO-8601 UTC timestamp>
X-Nonce: <unique value, never reused>
X-Signature: <signature>
X-Correlation-Id: <your optional trace ID>For HMAC clients, sign this newline-separated canonical string with HMAC-SHA256 using the signing secret:
HTTP_METHOD
/api/v1/path
canonical_query_string
SHA256(raw_request_body)
X-Timestamp
X-Nonce
X-Merchant-IdThe path includes /api/v1; the query string is percent-encoded and key-sorted. Hash the exact raw body bytes; for a request with no body, use SHA-256 of zero bytes (e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855), not a blank canonical field. Send the HMAC in hexadecimal, base64, or prefixed with sha256=. The server permits five minutes of clock skew and rejects a reused nonce.
Minimal Node.js HMAC example (signature v1)
This example signs the exact JSON bytes it sends. Do not re-serialize the object after calculating the signature. Store all secrets in your server's secret manager.
import { createHash, createHmac, randomUUID } from 'node:crypto';
const baseUrl = process.env.EGYPTLIMO_BASE_URL;
const merchantId = process.env.EGYPTLIMO_MERCHANT_ID;
const keyId = process.env.EGYPTLIMO_KEY_ID;
const signingSecret = process.env.EGYPTLIMO_SIGNING_SECRET;
const accessToken = process.env.EGYPTLIMO_ACCESS_TOKEN;
const path = '/api/v1/integration/quotes';
const method = 'POST';
const body = JSON.stringify({
pickup_location: { lat: 30.1219, lng: 31.4056, address: 'Cairo International Airport' },
dropoff_location: { lat: 29.9773, lng: 31.1325, address: 'Giza Pyramids' },
pickup_datetime: '2026-11-10T14:30:00Z',
passengers: 2,
});
const timestamp = new Date().toISOString();
const nonce = randomUUID();
const bodyHash = createHash('sha256').update(body, 'utf8').digest('hex');
const canonical = [method, path, '', bodyHash, timestamp, nonce, merchantId].join('\n');
const signature = createHmac('sha256', signingSecret).update(canonical, 'utf8').digest('hex');
const response = await fetch(new URL(path, baseUrl), {
method,
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'X-Merchant-Id': merchantId,
'X-Key-Id': keyId,
'X-Timestamp': timestamp,
'X-Nonce': nonce,
'X-Signature': signature,
'X-Correlation-Id': `cor_${randomUUID()}`,
},
body,
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.error?.message ?? 'Unknown error'}`);
console.log(result);The canonical query line is empty above. For a GET with query parameters, sort the parameter names, use RFC 3986 percent encoding (%20, not + for spaces), and sign exactly the query you send. The server also supports opt-in signature v2 (X-Signature-Version: v2), which recursively sorts JSON keys before hashing; use it only when enabled for your client and tested end-to-end. Unless instructed otherwise, use v1 and the raw-body hash shown here.
Idempotency
All state-changing calls require Idempotency-Key: quote confirmation, booking/link creation, changes, cancellation, refunds, webhook subscription changes, and webhook replay. Reuse a key only for a retry of the identical method, path, and raw body. A matching replay returns the original response; a changed body returns 409.
Network controls
Production clients require an approved source-IP allowlist. Sandbox and production have separate hosts, client credentials, signing secrets, tokens, and webhook secrets.