Renta Docs

Bookings API

Create, update, extend, cancel bookings, and swap line items.

The Bookings API handles the complete booking lifecycle — from creation through completion or cancellation.

Booking Statuses

StatusDescription
pendingCreated but not yet confirmed/paid
confirmedPayment received, booking confirmed
activeCustomer has picked up the rental
completedRental returned, booking closed
cancelledBooking cancelled

List Bookings

GET /v1/bookings

Query Parameters:

ParameterTypeDescription
statusstringFilter by status
customer_idstringFilter by customer
pickup_date_fromstringFilter bookings with pickup date ≥ this value (ISO 8601)
pickup_date_tostringFilter bookings with pickup date ≤ this value (ISO 8601)
cursorstringPagination cursor
limitintegerResults per page (1–100, default 20)
// List confirmed bookings
const bookings = await renta.bookings.list({ status: 'confirmed' });

// Filter by date range
const julyBookings = await renta.bookings.list({
  pickup_date_from: '2026-07-01T00:00:00Z',
  pickup_date_to: '2026-07-31T23:59:59Z',
});

// Auto-paginate
for await (const booking of renta.bookings.list()) {
  console.log(`${booking.id}: ${booking.status}`);
}
curl "https://api.getrenta.io/v1/bookings?status=confirmed&limit=10" \
  -H "Authorization: Bearer renta_sk_live_..."

Response:

