Developers
Car rental

Create a booking

Book through the same journey as the rental website: driver, customer, hold, three payment modes, rejections.

POST /car-rental/bookings books a vehicle through the same journey as the rental website: what the API creates is exactly what a visitor would have created — module reservation, vehicle held, ERP customer, notice to the agency — with the API source.

Required key: rental_bookings:write (and payments:write for an already-collected booking). Plan: Car rental module (CAR_RENTAL); the Website module (RENTAL_WEBSITE) only if you name a site.

1. With or without a rental website

A website is not required. Without siteId, any active vehicle of the fleet can be booked, without paid options. With siteId, the API uses the website’s catalogue: the vehicle must be published on it (GET /car-rental/sites/{id}/vehicles) and its paid options become available.

In both cases the API channel settings apply — set in the application (Car rental › Settings › API booking) and readable here:

GET/car-rental/booking-settings

curl 'https://quosuite.com/api/public/v1/quosuite/car-rental/booking-settings' \
  -H "Authorization: Bearer $QUOSUITE_API_KEY"
SettingEffect
enabledbooking through the API open or closed (BOOKING_DISABLED otherwise)
paymentpayment policy: pay when booking (total, % or fixed amount) or request accepted then payment link — § 3
payAtAgencyrequests without payment (AGENCY) accepted in “pay when booking” mode
holdMinutes, minLeadHourspayment hold duration, minimum lead time before pick-up
agencyIdsbranches open to the API (empty = all)
cancellationPolicyrefund applied by default on cancellation
notifyCustomerdoes QuoSuite email the customer (acknowledgement, payment link, confirmation)? When false, pass paymentLink.url on yourself.

2. Create

POST/car-rental/bookings

# One key per operation, reused as is on every retry.
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/car-rental/bookings' \
  -H "Authorization: Bearer $QUOSUITE_API_KEY" \
  -H 'Idempotency-Key: 3f1c2a9e-5b7d-4e8a-9c1f-2d6b8e4a7c30' \
  -H 'Content-Type: application/json' \
  -d '{
  "vehicleId": "0b3c5d7e-9f1a-4b2c-8d4e-6f7a8b9c0d1e",
  "startAt": "2026-12-20T09:00:00Z",
  "endAt": "2026-12-27T09:00:00Z",
  "pickupAgencyId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "driver": {
    "firstName": "Sami",
    "lastName": "Ben Ali",
    "email": "sami@example.tn",
    "phone": "+216 20 000 000",
    "birthDate": "1990-04-12",
    "drivingLicenseNumber": "TN-123456",
    "drivingLicenseIssuedAt": "2012-05-01",
    "flightNumber": "TU 712"
  },
  "payment": {
    "mode": "AGENCY"
  },
  "acceptTerms": true
}'

What creation does, in order:

  1. Price recalculated by the module — an amount you send is never reused;
  2. minimum lead time and period checked, branches open to the channel;
  3. driver checked: required fields, minimum age, licence seniority and validity until return (Car Rental policy);
  4. ERP customer: the one in customerId, otherwise found by the driver’s email (case-insensitive), otherwise created — its record is completed, never overwritten;
  5. vehicle held: the module reservation and the online booking are created in one transaction, after an availability check under lock;
  6. depending on payment: request to the agency, payment link, or immediate posting.

3. The payment policy

payment.flow says how the workspace gets paid:

  • PAY_ON_BOOKING — payment when booking: onBooking is the total, a percentage or a fixed amount (deposit). rules.dueOnBooking from POST /car-rental/quotes gives the exact amount.
  • REQUEST — the booking is a request: nothing is paid, the vehicle is held for requestTtlHours (without an answer, the request expires). The agency — or you, through the API — accepts it by choosing the payment term, or refuses it.
payment.modeWhenWhat happensStatus
AGENCYREQUEST, or PAY_ON_BOOKING with payAtAgencyrequest: vehicle held, nothing is invoicedREQUESTED
ONLINEPAY_ON_BOOKINGpayment link for the deposit or the total (paymentLink.url), vehicle held holdMinutesPENDING_PAYMENT
PREPAIDalwaysalready collected by you (total or deposit)CONFIRMED

What the payment produces in the ERP:

  • Total: agreement, validated invoice and allocated payment, together.
  • Deposit: booking confirmed, the deposit is an advance on the booking — no invoice; it follows the agreement and the agreement’s invoice allocates it. The balance (amounts.balanceDue) is paid at the agency, or recorded with POST …/payments.

After an advance has been posted, a balance payment adds a receipt; it does not automatically create an agreement or invoice. Prepare the agreement and invoice it in the ERP. Check documents.* rather than inferring document availability from erp.posted.

