// A template specifying how Google should generate URLs to external site.messageUriTemplate{// The uri template must follow the RFC6570, see// https://datatracker.ietf.org/doc/html/rfc6570.// Supports Level 2 templates.// These parameters will be resolved to their values specified in their// respective entities.//// Available parameters for Dining Reservation Linkout:// 1) (required) {availability_slot_start_seconds} :: populated from start_sec// field in availability feed// 2) (required) {resources_party_size} :: populated from party_size field in// availability feed// 3) (optional) {availability_slot_duration_seconds} :: populated from// duration_sec field in availability feed// 4) (optional) {availability_slot_availability_tag} :: populated from// availability_tag field in availability feed//// Example usage:// http://example.com/book/restaurant?start={availability_slot_start_seconds}// &num_guests={resources_party_size}// * start_sec = 123456// * party_size = 2// https://example.com/book/restaurant?start=123456&num_guests=2stringuri_template=1;}
[null,null,["最后更新时间 (UTC):2025-09-03。"],[[["\u003cp\u003eUpon booking, users are redirected to your booking page via a URL defined by you using parameters dynamically populated with reservation information.\u003c/p\u003e\n"],["\u003cp\u003eYou define a URI template in your Service feed using required and optional parameters like start time, duration, party size, availability tag, and room ID.\u003c/p\u003e\n"],["\u003cp\u003eEnable linkout for specific availability slots by adding the \u003ccode\u003elinkout_required_reason\u003c/code\u003e field with a value of \u003ccode\u003ePAYMENT_REQUIRED\u003c/code\u003e in your Availability feed.\u003c/p\u003e\n"],["\u003cp\u003eVerify the URL Template and Linkout Reason fields in the Action Center's Inventory and Availability Viewers after feed processing (4-8 hours).\u003c/p\u003e\n"]]],["After booking a priced availability slot, users are redirected to a partner-defined booking page. Key actions include: first, defining a URL template using IETF RFC6570 specifications, incorporating required parameters like `availability_slot_start_seconds` and `resources_party_size`. Second, setting this template in the Service feed under the `uri_template` field. Third, enabling linkout per availability slot by adding `linkout_required_reason` with `PAYMENT_REQUIRED` in the Availability feed. Finally, verifying these fields in the Action Center's Inventory and Availability Viewers.\n"],null,["Upon booking an availability slot with a specific price, the user will be\nredirected to your booking page using a URL that's defined by you. The steps\nprovided will show you how to do the following:\n\n1. Define your URL Template.\n2. Set your URL Template in your feeds.\n3. Enable linkout per availability slot.\n4. Verify fields in the Action Center.\n\n1. Defining Your URL Template.\n\nThe uri template follows the Internet Engineering Task Force (IETF) RFC6570\nLevel 2 Uri Template specification, more details at [datatracker.ietf.org](https://datatrackietf.org/doc/html/rfc6570).\nThe URL is set by you with parameters that are dynamically populated with\ninformation pertaining to that reservation. The following table includes\nrequired and optional parameters available for your uri template. \n\n `https://reservation-provider.com/examplerestaurant/book?date={availability_slot_start_seconds}&num_guests={resources_party_size}`\n\nAvailable Values for URL Template\n\n| **Template Parameters** | **Required / Optional** | **Feed** | **Field** | **Example Value** |\n|------------------------------------|-------------------------|------------------------|------------------|-------------------|\n| availability_slot_start_seconds | Required | availability | start_sec | 4152695841 |\n| resources_party_size | Required | availability.resources | party_size | 2 |\n| availability_slot_availability_tag | Optional | availability | availability_tag | res-123 |\n| availability_slot_duration_seconds | Optional | availability | duration_sec | 3600 |\n\n| **Important:** It's recommended you start only with required parameters then add the rest as needed. If an optional parameter is in your uri_template but it's not defined in your feeds, the linkout experience won't appear for that slot.\n\n2. Set your URI Template in your feed.\n\nThe following section assumes you have a live E2E integration with an existing\n[Service Feed](/actions-center/verticals/reservations/e2e/reference/feeds/services-feed#Service-definition). The URL that you've defined will be set in the\nService feed, the following include the definition for that field. \n\n message Service {\n // ..\n UriTemplate uri_template = 38;\n }\n\n| **Note:** A Uri Template is defined for all availability slots tied to a service. If you need to set different parameters for a restaurant, you can do so by submitting different services with unique uri templates for each.\n\nUri Template definition \n\n```scilab\n// A template specifying how Google should generate URLs to external site.\nmessage UriTemplate {\n // The uri template must follow the RFC6570, see\n // https://datatracker.ietf.org/doc/html/rfc6570.\n // Supports Level 2 templates.\n // These parameters will be resolved to their values specified in their\n // respective entities.\n //\n // Available parameters for Dining Reservation Linkout:\n // 1) (required) {availability_slot_start_seconds} :: populated from start_sec\n // field in availability feed\n // 2) (required) {resources_party_size} :: populated from party_size field in\n // availability feed\n // 3) (optional) {availability_slot_duration_seconds} :: populated from\n // duration_sec field in availability feed\n // 4) (optional) {availability_slot_availability_tag} :: populated from\n // availability_tag field in availability feed\n //\n // Example usage:\n // http://example.com/book/restaurant?start={availability_slot_start_seconds}\n // &num_guests={resources_party_size}\n // * start_sec = 123456\n // * party_size = 2\n // https://example.com/book/restaurant?start=123456&num_guests=2\n string uri_template = 1;\n}\n```\n\nService Sample Definition \n\n```scdoc\n{\n \"metadata\": {\n \"processing_instruction\": \"PROCESS_AS_COMPLETE\",\n \"shard_number\": 0,\n \"total_shards\": 1,\n \"nonce\": \"12484913\",\n \"generation_timestamp\": 1530432018\n },\n \"service\": [\n {\n \"merchant_id\": \"dining-A\",\n \"service_id\": \"reservation\",\n \"uri_template\": {\n \"uri_template\": \"https://reservation-provider.com/examplerestaurant/book?date={availability_slot_start_seconds}&num_guests={resources_party_size}\"\n },\n \"localized_service_name\": {\n \"value\": \"Reservation\",\n \"localized_value\": [\n {\n \"locale\": \"en\",\n \"value\": \"Reservation\"\n }\n ]\n }\n }\n ]\n}\n```\n\n3. Enable linkout per availability slot.\n\nThe following section assumes you have a live E2E integration with an existing\n[Availability Feed](/actions-center/verticals/reservations/e2e/reference/feeds/availability-feed#availability-definition). Once you've set the URL template in your\nservice feed, you will need to specify which of your availability slots will be\nrequired to linkout.\n\nYou can do so by adding the `linkout_required_reason` field with a value of\n`PAYMENT_REQUIRED`.\n\nLinkout Reason Definition \n\n message Availability {\n // ..\n LinkoutRequiredReason linkout_required_reason = 19;\n }\n\n```gdscript\n // The reason why a slot requires a linkout. Currently only used for Dining\n // Reservations Payment Redirect Partners.\n enum LinkoutRequiredReason {\n // Default value: Do not use, equates to unknown.\n LINKOUT_REQUIRED_REASON_UNSPECIFIED = 0;\n // Slot requires payment in the partner platform to be booked.\n PAYMENT_REQUIRED = 1;\n }\n```\n\nLinkout Reason Sample Definition \n\n```scdoc\n{\n \"metadata\": {\n \"processing_instruction\": \"PROCESS_AS_COMPLETE\",\n \"shard_number\": 0,\n \"total_shards\": 1,\n \"nonce\": \"11203880\",\n \"generation_timestamp\": 1543875200\n },\n \"service_availability\": [\n {\n \"availability\": [\n {\n \"merchant_id\": \"dining-A\",\n \"service_id\": \"reservation\",\n \"linkout_required_reason\": \"PAYMENT_REQUIRED\",\n \"start_sec\": 1535853600,\n \"duration_sec\": 2700,\n \"spots_total\": 2,\n \"spots_open\": 2,\n \"resources\": {\n \"room_id\": \"A-dining-room\",\n \"room_name\": \"Dining Room\",\n \"party_size\": 2\n }\n }\n ]\n }\n ]\n}\n```\n| **Important:** Once you've completed this step, the payment redirect slots will only appear if that slot has a payment configuration, more details in [Specifying Payment Types](/actions-center/verticals/reservations/e2e/add-ons/add-payments-redirect/specifying-payment-types)\n\n4. Verify Fields in the Action Center\n\nOnce your feeds are successfully submitted and no errors are in the feed\nhistory, you can verify the fields using the following steps.\n| **Note:** Keep in mind that feed processing can take between 4-8 hours. If you're not seeing the fields right away, you may need to wait longer.\n\nURL Template in the Inventory Viewer\n\nYou can find the URL Template definition in the Services section of a merchant's\ninventory view. You'll find the template under the \"feed snippet\" section.\nRefer to [Inventory View](/actions-center/verticals/reservations/e2e/partner-portal/inventory/inventory-view) for more details on the Merchant and\nService View.\n**Figure 1:**Location of URL Template within the Action Center.\n\nLinkout Reason in the Availability Viewer\n\nYou can find the `linkout_required_reason` field when you view the specific\navailability slot in [Availability View](/actions-center/verticals/reservations/e2e/partner-portal/inventory/availability-view).\n**Figure 1:**Location of URL Template within the Action Center."]]