Stay organized with collections
Save and categorize content based on your preferences.
Proto Definition
// Represents a fare with a breakdown of the different amounts that compose its// total price.messageFare{// Message to represent a fare breakdown.messageLineItem{// The line item type is used to provide a breakdown of the fare for display// to the user. If additional line item types are required please reach out// to the Google Transport team.enumLineItemType{BASE_FARE=1;SERVICE_CHARGE=2;TAXES=3;}LineItemTypeline_item_type=1;.google.type.Moneyamount=2;}// Total amount of the fare. This is equal to the sum of all the line items..google.type.Moneytotal_amount=1;// Details about the different parts that constitute the total amount. The// sum of all the line items must be equal to total_amount.repeatedLineItemline_items=2;}
[[["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\u003eFare\u003c/code\u003e message represents a fare's total price, broken down into individual amounts.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLineItem\u003c/code\u003e message provides details for each part of the fare, categorized by \u003ccode\u003eLineItemType\u003c/code\u003e such as \u003ccode\u003eBASE_FARE\u003c/code\u003e, \u003ccode\u003eSERVICE_CHARGE\u003c/code\u003e, and \u003ccode\u003eTAXES\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etotal_amount\u003c/code\u003e field represents the overall cost of the fare and should be equal to the sum of all \u003ccode\u003eline_items\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eLineItemType\u003c/code\u003e enum is used to categorize each line item within a fare breakdown, with examples including base fare, service charge, and taxes.\u003c/p\u003e\n"],["\u003cp\u003eThe provided json sample shows the structure of a fare, including the total amount and a breakdown of the line items with their type and amount.\u003c/p\u003e\n"]]],[],null,["# Fare specification\n\n### Proto Definition\n\n```protobuf\n// Represents a fare with a breakdown of the different amounts that compose its\n// total price.\nmessage Fare {\n // Message to represent a fare breakdown.\n message LineItem {\n // The line item type is used to provide a breakdown of the fare for display\n // to the user. If additional line item types are required please reach out\n // to the Google Transport team.\n enum LineItemType {\n BASE_FARE = 1;\n SERVICE_CHARGE = 2;\n TAXES = 3;\n }\n\n LineItemType line_item_type = 1;\n .google.type.Money amount = 2;\n }\n\n // Total amount of the fare. This is equal to the sum of all the line items.\n .google.type.Money total_amount = 1;\n\n // Details about the different parts that constitute the total amount. The\n // sum of all the line items must be equal to total_amount.\n repeated LineItem line_items = 2;\n}\n```\n| **Note:** when using the recommended [protocol buffer libraries](https://github.com/protocolbuffers/protobuf) add a value for `LINE_ITEM_TYPE_UNSPECIFIED = 0;` in the `Fare.LineItem.LineItemType` enum.\n\n### JSON Sample\n\n```json\n{\n \"total_amount\": {\n \"units\": 2,\n \"nanos\": 0,\n \"currency_code\": \"USD\"\n },\n \"line_items\": [\n {\n \"line_item_type\": \"BASE_FARE\",\n \"amount\": {\n \"units\": 1,\n \"nanos\": 950000000,\n \"currency_code\": \"USD\"\n }\n },\n {\n \"line_item_type\": \"SERVICE_CHARGE\",\n \"amount\": {\n \"units\": 0,\n \"nanos\": 50000000,\n \"currency_code\": \"USD\"\n }\n }\n ]\n}\n```"]]