An agency draws its dial-a-ride zone in GTFS-Flex, publishes it, and the zone shows up in a trip planner. A rider finds it, sees that service reaches their block, and then hits a wall: no phone number, no lead time, no link, nothing that tells them how to actually get a ride. The zone exists in the data and the trip is still impossible to request. The file that closes that gap is booking_rules.txt, and this is a field reference for it. GTFS-Flex for demand-response service is the introduction to modeling flexible service at all. GTFS booking_rules.txt is the operational detail that turns a described zone into a bookable trip. Read the two together; this one assumes you already know why flex exists.

What Is booking_rules.txt and How Does It Attach to Flex stop_times?

booking_rules.txt is the GTFS-Flex file that tells a trip planner how a rider requests a demand-response trip. It says how far ahead, through what channel, and with what phone number or booking link. It attaches to flex stop_times through pickup_booking_rule_id and drop_off_booking_rule_id, turning a service area into one a rider can actually book.

A booking rule is useless until a trip points at it. The connection lives in stop_times.txt, on the rows that describe a flexible pickup or drop-off window. Two fields carry it. pickup_booking_rule_id names the rule a rider follows to be picked up. drop_off_booking_rule_id names the rule for being dropped off. Both reference a booking_rule_id defined once in booking_rules.txt.

Separating the two matters because a service can treat them differently. A route-deviation trip might require advance booking to leave the fixed path for a pickup while allowing a drop-off anywhere along the way with no notice at all. One booking_rules.txt row can be reused across every trip and stop that shares the same policy, so the file usually stays short even for a large service area.

What the booking_type Values Mean

booking_type is the required field that sets the whole tone of the rule. It takes three values, and each one changes what a trip planner tells a rider.

booking_typeMeaningWhat a rider sees
0Real-time bookingRequest now and ride shortly after, like hailing
1Up to same-day bookingBook ahead, up to and including the day of travel
2Up to prior day(s) bookingBook by a cutoff on an earlier day

Most small dial-a-ride and microtransit operations fall into value 1 or 2, because a human dispatcher needs lead time to build the manifest. Value 0 describes the on-demand, app-hailed end of the spectrum. The value chosen determines which of the notice fields below actually apply.

How prior_notice Fields and Cutoffs Work

The notice fields express, in data, the rule a dispatcher already keeps in their head: how far ahead a trip has to be requested, and by when at the latest. They only carry meaning for advance-booking services, so a real-time rule leaves them blank.

prior_notice_duration_min is the minimum advance notice, in minutes, before travel. It is required for same-day booking (booking_type=1): a two-hour minimum is 120. prior_notice_duration_max, also in minutes, sets the furthest ahead a same-day trip can be booked.

prior_notice_last_day and prior_notice_last_time together express the hard cutoff for a prior-day service (booking_type=2), which does not use the duration fields. A rule of “book by 5 PM the day before” is prior_notice_last_day set to one day ahead and prior_notice_last_time set to 17:00:00. prior_notice_start_day, with prior_notice_start_time, marks when the booking window opens relative to the trip. Sometimes valid booking days follow the agency’s own calendar rather than a simple day count. Then prior_notice_service_id points at a calendar.txt service that defines exactly which days count, so a cutoff never lands on a day the booking office is closed.

Example: booking_rules.txt, rule DAR-2 Field Value Meaning booking_type 2 Up to the day before prior_notice_start_day 7 Opens a week ahead prior_notice_start_time 08:00:00 At 8 AM prior_notice_last_day 1 The day before prior_notice_last_time 17:00:00 Book by 5 PM phone_number (312) 555-0142 booking_url example.org/book The hard cutoff for prior-day booking
A prior-day booking rule expressed in fields

How to Supply a Phone Number, Booking URL, and Rider Message

The contact fields are what a rider ultimately acts on. Leaving them empty is a common way a flex feed fails its own riders. phone_number holds the number a rider calls to book. For a phone-first dial-a-ride service, it is the most important field in the file. booking_url links directly to an online booking flow for services that take reservations on the web. info_url points to a page that explains the service without necessarily booking it.

Three free-text fields carry instructions in the rider’s own reading. message is the general booking instruction shown for the rule. pickup_message and drop_off_message let an agency give boarding-specific and alighting-specific guidance when the two differ. For example, pickups might need a two-hour call-ahead while drop-offs do not. Keep these short and literal. A trip planner surfaces them verbatim, so this is not the place for marketing copy. It is the place for “Call by 5 PM the day before your trip.”

What the Validator Notices Check

The canonical MobilityData GTFS validator added a set of booking_rules checks as flex support matured, and they mostly police internal consistency rather than policy. Expect it to flag a pickup_booking_rule_id or drop_off_booking_rule_id in stop_times.txt that points to a rule that does not exist. It also flags notice fields that contradict the declared booking_type, such as prior-notice values on a real-time rule. Run the finished feed through the validator on every rebuild rather than only at launch. The reason is the same one behind ongoing feed monitoring: a booking policy that changes will silently fall out of sync with the file unless something checks it.

How Google, Apple, and Transit Apps Surface Booking Instructions

Be precise here, because the ecosystem is still catching up. Flex data validates cleanly and a growing set of trip planners read it. But rider-facing, end-to-end booking from booking_rules.txt is not yet universal across the big consumer apps. Where the data is consumed today, it most often surfaces as “this area has demand-response service, here is how to book it”. The phone number, URL, and message come straight from the fields above. It is not yet a reservation a rider completes inside Google Maps or Apple Maps. That is still a real gain over the alternative, which is a zone that appears with no way to act on it.

Populating the contact fields well means that wherever a transit app does surface the service, the rider gets a working number or link instead of a dead end. Trip planners beyond Google covers where else a feed reaches, and alerts for paratransit and demand-response covers keeping those same riders informed once they have booked.

FAQ

Is booking_rules.txt Required for a GTFS-Flex Feed?

The specification marks it optional, but a flex feed without it is effectively broken for riders. It publishes that service exists in an area while giving no way to request a trip. If a service takes bookings, treat booking_rules.txt as required in practice even though the schema does not force it.

What Unit Do Prior Notice Durations Use?

Minutes. Convert the agency’s real policy: a one-hour minimum is 60, two hours is 120, and a full day is 1440. For a cutoff on an earlier day, use prior_notice_last_day and prior_notice_last_time instead. Storing the value the office actually enforces avoids a trip planner quoting a cutoff riders cannot meet.

Can One Booking Rule Apply to Many Trips?

Yes. A booking_rule_id is defined once and referenced by any number of stop_times rows through pickup_booking_rule_id and drop_off_booking_rule_id. Most agencies keep a small handful of rules and reuse them, which also means a policy change is edited in one place.

Do I Need Separate Rules for Pickup and Drop-Off?

Only when the policy differs. If boarding requires a call-ahead but alighting does not, point the two fields at different rules. If the policy is identical, reference the same rule from both, and keep the file short.

Where TransitFare Fits

TransitFare is a transit technology company founded in 2012 that builds GTFS publishing tools for small and mid-sized transit agencies. TransitFare Cloud publishes the fixed-route GTFS schedule and GTFS-Realtime feeds; it does not generate GTFS-Flex files today, so an on-demand zone and its booking_rules.txt are built separately. Over 90% of customers expand to additional modules, and a software-only rollout typically takes about 4 weeks. See how it works in GTFS publishing in TransitFare Cloud, start from what is GTFS?, or plan the surrounding practice with ongoing feed monitoring and the feed migration playbook.