A PREPAID booking requires payment.reference; payment.amount defaults to the total and cannot exceed it (422 BUSINESS_RULE_VIOLATION, detail.rule: PAYMENT_AMOUNT_MISMATCH):

POST/car-rental/bookings

# One key per operation, reused as is on every retry.
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/car-rental/bookings' \
  -H "Authorization: Bearer $QUOSUITE_API_KEY" \
  -H 'Idempotency-Key: 3f1c2a9e-5b7d-4e8a-9c1f-2d6b8e4a7c30' \
  -H 'Content-Type: application/json' \
  -d '{
  "vehicleId": "0b3c5d7e-9f1a-4b2c-8d4e-6f7a8b9c0d1e",
  "startAt": "2026-12-20T09:00:00Z",
  "endAt": "2026-12-27T09:00:00Z",
  "driver": {
    "firstName": "Sami",
    "lastName": "Ben Ali",
    "email": "sami@example.tn",
    "birthDate": "1990-04-12",
    "drivingLicenseNumber": "TN-123456",
    "drivingLicenseIssuedAt": "2012-05-01"
  },
  "payment": {
    "mode": "PREPAID",
    "reference": "PSP-778812",
    "amount": 250,
    "method": "CARD"
  },
  "acceptTerms": true
}'

4. Accept or refuse a request

POST/car-rental/bookings/{id}/accept

# One key per operation, reused as is on every retry.
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/car-rental/bookings/aac39e3a-0c40-44b2-8697-b597f357c5a9/accept' \
  -H "Authorization: Bearer $QUOSUITE_API_KEY" \
  -H 'Idempotency-Key: 3f1c2a9e-5b7d-4e8a-9c1f-2d6b8e4a7c30' \
  -H 'Content-Type: application/json' \
  -d '{
  "term": {
    "type": "PERCENT",
    "value": 30
  },
  "deadlineHours": 48
}'

term: FULL, PERCENT (value in %), FIXED (value in the workspace currency, capped at the total) or NONE (confirmed without payment, paid at the agency) — default: payment.onAcceptance. A payment link for that amount is issued (paymentLink) and sent to the customer; the vehicle stays held until holdExpiresAt (never past pick-up). Paid: CONFIRMED; otherwise EXPIRED, vehicle released.

The link opens the workspace’s payment page (online providers, bank transfer with proof): it works without a website.

POST/car-rental/bookings/{id}/refuse

# One key per operation, reused as is on every retry.
curl -X POST 'https://quosuite.com/api/public/v1/quosuite/car-rental/bookings/aac39e3a-0c40-44b2-8697-b597f357c5a9/refuse' \
  -H "Authorization: Bearer $QUOSUITE_API_KEY" \
  -H 'Idempotency-Key: 3f1c2a9e-5b7d-4e8a-9c1f-2d6b8e4a7c30' \
  -H 'Content-Type: application/json' \
  -d '{
  "reason": "Vehicle out of service"
}'

5. Refusals

Statusdetail.ruleCause
409 CONFLICTUNAVAILABLEvehicle taken between search and booking
422 BUSINESS_RULE_VIOLATIONDRIVER_INVALIDdriver refused — detail.problems says why (age, licence…)
422PAYMENT_MODEmode refused by the policy (ONLINE in request mode, AGENCY without payAtAgency)
422BOOKING_DISABLEDbooking through the API closed in the settings
422LEAD_TIMEpick-up too soon (minimum lead time)
422TERMS_REQUIREDacceptTerms missing or false
422AGENCY_REQUIRED, AGENCY_NOT_OFFERED, VEHICLE_NOT_AT_AGENCYbranch missing, not open to the channel, or not where the vehicle leaves from
422OPTIONS_REQUIRE_SITE, UNKNOWN_OPTIONoptions without siteId; option outside the website’s catalogue
422NOT_REQUESTED, PAYMENT_TERM, DEADLINE_TOO_SHORTaccept / refuse something other than a request; invalid term; pick-up too soon for a link
422 BUSINESS_RULE_VIOLATIONPAYMENT_AMOUNT_MISMATCHprepaid amount above the quote total, or later payment above the remaining balance
409 CONFLICTPAYMENT_REFERENCE_USED, ALREADY_PAID, NOT_PAYABLEreference used on another booking, booking fully paid, or payment on a cancelled/expired booking
403 API_MODULE_UNAVAILABLE—siteId without the Website module
404 NOT_FOUND—unknown vehicle (or not published on the named website), unknown customer or website

6. Next

A payment received elsewhere is recorded (POST …/payments, deposit or balance), the vehicle is handed over (POST …/pickup) then returned (POST …/return): see Track a booking.