Booking API course · updated 2026-10-17
Lesson 3: GET /company and GET /sizes, the data your screens start from
Your first two calls load everything the booking screen needs to render: who the company is, whether booking is open, how the card fee is handled, and the sizes with their live prices by rental length.
Before you start
- Lesson 2 done: a key and, for browser calls, an allowed domain
- ## GET /company
```
curl -H "Authorization: Bearer dc_pk_live_..." -H "Origin: https://yourcompany.com" \
https://gcwyoiihrupbfqqlcurh.supabase.co/functions/v1/booking-api/v1/company
```
Response data: id, name, slug, phone, email, address { line1, city, state, zip, country }, currency (usd or cad), country, timezone, branding { logo_url, primary_color, secondary_color, website }, booking { is_online, payments_ready, has_active_sizes, card_fee_handling, non_working_days, service_area { zip, max_miles } or null, rental_agreement, hosted_page }. Use is_online and payments_ready to decide whether to show the booking at all; if either is false, show the company's phone instead. - ## GET /sizes
Response data: an array sorted by yards. Each size: id (use it in /quote and /intents), label, yards, description, image_url, price_from (starting price in dollars: the 24 hour price, or the shortest tier the company has on when it does not offer 24 hour rentals), included_tons, overage_per_ton, prices { h24, d3, d5, d7, d10, d14, d30, extra_day } (dollars; h24 is the 24 hour price, null when the company does not offer 24 hour rentals; a null tier means the company did not set that length), tax { enabled, percent }, fuel_environmental_fee { enabled, amount }, is_default, is_popular. Only active sizes are returned. - ## How to show prices honestly
A 1 day rental (rental_days 1) costs h24 when the size has it. Otherwise the price for a rental is the shortest tier the length fits in: up to 3 days d3, up to 5 d5, up to 7 d7, up to 10 d10, up to 14 d14, up to 30 d30. Longer than the longest tier the company has: that tier plus extra_day per day beyond it. A tier that is null is off. When a size has no tier at all the server falls back to price_from plus extra days beyond 7. Do not compute totals yourself for the checkout: call POST /quote (lesson 5) and show its total and processing_fee. Use prices only for the size cards ("from 325"). - ## Card fee handling
booking.card_fee_handling tells you who pays the card processing fee: customer_pays (the customer pays total plus fee, shown as gross_total), company_absorbs (the customer pays total) or split_50_50. Your checkout should show processing_fee and gross_total from /quote exactly as the hosted page does, so there is never a surprise at the card step. - ## Prices by material (lesson 15)
prices{} on each size are the general tiers. When GET /company says booking.materials.enabled, the company also prices by material: GET /materials lists what goes in the dumpster, which sizes accept each material and the material price per size, which replaces the 7-day base. Material-first screens read /materials before /sizes.
What happens next
- Cache these two responses for the page session; they change only when the company edits its settings.
Troubleshooting
GET /sizes returns an empty array.
The company has no active size. Ask the office to add sizes and prices in Inventory; booking.has_active_sizes in /company says the same.
Related guides
- Lesson 4: GET /availability, closed days and the service area
- Lesson 5: POST /check and POST /quote, validate and price before the card
© 2026 Dumpster Controls. All rights reserved. Made in the USA.