{
  "data": [
    {
      "id": "bk_def456",
      "status": "confirmed",
      "customer_id": "cust_abc",
      "customer": {
        "id": "cust_abc",
        "name": "John Doe",
        "email": "john@example.com",
        "phone": "+1234567890"
      },
      "pickup_date": "2026-07-01T09:00:00Z",
      "return_date": "2026-07-03T17:00:00Z",
      "pickup_location_id": "loc_main",
      "half_day": false,
      "subtotal": 10000,
      "tax_amount": 800,
      "discount_amount": 0,
      "total": 10800,
      "amount_paid": 10800,
      "amount_owed": 0,
      "coupon_id": null,
      "notes": null,
      "line_items": [
        {
          "id": "li_001",
          "fleet_item_id": "fi_abc123",
          "fleet_item_name": "Trail Blazer 500",
          "quantity": 1,
          "unit_price": 5000,
          "override_price": null,
          "line_total": 10000
        }
      ],
      "addons": [
        {
          "id": "ba_001",
          "addon_id": "addon_helmet",
          "addon_name": "Helmet",
          "quantity": 1,
          "unit_price": 500,
          "line_total": 500
        }
      ],
      "created_at": "2026-03-31T12:00:00Z",
      "updated_at": "2026-03-31T12:05:00Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Get Booking

GET /v1/bookings/:id
const booking = await renta.bookings.get('bk_def456');
console.log(booking.status); // "confirmed"
console.log(booking.customer.name); // "John Doe"
console.log(booking.adjustments); // price adjustments
curl https://api.getrenta.io/v1/bookings/bk_def456 \
  -H "Authorization: Bearer renta_sk_live_..."

The single-booking response includes an adjustments array with any price adjustments applied:

{
  "id": "bk_def456",
  "status": "confirmed",
  "customer": {
    "id": "cust_abc",
    "name": "John Doe",
    "email": "john@example.com",
    "phone": "+1234567890"
  },
  "adjustments": [
    {
      "id": "adj_001",
      "type": "dollar",
      "amount": -500,
      "description": "Loyalty discount",
      "created_at": "2026-03-31T12:05:00Z"
    }
  ]
}

Create Booking

POST /v1/bookings

Body Parameters:

ParameterTypeRequiredDescription
customer_idstring✅Customer ID
pickup_datestring✅Pickup date (ISO 8601)
return_datestring✅Return date (ISO 8601)
line_itemsarray✅Array of {fleet_item_id, quantity?}
addonsarray—Array of {addon_id, quantity}
pickup_location_idstring—Pickup location ID
half_dayboolean—Half-day rental (default false)
coupon_codestring—Coupon code to apply
notesstring—Internal notes
checkout_addon_idsstring[]—Optional checkout add-on steps the customer picked (for example a cooler). Each is charged exactly as on the shop's website; required steps are added anyway. An id the shop's checkout doesn't have is refused with 400 addon_not_found ("Checkout add-on not found: <id>") and no booking is created

The pricing engine automatically calculates subtotal, tax, discounts, and total based on item rates, duration, add-ons, seasonal pricing rules, and coupons.

Required checkout add-ons are included. If the shop's checkout has a required add-on step (for example a mandatory $15 cleaning fee), every booking created through POST /v1/bookings includes it as a charge, the same as a booking made on the shop's website or by staff. You don't send it and can't remove it. POST /v1/pricing/calculate includes it too, and takes the same checkout_addon_ids, so the previewed total matches the booked total. Bookings from outside channels such as Viator or GetYourGuide never include it.

Delivery

If the shop's checkout has a delivery step, you can book delivery the same way the shop's website does. Send delivery_selections, one entry per delivery step you want:

ParameterTypeDescription
delivery_selections[].script_idstringThe delivery step's id in the shop's published checkout
delivery_selections[].destinationstring | nullThe delivery address
delivery_selections[].round_tripbooleantrue: drop-off at pickup time and collection at return time. false: drop-off only. A shop that sells one-way only always gets a drop-off.
delivery_selections[].distance_milesnumberRequired by the schema but not used for the price: Renta works the distance out itself from the address
delivery_selections[].manual_milesbooleanRequired by the schema; typed miles are never used

The booking gets exactly the delivery charge and the dispatch trips the website would give the same cart: the shop's per-mile rate after its free miles (doubled for a round trip) or its flat fee. A delivery that costs nothing (inside the free miles) adds no charge and no trip. If you send no delivery_selections, the booking is made without delivery. POST /v1/pricing/calculate takes the same delivery_selections and returns the fee the booking will charge (delivery_fee, included in estimated_total), with the same refusals.

A delivery is never silently left off. The booking is refused with 400 invalid_request, and nothing is saved, when:

  • script_id is not a delivery step the shop offers for this booking, or the same script_id is sent twice;
  • destination is empty, whatever the fee type (a trip needs an address);
  • the address is past the shop's maximum delivery distance;
  • the distance can't be confirmed right now (try again shortly);
  • the shop has a required delivery step and you sent selections without it.

Safe retries. Send an Idempotency-Key header (any unique string per booking you mean to make, at most 255 characters). A retry with the same key and the same body returns the stored 201 response instead of creating another booking. The same key with a different body is refused with 422. Answers are kept for 24 hours, and only successful (2xx) answers are stored, so a refused request can be retried with the same key.

Response. 201 with the booking's own fields. Its line_items, addons, customer and adjustments come from GET /v1/bookings/:id. A 201 that carries a warning (below) may also include line_items, addons and is_practice.

A 201 can carry a warning. Very rarely the booking is saved but a step right after it fails (for example, reading the new booking back). The response is still 201, with the booking as far as it could be read (at least its id) and a top-level warning: "The booking was created, but a follow-up step failed; check it before retrying." Do not create the booking again: fetch it with GET /v1/bookings/:id. A retry with the same Idempotency-Key returns this same response and never creates a second booking.

Negotiated prices and custom charges

A key can set its own price only when the shop allowed it: in Settings → Integrations → API keys, create a secret key with Can set negotiated prices and custom charges ticked (scope bookings:price_override; a full-access key does not include it on its own).

ParameterTypeDescription
line_items[].override_line_totalinteger (cents)Negotiated price for the WHOLE line (all units, all days), instead of the rate card
line_items[].override_priceinteger (cents)Negotiated per-unit rate instead of the rate card
addons[].override_line_totalinteger (cents)Negotiated price for the whole add-on line
custom_adjustmentsarray{kind: "charge" | "discount", description, amount} (amount positive, in cents)

Without that permission, a request that sends any of these is refused with 403 price_override_not_permitted and no booking is created. (Before, these fields were accepted and silently ignored.)

Fields only the shop's own booking screen can set

These belong to the shop's staff booking screen, not the API:

  • override_availability_rules: true
  • on a line: note, client_line_id, unit_ids, deposit_override_cents
  • on a custom charge: custom_adjustments[].delivery, custom_adjustments[].notes
  • at the top level: skip_payment, staff_deposit_decision, deposit_total_cents_override, waived_checkout_addon_ids, override_coupon_per_customer_limit, override_coupon_max_uses, send_confirmation_email, draft_idempotency_key, deposit_change_notes

A request that sends any of these top-level or custom-charge fields with any value except null (so false and [] are refused too) is refused with 400 staff_only_field and no booking is created. The line fields above, and custom_adjustments[].notes, count only when they carry something (an empty string, empty list or null is accepted). The error names the fields in its message and in error.details.fields; this holds for every key, including one allowed to set negotiated prices. Use the booking-level notes for a note on the booking. The old delivery fields delivery_distance, delivery_address, delivery_round_trip, delivery_rate and delivery_free_miles are no longer supported: sent with any value except null, the request is refused with 400 deprecated_field (error.details names the fields and use_instead: "delivery_selections"). A delivery sold as a custom charge does not schedule a delivery trip; to book a delivery, send delivery_selections (see Delivery above) or ask the shop to add it from its booking screen.

const booking = await renta.bookings.create({
  customer_id: 'cust_abc',
  pickup_date: '2026-07-01T09:00:00Z',
  return_date: '2026-07-03T17:00:00Z',
  line_items: [
    { fleet_item_id: 'fi_abc123' },
    { fleet_item_id: 'fi_def456', quantity: 2 },
  ],
  addons: [
    { addon_id: 'addon_helmet', quantity: 3 },
  ],
  coupon_code: 'SUMMER20',
  notes: 'VIP customer — complimentary upgrade',
});
curl -X POST https://api.getrenta.io/v1/bookings \
  -H "Authorization: Bearer renta_sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "cust_abc",
    "pickup_date": "2026-07-01T09:00:00Z",
    "return_date": "2026-07-03T17:00:00Z",
    "line_items": [
      {"fleet_item_id": "fi_abc123"},
      {"fleet_item_id": "fi_def456", "quantity": 2}
    ],
    "addons": [
      {"addon_id": "addon_helmet", "quantity": 3}
    ],
    "coupon_code": "SUMMER20"
  }'

Update Booking

PATCH /v1/bookings/:id

Body Parameters:

ParameterTypeDescription
notesstringInternal notes (max 2000 chars)
statusstringStatus transition (validated)
pickup_location_idstringChange pickup location
await renta.bookings.update('bk_def456', {
  notes: 'VIP customer',
  status: 'confirmed',
});
curl -X PATCH https://api.getrenta.io/v1/bookings/bk_def456 \
  -H "Authorization: Bearer renta_sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"notes": "VIP customer", "status": "confirmed"}'

Cancel Booking

POST /v1/bookings/:id/cancel

Body Parameters:

ParameterTypeRequiredDescription
reasonstring—Cancellation reason
await renta.bookings.cancel('bk_def456', {
  reason: 'Customer requested cancellation due to weather',
});
curl -X POST https://api.getrenta.io/v1/bookings/bk_def456/cancel \
  -H "Authorization: Bearer renta_sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"reason": "Weather cancellation"}'

Extend Booking

POST /v1/bookings/:id/extend

Extend a booking's return date. Recalculates pricing automatically.

Only pending, pending_payment, confirmed and active bookings can be extended. Extending a booking in any other status (for example cancelled or completed) returns 409 with error code booking_not_extendable.

Body Parameters:

ParameterTypeRequiredDescription
new_return_datestring✅New return date (ISO 8601, must be after current return date)
await renta.bookings.extend('bk_def456', {
  new_return_date: '2026-07-05T17:00:00Z',
});
curl -X POST https://api.getrenta.io/v1/bookings/bk_def456/extend \
  -H "Authorization: Bearer renta_sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"new_return_date": "2026-07-05T17:00:00Z"}'

Swap Line Item

POST /v1/bookings/:id/swap-item

Replace one fleet item in a booking with another. Useful when the original item becomes unavailable.

Body Parameters:

ParameterTypeRequiredDescription
line_item_idstring✅Line item to replace
new_fleet_item_idstring✅Replacement fleet item
await renta.bookings.swapItem('bk_def456', {
  line_item_id: 'li_001',
  new_fleet_item_id: 'fi_upgrade',
});
curl -X POST https://api.getrenta.io/v1/bookings/bk_def456/swap-item \
  -H "Authorization: Bearer renta_sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "line_item_id": "li_001",
    "new_fleet_item_id": "fi_upgrade"
  }'

Swapping items recalculates pricing based on the new item's rates. The change is logged in the booking's change_log.

Bookings API | Renta Docs