Availability and Pricing
All three methods work with a publishable key, so a storefront can call them straight from the browser.
availability.calendar()
availability.calendar(
input: AvailabilityCalendarInput,
options?: RequiplyRequestOptions,
): Promise<AvailabilityCalendarResponse>
Required: startDate and endDate as plain dates (YYYY-MM-DD), at most 366 days apart. A value with a time is converted to its UTC date, which can shift it by a day. Optional groupIds restricts the calendar to up to 200 products.
const { days } = await requiply.availability.calendar({
startDate: '2026-07-01',
endDate: '2026-07-07',
groupIds: [cameraKitId],
});
Each day includes the group, total quantity, reserved quantity, and an availabilityStatus that can be null.
availability.items()
availability.items(
input: AvailabilityItemsInput,
options?: RequiplyRequestOptions,
): Promise<AvailabilityItemsResponse>
Required: startDate and endDate; endDate cannot be before startDate. Offset-less date-times are read in the organization's timezone. Optional: search, limit (1 to 100, default 25), and cursor.
const page = await requiply.availability.items({
startDate: '2026-07-01T10:00:00',
endDate: '2026-07-03T18:00:00',
search: 'camera',
limit: 25,
});
const nextCursor = page.nextCursor;
The response uses the same inventory item shape as inventory.list() and returns nextCursor: string | null. It lists only products with at least one unit free for the whole period. categoryId is always null here; use inventory.list() with the same dates when you need categories.
pricing.quote()
pricing.quote(
input: PricingQuoteInput,
options?: RequiplyRequestOptions,
): Promise<PricingQuoteResponse>
Required: startDate, endDate, and items. Each item needs a groupId (the product id) and a quantity. items may be empty when you send bundles. Optional:
| Field | What it does |
|---|---|
bundles | Bundles to book as { bundleId, quantity }, with quantity in whole sets, from bundles.list(). Their components are added to the items. Since 0.2.1; needs the organization's Bundles feature. |
services | Add-on services by serviceId, from services.list(). |
clientId | Applies that client's percentage discount. Meant for server integrations that already know the client. |
adjustment | A booking cost adjustment. Secret key only. |
saleLines | Goods sold with the booking. See Sales and Goods for Sale; a publishable key can send them only while the organization sells to customers. |
const quote = await requiply.pricing.quote({
startDate: '2026-07-01T10:00:00',
endDate: '2026-07-03T18:00:00',
items: [{ groupId: cameraKitId, quantity: 2 }],
services: [{ serviceId: deliveryServiceId }],
});
console.log(quote.currency, quote.total);
Date-times without an offset are read in the organization's timezone, as for bookings.create(). A quote is priced exactly the way the booking will be, so the total you show is the total the booking gets.
Quote response
| Field | What it holds |
|---|---|
itemsSubtotal, servicesSubtotal | Rental products and services before any discount or adjustment. |
discountableSubtotal | The part the client discount applies to. Services with excludedFromDiscount are not in it. |
bundleDiscountAmount, lineBundles | What the bundles save, already inside total (0 without bundles), and one row per bundle with its quantity, discountPercent, grossTotal, discountAmount, and per-set components. lineItems hold the merged quantities of bundled and standalone units. Since 0.2.1. |
discountPercentage, discountAmount | The client discount and what it takes off, after the bundle discount. |
adjustment, adjustmentAmount | The booking cost adjustment the quote was priced with, or null, and its signed money effect (0 for units, which changes the charged period instead). |
saleSubtotal, lineSaleItems | Goods sold with the booking, when you pass saleLines. Never discounted or adjusted. See Sales and Goods for Sale. |
total | What the booking costs, goods included. |
lineItems, lineServices | One row per product or service with its subtotal. unitCount is the number of charged days, hours, or months. |