Sandbox booking-link simulation
Test the complete link handoff without creating a live trip, customer record, or payment.
Sandbox booking links are simulations, not live reservations. They have an sbl_ token, live in a dedicated Sandbox link table, and complete into partner_api_sandbox_bookings. No production bookings or booking_links row is created. Payment initiation always returns 409.
Create a Sandbox Quote first. EgyptLimo supplies the route, selected vehicle, itemized Extras, currency, and all-inclusive price. A Sandbox link remains a simulation, not an availability or fulfillment guarantee.
1. Create a simulation link
POST /integration/booking-links requires bookings:create, signed headers, and a unique Idempotency-Key. Use your Sandbox base URL and Sandbox credentials.
POST /api/v1/integration/booking-links HTTP/1.1
Authorization: Bearer <sandbox_access_token>
X-Merchant-Id: <merchant_id>
X-Key-Id: <signing_key_id>
X-Timestamp: 2026-11-09T10:00:00Z
X-Nonce: <unique_nonce>
X-Signature: <hmac_signature>
Idempotency-Key: <unique_key_for_this_request>
Content-Type: application/json{
"quote_id": "qte_7b6a…",
"vehicle_class": "Business Sedan",
"partner_reference": "SANDBOX-LINK-1001",
"expiry_hours": 24,
"customer_first_name": "Ahmed"
}quote_id, vehicle_class, and a unique partner_reference are required. The Quote must belong to the Sandbox client, be unexpired, and contain an all-inclusive positive-price option. Do not submit route, pickup, price, currency, vehicle ID, discount, or guide overrides; they return 422 quote_override_not_allowed. expiry_hours is 1–720; default 72.
201 Created
{
"booking_id": null,
"link_token": "sbl_a1b2…",
"link_url": "https://booking.egyptlimo.com/booking/complete/sbl_a1b2…",
"expires_at": "2026-11-10T10:00:00+00:00",
"editable_fields": ["customer_first_name", "customer_last_name", "customer_email", "customer_phone", "flight_number", "name_on_sign", "notes"],
"status": "active",
"partner_reference": "SANDBOX-LINK-1001",
"allow_vehicle_selection": false,
"allow_discount": false,
"quote_id": "qte_7b6a…",
"price": "125.00",
"currency": "USD",
"pricing_source": "egyptlimo_quote",
"environment": "sandbox",
"simulation_only": true
}booking_id is null until the customer completes the link. The link_url is customer-sensitive: do not put it in public analytics, logs, or screenshots shared outside your team.
2. Retrieve and list links
GET /integration/booking-links/{token} and GET /integration/booking-links?status=active&per_page=25 require bookings:read and signed headers. A client can see only its own Sandbox links, even if it knows another client's token. The list returns data and pagination (current_page, per_page, total). Supported status filters: active, used, expired, revoked. A link whose expiry has passed is reported as expired even before a cleanup job runs.
200 OK single-link response
{
"booking_link": {
"id": 42,
"booking_id": null,
"token": "sbl_a1b2…",
"link_url": "https://booking.egyptlimo.com/booking/complete/sbl_a1b2…",
"partner_reference": "SANDBOX-LINK-1001",
"expires_at": "2026-11-10T10:00:00+00:00",
"completed_at": null,
"editable_fields": ["customer_first_name", "customer_last_name", "customer_email", "customer_phone", "flight_number", "name_on_sign", "notes"],
"status": "active",
"allow_vehicle_selection": false,
"allow_discount": false,
"created_at": "2026-11-09T10:00:00+00:00"
},
"booking": {
"id": null,
"status": "WaitingCustomer",
"service_type": "Distance-Based",
"start_location": "Cairo International Airport",
"end_location": "Giza Pyramids",
"start_datetime": "2026-11-10T14:30:00+00:00",
"pickup_date": "2026-11-10",
"pickup_time": "14:30",
"passengers_count": 2,
"price": 125,
"discount_amount": 0,
"currency_code": "USD",
"customer": { "first_name": "Ahmed", "last_name": null, "email": null, "phone": null }
},
"environment": "sandbox",
"simulation_only": true
}3. Complete as a customer
The public checkout page calls GET /api/v1/booking-links/{token} and POST /api/v1/booking-links/{token}/complete. These public routes use the link token, not Partner API credentials. The customer must provide a first name and phone. The link is single-use; a second completion returns 409.
{
"customer_first_name": "Ahmed",
"customer_last_name": "Hassan",
"customer_email": "ahmed@example.com",
"customer_phone": "+201001234567"
}{
"success": true,
"data": {
"booking_id": "sbk_…",
"status": "pending",
"message": "Sandbox simulation completed. No live booking or payment was created.",
"requires_admin_approval": true,
"approval": { "user_message": "Sandbox simulation completed. No live booking or payment was created." },
"sandbox": true,
"simulation_only": true
}
}The sbk_ ID is a Sandbox record. It is not a dispatchable trip. POST /api/v1/booking-links/{token}/initiate-payment returns 409, including after completion. A customer-supplied price is rejected with 422; completion cannot change EgyptLimo's quoted amount.
Failure and isolation cases
| Case | Response | What to do |
|---|---|---|
| Missing, expired, or legacy quote | 422 requote_required | Create a fresh all-inclusive EgyptLimo Quote. |
| Partner-authored route, price, currency, or vehicle | 422 quote_override_not_allowed | Remove the override; choose the quoted option. |
Reused partner_reference for the client | 409 duplicate_reference | Reuse the original link or choose a new business reference. |
| Another client reads your token | 404 not_found | Never share signing credentials or link tokens. |
| Public link expired or already completed | 404 on read; 409 on completion | Create a new link. |
| Payment attempted | 409 | Sandbox has no real payment. |
For production, use Live booking links. Environment switching requires different host and credentials; changing only a request flag cannot promote a Sandbox record.