Stay organized with collections
Save and categorize content based on your preferences.
Proto Definition
messageAvailability{oneofavailability_status{// The ticket is available.Availableavailable=1;// The ticket is unavailable.Unavailableunavailable=2;}}// Message representing how many seats are still available in the specified// service class.// Partners can:// - provide exact numbers for available, and optionally total seats// - provide a relative availability estimate// - leave the message empty, if all they only know is that at least one seat is// still availablemessageAvailable{// The number of remaining seats.// This is optional. You can pass an empty Available message to just indicate// that at least one seat is available.int32available_seat_count=1;// The total number of seats.int32total_seat_count=2;// An estimate for the relative number of available seats.enumAvailabilityEstimate{// > 70% of total seats are still availableMANY_SEATS_AVAILABLE=1;// 30-70% of total seats are still availableHALF_OF_SEATS_AVAILABLE=2;// 10-30% of total seats are still availableFAIR_NUMBER_OF_SEATS_AVAILABLE=3;// 5 - 10% of total seats are still availableFEW_SEATS_AVAILABLE=4;// < 5% of seats are still availableVERY_FEW_SEATS_AVAILABLE=5;}AvailabilityEstimateavailability_estimate=3;}messageUnavailable{// Different reasons why a ticket could be unavailable.enumReason{// All tickets in this ServiceClass have been booked.BOOKED=1;// This particular service (e.g. train) was extraordinarily canceled.// Permanent service changes should be communicated via GTFS.CANCELED=2;// The trip cannot be priced nor sold at the moment.TEMPORARILY_UNAVAILABLE=3;}Reasonreason=1;}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-22 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eAvailability\u003c/code\u003e message indicates whether a ticket is available or unavailable, using the \u003ccode\u003eavailable\u003c/code\u003e or \u003ccode\u003eunavailable\u003c/code\u003e fields respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAvailable\u003c/code\u003e message specifies the number of remaining seats (\u003ccode\u003eavailable_seat_count\u003c/code\u003e), the total number of seats (\u003ccode\u003etotal_seat_count\u003c/code\u003e), and an estimate of availability using the \u003ccode\u003eAvailabilityEstimate\u003c/code\u003e enum.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAvailabilityEstimate\u003c/code\u003e enum in the \u003ccode\u003eAvailable\u003c/code\u003e message provides relative availability indicators, such as \u003ccode\u003eMANY_SEATS_AVAILABLE\u003c/code\u003e, \u003ccode\u003eHALF_OF_SEATS_AVAILABLE\u003c/code\u003e, and \u003ccode\u003eVERY_FEW_SEATS_AVAILABLE\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUnavailable\u003c/code\u003e message details the reason for unavailability, using the \u003ccode\u003eReason\u003c/code\u003e enum which includes options such as \u003ccode\u003eBOOKED\u003c/code\u003e, \u003ccode\u003eCANCELED\u003c/code\u003e, and \u003ccode\u003eTEMPORARILY_UNAVAILABLE\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003ePartners can provide exact numbers, relative estimates, or just an indication that at least one seat is available in the \u003ccode\u003eAvailable\u003c/code\u003e message.\u003c/p\u003e\n"]]],[],null,["# Availability specification\n\n### Proto Definition\n\n```protobuf\nmessage Availability {\n oneof availability_status {\n // The ticket is available.\n Available available = 1;\n\n // The ticket is unavailable.\n Unavailable unavailable = 2;\n }\n}\n\n// Message representing how many seats are still available in the specified\n// service class.\n// Partners can:\n// - provide exact numbers for available, and optionally total seats\n// - provide a relative availability estimate\n// - leave the message empty, if all they only know is that at least one seat is\n// still available\nmessage Available {\n // The number of remaining seats.\n // This is optional. You can pass an empty Available message to just indicate\n // that at least one seat is available.\n int32 available_seat_count = 1;\n\n // The total number of seats.\n int32 total_seat_count = 2;\n\n // An estimate for the relative number of available seats.\n enum AvailabilityEstimate {\n // \u003e 70% of total seats are still available\n MANY_SEATS_AVAILABLE = 1;\n\n // 30-70% of total seats are still available\n HALF_OF_SEATS_AVAILABLE = 2;\n\n // 10-30% of total seats are still available\n FAIR_NUMBER_OF_SEATS_AVAILABLE = 3;\n\n // 5 - 10% of total seats are still available\n FEW_SEATS_AVAILABLE = 4;\n\n // \u003c 5% of seats are still available\n VERY_FEW_SEATS_AVAILABLE = 5;\n }\n\n AvailabilityEstimate availability_estimate = 3;\n}\n\nmessage Unavailable {\n // Different reasons why a ticket could be unavailable.\n enum Reason {\n // All tickets in this ServiceClass have been booked.\n BOOKED = 1;\n\n // This particular service (e.g. train) was extraordinarily canceled.\n // Permanent service changes should be communicated via GTFS.\n CANCELED = 2;\n\n // The trip cannot be priced nor sold at the moment.\n TEMPORARILY_UNAVAILABLE = 3;\n }\n\n Reason reason = 1;\n}\n```\n| **Note:** when using the recommended [protocol buffer libraries](https://github.com/protocolbuffers/protobuf) add values for `AVAILABILITY_ESTIMATE_UNSPECIFIED = 0;` in the `Available.AvailabilityEstimate` and `REASON_UNSPECIFIED = 0;` in the `Unavailable.Reason` enums.\n\n### JSON Sample\n\n```json\n{\n \"available\": {\n \"available_seat_count\": 10,\n \"total_seat_count\": 200\n }\n}\n```"]]