Request and response examples
Copyable, end-to-end Partner API payloads for the production contract.
All examples below are relative to your assigned base URL, such as https://{merchant}.sandbox.partner-api.egyptlimo.com/api/v1. Replace every placeholder. Except token issuance, every request needs the signed headers in Authentication. For clarity, those repeated headers are abbreviated as <signed headers>.
The payloads illustrate the contract; prices, vehicle classes, quote IDs, and dates are examples, not live availability. For an isolated link create → customer completion → blocked-payment example, see Sandbox booking-link simulation.
1. Create an access token
POST /integration/oauth2/token
Content-Type: application/json{
"grant_type": "client_credentials",
"client_id": "cli_abc123",
"client_secret": "sec_…",
"scope": "catalog:read places:read quotes:read quotes:confirm bookings:create bookings:read bookings:update bookings:cancel"
}{
"access_token": "tkn_…",
"token_type": "Bearer",
"expires_in": 900,
"scope": "catalog:read places:read quotes:read quotes:confirm bookings:create bookings:read bookings:update bookings:cancel"
}2. Read capabilities and search a place
GET /integration/capabilities
<signed headers>{
"version": "v1",
"cancellation_version": "v1",
"environment": "sandbox",
"features": ["quotes", "quote_confirmation", "booking_create", "booking_list", "booking_read", "booking_change_requests", "cancellation_quotes", "booking_cancel", "booking_events", "webhooks"],
"payment_features": ["refund_preview", "manual_refund_request", "invoice_read"]
}GET /integration/places/search?query=Cairo%20International%20Airport&limit=8
<signed headers>{
"query": "Cairo International Airport",
"results": [{
"place_id": "place_…",
"name": "Cairo International Airport",
"formatted_address": "Cairo International Airport, Cairo, Egypt",
"latitude": 30.1219,
"longitude": 31.4056
}]
}3. Create and confirm a quote
POST /integration/quotes
Content-Type: application/json
<signed headers>{
"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,
"service_type": "Flat-Rate",
"partner_reference": "AGENCY-QUOTE-1001",
"extras": [{ "id": "tex_<opaque-id-from-catalog>", "quantity": 1 }]
}{
"quote_id": "qte_…",
"status": "active",
"expires_at": "2026-11-10T14:45:00.000000Z",
"currency": "USD",
"price_includes_extras": true,
"price_scope": "all_inclusive",
"options": [{
"vehicle_class": "Business Sedan",
"vehicle_name": "Business Sedan",
"base_price": "45.00",
"extras_total": "10.00",
"extras": [{ "id": "tex_<opaque-id-from-catalog>", "quantity": 1, "unit_price": 10.00, "line_total": 10.00 }],
"price": "55.00",
"estimated_duration_mins": 60
}],
"partner": { "partner_reference": "AGENCY-QUOTE-1001", "cost_center": "" },
"route": { "pickup": { "name": "Cairo International Airport", "lat": 30.1219, "lng": 31.4056 }, "dropoff": { "name": "Giza Pyramids", "lat": 29.9773, "lng": 31.1325 }, "pickup_datetime": "2026-11-10T14:30:00Z", "passengers": 2, "service_type": "Flat-Rate" },
"extras": [{ "id": "tex_<opaque-id-from-catalog>", "quantity": 1 }],
"payment_options": [{ "method": "invoice", "label": "Consolidated partner settlement; no customer checkout payment" }],
"booking_requirements": ["quote_id", "vehicle_class", "partner_reference", "passenger.name", "passenger.phone"]
}Confirmation is optional intent recording before booking:
POST /integration/quotes/qte_…/confirm
Idempotency-Key: 5ce6b254-c98b-4c05-914d-2b2c70d1c920
<signed headers>It returns the quote object plus "next_action": "create_booking".
4. Create, read, and list bookings
POST /integration/bookings
Content-Type: application/json
Idempotency-Key: 79ddf1c3-a1c5-4d6e-8c47-5e0dc4af7c11
<signed headers>{
"quote_id": "qte_…",
"vehicle_class": "Business Sedan",
"partner_reference": "AGENCY-BOOKING-1001",
"passenger": { "name": "Ahmed Ali", "phone": "+201000000000", "email": "ahmed@example.com", "preferred_contact_method": "whatsapp", "name_on_sign": "Mr Ahmed Ali" },
"payment_method": "invoice",
"flight_number": "MS777",
"special_requests": "Meet at arrival hall Gate 3"
}{
"booking_id": "pbk_…",
"booking_reference": "BK-00000123",
"partner_reference": "AGENCY-BOOKING-1001",
"status": "pending",
"currency": "USD",
"total_price": "55.00",
"payment_method": "invoice",
"settlement": { "type": "partner_consolidated_invoice", "collection": "partner", "pay_at_checkout": false },
"cash_collection": { "required": false },
"pickup_datetime": "2026-11-10 14:30:00",
"created_at": "2026-10-03T10:00:00.000000Z",
"updated_at": "2026-10-03T10:00:00.000000Z"
}GET /integration/bookings?status=confirmed&limit=25
<signed headers>{ "items": [{ "booking_id": "pbk_…", "status": "confirmed", "partner_reference": "AGENCY-BOOKING-1001" }], "count": 1, "limit": 25, "next_cursor": null }Use GET /integration/bookings/{booking_id}?include=all for route, passenger, flight, vehicle, pricing, extras, payment, invoice, documents, timeline, webhooks, and guide details.
5. Change, cancel, and refund
PATCH /integration/bookings/pbk_…
Idempotency-Key: 6333e468-3b7b-4dc6-8cb2-f2b865222566
Content-Type: application/json
<signed headers>{ "pickup_datetime": "2026-11-10T16:00:00Z", "flight_number": "MS779", "reason": "Flight rescheduled" }Live booking changes can return 202 with status: pending_approval; wait for booking.update_approved/booking.update_rejected or re-read the booking.
POST /integration/bookings/pbk_…/cancellation-quote
Idempotency-Key: 144d1315-bfb3-4f7d-a81b-d6300c6d4a0d
<signed headers>The response contains booking_id, the applicable policy version, refund/cancellation calculation, and expiry. Then call POST /integration/bookings/pbk_…/cancel with the same signing pattern and an optional reason_code.
For refunds, use GET /integration/bookings/pbk_…/refund-preview, then POST /integration/bookings/pbk_…/refunds with refunds:create, idempotency, and optionally { "amount": 12.50, "reason": "Customer cancellation" }.
6. Create a booking link
POST /integration/booking-links
Idempotency-Key: 119bdd4a-ee0e-47f0-8275-66bcbe1d78e4
Content-Type: application/json
<signed headers>{
"start_location": "Cairo International Airport",
"end_location": "Marriott Mena House, Giza",
"start_datetime": "2026-11-10T08:00:00Z",
"passengers_count": 2,
"customer_first_name": "Ahmed",
"customer_last_name": "Hassan",
"customer_email": "ahmed@example.com",
"customer_phone": "+201001234567",
"partner_reference": "AGENCY-LINK-1001",
"editable_fields": ["customer_email", "customer_phone"],
"expiry_hours": 48
}{
"booking_id": 123,
"link_token": "…",
"link_url": "https://booking.egyptlimo.com/booking/complete/…",
"expires_at": "2026-11-12T08:00:00.000000Z",
"editable_fields": ["customer_email", "customer_phone"],
"status": "active",
"promo_code": null,
"allow_vehicle_selection": true,
"allow_discount": false,
"discount_percent": null,
"partner_reference": "AGENCY-LINK-1001"
}7. Webhook subscription and deliveries
PATCH /integration/webhook-subscription
Idempotency-Key: 31de54a7-f4d4-4d43-820d-bb65a511ad13
Content-Type: application/json
<signed headers>{ "url": "https://partner.example.com/egyptlimo/webhooks", "status": "enabled", "events": ["booking.confirmed", "driver.arrived", "trip.completed"] }{ "status": "enabled", "url": "https://partner.example.com/egyptlimo/webhooks", "events": ["booking.confirmed", "driver.arrived", "trip.completed"], "supported_events": ["booking.created", "booking.confirmed", "…"] }See Webhooks for the outbound payload, signature, retries, and replay API.
Error example
{
"error": {
"code": "invalid_quote",
"message": "Quote is invalid or expired."
},
"correlation_id": "cor_…"
}Read Errors, retries, and support before implementing retry behavior.