Nguồn cấp dữ liệu sản phẩm là cách chính để bạn cung cấp cho Google danh sách các sản phẩm Things to do (Việc cần làm) sẽ xuất hiện trên nhiều nền tảng của Google.
Một đối tượng ProductFeed bao gồm một đối tượng FeedMetadata và không hoặc nhiều đối tượng Product. Nếu bạn không cung cấp Product trong tất cả các phân đoạn, thì tất cả sản phẩm sẽ bị xoá.
ProductFeed
Proto
message ProductFeed {
// Metadata for this feed.
// Required.
FeedMetadata feed_metadata = 1;
// List of the products.
// Optional. When unset in all shards, all products will be deleted.
repeated Product products = 2;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| FeedMetadata | feed_metadata | BẮT BUỘC. Siêu dữ liệu cho nguồn cấp dữ liệu này. |
| repeated Product |
sản phẩm | KHÔNG BẮT BUỘC. Khi bạn không đặt chính sách này trong tất cả các phân đoạn, tất cả sản phẩm sẽ bị xoá. feed_metadata/max_removal_share có thể cần được đặt khi bạn xoá một số lượng lớn sản phẩm. |
Ví dụ
// Example 1: Basic structure
{
"feed_metadata": {
...
},
"products": [
...
]
}
// Example 2: Wipe all products
{
"feed_metadata": {
"shard_id": 0,
"total_shards_count": 1,
"processing_instruction": "PROCESS_AS_SNAPSHOT",
"nonce": 202113041501,
"max_removal_share": 1.0
},
"products": []
}
FeedMetadata
Proto
message FeedMetadata {
// The current shard ID, zero-based. Shards do not need to be transferred in
// order. Processing will start only after a full set of shards was uploaded.
// Required when total_shards_count > 1.
uint32 shard_id = 1;
// Total number of shards in this transfer.
// Required. Must be >= 1.
uint32 total_shards_count = 2;
// An arbitrary number used to link multiple shards to the same transfer.
// Required when total_shards_count > 1.
// Must be the same for all shards within the transfer.
uint64 nonce = 3;
enum ProcessingInstruction {
// For compatibility, don't use.
PROCESS_AS_UNSPECIFIED = 0;
// This Feed upload should be processed as a complete snapshot replacing any
// previously uploaded data of this type.
// Supported feed types: product.
PROCESS_AS_SNAPSHOT = 1;
// This Feed upload should be processed as an upsert, updating or adding
// data to the previous uploads. Supported feed types: reviews,
// availability.
PROCESS_AS_UPSERT = 2;
}
// Processing instruction for this upload.
// Required.
ProcessingInstruction processing_instruction = 4;
// Maximal share of currently active products that are allowed to be removed
// by an upload. If more products will be removed by this transfer, the whole
// transfer will be rejected.
// This is a safeguard against unintentional take down of a significant part
// of the inventory. Can be set to 1.0 to allow complete inventory take down.
// Optional.
double max_removal_share = 5;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| uint32 | shard_id | BẮT BUỘC khi total_shards_count > 1.Dựa trên mốc 0. Bạn không cần chuyển các phân đoạn theo thứ tự. Quá trình xử lý chỉ bắt đầu sau khi bạn tải một bộ phân đoạn đầy đủ lên. |
| uint32 | total_shards_count | BẮT BUỘC, phải lớn hơn hoặc bằng 1. |
| uint64 | nonce | BẮT BUỘC khi total_shards_count > 1.Phải giống nhau đối với tất cả các phân đoạn trong quá trình chuyển. |
| enum | processing_instruction | BẮT BUỘC.PROCESS_AS_SNAPSHOT là giá trị duy nhất được hỗ trợ.
|
| gấp đôi | max_removal_share | KHÔNG BẮT BUỘC. Tỷ lệ tối đa của các sản phẩm đang hoạt động được phép xoá bằng một tệp tải lên. Nếu có nhiều sản phẩm bị xoá hơn do việc chuyển này, thì toàn bộ yêu cầu chuyển sẽ bị từ chối. Đây là biện pháp bảo vệ nhằm ngăn chặn việc vô tình gỡ bỏ một phần đáng kể của khoảng không quảng cáo. Bạn có thể đặt thành 1.0 để cho phép gỡ bỏ hoàn toàn kho hàng. |
Ví dụ
// Example 1: metadata single JSON file
{
"shard_id": 0,
"total_shards_count": 1,
"processing_instruction": "PROCESS_AS_SNAPSHOT",
"nonce": 202113041501
}
// Example 2a: two JSON files (1st file)
{
"shard_id": 0,
"total_shards_count": 2,
"processing_instruction": "PROCESS_AS_SNAPSHOT",
"nonce": 202213041502
}
// Example 2b: two JSON files (2nd file)
{
"shard_id": 1,
"total_shards_count": 2,
"processing_instruction": "PROCESS_AS_SNAPSHOT",
"nonce": 202213041502
}
Sản phẩm
Proto
message Product {
// An opaque string from the partner which uniquely identifies the product.
// Allowed characters are alphanumeric, _, and -. Max length: 255.
// Required.
string id = 1;
// The title of the product in plain text, e.g. "Horseback riding on the
// moon". See definition of "LocalizedTextSet" message for the details on the
// localization.
// Recommended to not exceed length of 50 in any language. Max length: 150.
// Required.
LocalizedTextSet title = 2;
// The description of the product. Limited formatting options are allowed in
// the HTML format. Supported tags:
// * h1-h5
// * ul, ol, li
// * strong, italic, em
// * p, br
// Other tags are not supported and will be removed. CSS, tables, style
// property, `a` links are not supported. Images are not allowed, use the
// related_media field instead.
// Important notes:
// * Try not to use other tags except for the supported ones mentioned
// above, because the contents within unsupported tags will be stripped,
// and may lead to an undesirable user experience.
// * Try avoid deep nested structures like more than 3 different heading
// levels or nested lists. Keeping the structure flat, simple, and
// straightforward, helps to create a better user experience.
// * Do not duplicate info from the product_features field below in the
// description as both would normally be shown side by side.
// Recommended to not exceed length of 10000 in any language. Max length:
// 16000.
// Recommended.
LocalizedTextSet description = 3;
// Structured details about the product features.
// Max number of features: 100.
// Recommended.
repeated TextFeature product_features = 4;
// Aggregated product rating.
// Recommended.
Rating rating = 5;
// Related media such as photos or videos.
// Max number of media: 30.
// Recommended.
repeated Media related_media = 6;
// Whether Google should make use of the order in which related media are
// listed in the feed or not. The media order would be used to influence
// the final image order for the product in the UI.
// Optional, default is false.
bool use_media_order = 13;
// Options available for this product.
// Max number of options: 20.
// At least one is required.
repeated Option options = 7;
// Operator details.
// Optional.
Operator operator = 8;
// Inventory type of this product.
enum InventoryType {
// Default inventory type.
INVENTORY_TYPE_DEFAULT = 0;
// Product is an official ticket to a point of interest. To learn what
// qualifies as official inventory, refer to the policy doc.
INVENTORY_TYPE_OFFICIAL = 1;
// Product is coming directly from the operator or their official
// Connectivity Provider / ResTech.
INVENTORY_TYPE_OPERATOR_DIRECT = 2;
}
// Optional.
InventoryType inventory_type = 9;
// Should contain only distinct values of InventoryType.
// Max number of inventory types: 2.
// Optional.
repeated InventoryType inventory_types = 12;
// Confirmation type of this product.
enum ConfirmationType {
// Type of confirmation is unknown.
CONFIRMATION_TYPE_UNKNOWN = 0;
// Booking is confirmed to the end user immediately.
CONFIRMATION_TYPE_INSTANT = 1;
// Booking is confirmed to the end user within 24 hours.
CONFIRMATION_TYPE_24HRS = 2 [features.enforce_naming_style = STYLE_LEGACY];
// Booking is confirmed to the end user within 48 hours.
CONFIRMATION_TYPE_48HRS = 3 [features.enforce_naming_style = STYLE_LEGACY];
}
// Optional.
ConfirmationType confirmation_type = 10;
// Possible fulfillment types -- ways to obtain a document to confirm the
// booking. Combinations are possible, e.g. mobile + printed, or
// printed at home + in-person pickup is available.
// At least one field must be true.
message FulfillmentType {
// Confirmation on a mobile phone, e.g. with a QR code.
bool mobile = 1;
// Printable confirmation.
bool print_at_home = 2;
// Admission documents to be picked up in person.
bool pickup = 3;
}
// Recommended.
FulfillmentType fulfillment_type = 11;
// Provider brand name.
// Recommended to not exceed length of 50 in any language.
// Max length: 100.
// Optional.
LocalizedTextSet brand_name = 14;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| chuỗi | id | BẮT BUỘC, độ dài tối đa là 255. Một chuỗi duy nhất dùng để xác định sản phẩm. Các ký tự được phép là chữ và số, _, và -. |
| LocalizedTextSet | tiêu đề | BẮT BUỘC, độ dài đề xuất<= 50, độ dài tối đa 150 ký tự. Hãy xem Nguyên tắc về tiêu đề và nội dung mô tả để biết thêm thông tin chi tiết. |
| LocalizedTextSet | mô tả | NÊN DÙNG, độ dài nên dùng <= 10000, độ dài tối đa 16000 ký tự. Hãy xem Nguyên tắc về tiêu đề và nội dung mô tả để biết thêm thông tin chi tiết. |
| repeated TextFeature |
product_features | NÊN DÙNG, số đối tượng tối đa: 100. |
| Mức phân loại | rating | NÊN DÙNG. Bạn nên cung cấp điểm xếp hạng vì những sản phẩm hiển thị điểm xếp hạng sẽ có tỷ lệ nhấp cao hơn. |
| repeated Media |
related_media | NÊN DÙNG, số lượng tối đa của nội dung nghe nhìn: 30 Bạn nên cung cấp nhiều hình ảnh. Hãy xem Nguyên tắc về hình ảnh để biết hướng dẫn chi tiết về hình ảnh. |
| boolean | use_media_order | KHÔNG BẮT BUỘC Gợi ý cho Google rằng thứ tự liệt kê nội dung nghe nhìn có liên quan trong nguồn cấp dữ liệu cần được xem xét khi chọn hình ảnh để hiển thị. |
Lựa chọn lặp lại |
tùy chọn | BẮT BUỘC, số lượng lựa chọn tối đa: 20 Mỗi sản phẩm phải có ít nhất một lựa chọn sản phẩm. |
| Toán tử | toán tử | KHÔNG BẮT BUỘC. |
| enum | deprecated inventory_type |
KHÔNG BẮT BUỘC.INVENTORY_TYPE_OFFICIAL chỉ có thể được đặt trong các sản phẩm liên kết đến trang web bán vé chính thức của một địa điểm du lịch. Bạn chỉ có thể đặt giá trị này sau khi chúng tôi xem xét điều kiện. Trường này không còn được dùng nữa và được thay thế bằng trường lặp lại mới inventory_types. |
| lặp lại | inventory_types | KHÔNG BẮT BUỘC. Danh sách lặp lại các loại khoảng không quảng cáo riêng biệt mà sản phẩm này thuộc về. INVENTORY_TYPE_OFFICIAL chỉ có thể được đặt trong các sản phẩm liên kết đến trang web bán vé chính thức của một địa điểm du lịch. Bạn chỉ có thể đặt giá trị này sau khi chúng tôi xem xét điều kiện. Bạn chỉ có thể đặt INVENTORY_TYPE_OPERATOR_DIRECT trong những sản phẩm liên kết đến trang web của công ty du lịch.
Bạn chỉ có thể đặt giá trị này sau khi chúng tôi xem xét điều kiện. |
| enum | confirmation_type | KHÔNG BẮT BUỘC. |
| FulfillmentType | fulfillment_type | NÊN DÙNG. Nếu được đặt, ít nhất một trường trong fulfillment_rype phải là true.Đặt các cách để lấy một tài liệu nhằm xác nhận việc đặt phòng. Có thể kết hợp các phương thức, ví dụ: phương thức di động + phương thức in, hoặc phương thức in tại nhà + phương thức đến lấy trực tiếp. |
| LocalizedTextSet | brand_name | độ dài tối đa là 100. Tên thương hiệu mà sản phẩm sẽ hiển thị, tên này sẽ thay thế "operator/name" hiện không được dùng nữa. Bạn chỉ có thể đặt một trong hai giá trị này. |
Ví dụ
{
"id": "product-1",
"title": {
"localized_texts": [
{
"language_code": "en",
"text": "Dans bike tour"
},
{
"language_code": "es",
"text": "Tour en bicicleta por Dans"
},
{
"language_code": "zh-HK",
"text": "丹斯自行車之旅"
}
]
},
"description": {
"localized_texts": [
{
"language_code": "en",
"text": "<p>A very fun bike tour<p>"
},
{
"language_code": "es",
"text": "<p>Un recorrido en bicicleta muy divertido.</p>"
},
{
"language_code": "zh-HK",
"text": "<p>一個非常有趣的自行車之旅.</p>"
}
]
},
"brand_name": {
"localized_texts": [
{
"language_code": "en",
"text": "Dans Bikes"
}
]
},
"rating": {
"average_value": 4.6,
"rating_count": 192
},
"product_features": [{
"feature_type": "TEXT_FEATURE_INCLUSION",
"value": {
"localized_texts": [
{
"language_code": "en",
"text": "<p>A very fun bike tour<p>"
},
{
"language_code": "es",
"text": "<p>Un recorrido en bicicleta muy divertido.</p>"
},
{
"language_code": "zh-HK",
"text": "<p>一個非常有趣的自行車之旅.</p>"
}
]
}
},{
"feature_type": "TEXT_FEATURE_HIGHLIGHT",
"value": {
"localized_texts": [
{
"language_code": "en",
"text": "<p>A very fun bike tour<p>"
},
{
"language_code": "es",
"text": "<p>Un recorrido en bicicleta muy divertido.</p>"
},
{
"language_code": "zh-HK",
"text": "<p>一個非常有趣的自行車之旅.</p>"
}
]
}
},{
"feature_type": "TEXT_FEATURE_MUST_KNOW",
"value": {
"localized_texts": [
{
"language_code": "en",
"text": "<p>A very fun bike tour<p>"
},
{
"language_code": "es",
"text": "<p>Un recorrido en bicicleta muy divertido.</p>"
},
{
"language_code": "zh-HK",
"text": "<p>一個非常有趣的自行車之旅.</p>"
}
]
}
}],
"options": [{
"id": "option-1",
"title": {
"localized_texts": [
{
"language_code": "en",
"text": "Sunset tour"
},
{
"language_code": "es",
"text": "Tour al atardecer"
},
{
"language_code": "zh-HK",
"text": "日落之旅"
}
]
},
"landing_page": {
"url": "https://www.danstour.com/sunset?language={lang}¤cy={currency}"
},
"cancellation_policy": {
"refund_conditions": [
{
"min_duration_before_start_time_sec": 86400,
"refund_percent": 100
}
]
},
"option_categories": [
{
"label": "sports"
},
{
"label": "bike-tours"
}
],
"related_locations": [
{
"location": {
"location": {
"place_id": "ChIJ3S-JXmauEmsRUcIaWtf4MzE"
}
},
"relation_type": "RELATION_TYPE_RELATED_NO_ADMISSION"
},
{
"location": {
"location": {
"lat_lng": {
"latitude": 53.339688,
"longitude": 6.236688
}
}
},
"relation_type": "RELATION_TYPE_RELATED_NO_ADMISSION"
}
],
"price_options": [
{
"id": "option-1-adult",
"title": "Adult (14+)",
"price": {
"currency_code": "EUR",
"units": 20
},
"fees_and_taxes": {
"per_ticket_fee": {
"currency_code": "EUR",
"units": 1
},
"per_ticket_tax": {
"currency_code": "EUR",
"units": 1
}
}
}
]},{
"id": "option-2",
"title": {
"localized_texts": [
{
"language_code": "en",
"text": "Sunrise tour"
},
{
"language_code": "es",
"text": "Tour al amanecer"
},
{
"language_code": "zh-HK",
"text": "日出之旅"
}
]
},
"landing_page": {
"url": "https://www.danstour.com/sunrise?language={lang}¤cy={currency}"
},
"cancellation_policy": {
"refund_conditions": [
{
"min_duration_before_start_time_sec": 86400,
"refund_percent": 100
}
]
},
"option_categories": [
{
"label": "sports"
},
{
"label": "bike-tours"
}
],
"related_locations": [
{
"location": {
"location": {
"place_id": "ChIJ3S-JXmauEmsRUcIaWtf4MzE"
}
},
"relation_type": "RELATION_TYPE_RELATED_NO_ADMISSION"
}
],
"price_options": [
{
"id": "option-2-adult",
"title": "Adult (14+)",
"price": {
"currency_code": "EUR",
"units": 20,
"nanos": 0
}
}
],
"meeting_point": {
"location": {
"place_id": "ChIJ3S-JXmauEmsRUcIaWtf4MzE"
},
"description": {
"localized_texts": [
{
"language_code": "en",
"text": "Sunrise tour"
},
{
"language_code": "es",
"text": "Tour al amanecer"
},
{
"language_code": "zh-HK",
"text": "日出之旅"
}
]
}
}
}
],
"related_media": [
{
"url": "http://www.danstour.com/photo1.jpg",
"type": "MEDIA_TYPE_PHOTO"
},
{
"url": "http://www.danstour.com/photo2.jpg",
"type": "MEDIA_TYPE_PHOTO",
"attribution": {
"localized_texts": [
{
"language_code": "en",
"text": "Dans Photos"
}
]
}
}
],
"operator": {
"name": {
"localized_texts": [
{
"language_code": "en",
"text": "Dans Bikes"
}
]
},
"phone_number": "01234567",
"locations": [{
"location": {
"place_id": "ChIJ3S-JXmauEmsRUcIaWtf4MzE"
}
}]
},
"inventory_types": ["INVENTORY_TYPE_OPERATOR_DIRECT"]
}
Phương thức
Proto
message Option {
// Option ID. Must be unique within a product.
// Required.
string id = 1;
// The title of the option in plain text, e.g. "Sunset tour".
//
// If there is only a single option, the option title may be the same as the
// product title. If multiple product options are presented, the title must be
// unique to the option.
// Recommended to not exceed length of 50 in any language.
// Max length: 150.
// Required.
LocalizedTextSet title = 2;
// The description of the option. Limited formatting options are allowed in
// the HTML format, see product description field for more details.
// Recommended to not exceed length of 10000 in any language.
// Max length: 16000.
// Recommended.
LocalizedTextSet description = 3;
// Landing page URL for this option. The page should include a button to start
// the booking/checkout flow.
// Required.
DeepLink landing_page = 5;
// Link to a list view at a higher level of available tickets and tours,
// prominently showing this option possibly among other options.
// Recommended.
DeepLink landing_page_list_view = 6;
// Additional structured details about the option features. Should not
// duplicate the details from the product level.
// Max number of features: 100.
// Optional.
repeated TextFeature option_features = 7;
// Cancellation policy for this option.
// Recommended.
CancellationPolicy cancellation_policy = 8;
// Relevant categories for this Option. Refer to the documentation for valid
// and mutually exclusive values.
// Max number of categories: 100.
// Optional.
repeated Category option_categories = 9;
// List of locations related to this option.
// Max number of locations: 100.
// Recommended.
repeated RelatedLocation related_locations = 10;
// If true, the option is a *typical ticket* that a user would expect to buy
// to participate in the experience, whether it's an attraction admission or
// a slot in a tour.
// Optional, default is false.
bool base_ticket = 11;
// All possible prices for this option.
// Note: With Feed Spec v1 only single Adult price is supported. If multiple
// price options were provided, the lowest price, possibly with notion
// "from ..." would be displayed.
// At least one is required.
repeated PriceOption price_options = 12;
// Duration of the option in seconds, where applicable, e.g. for guided tours,
// boat trips etc. This should reflect the duration of experience (not
// validity time).
// Optional.
uint32 duration_sec = 16;
// Languages of the option. Only where relevant -- when it's important for
// the end user to understand and/or read in the language to enjoy the
// experience. E.g. relevant for a guided tour, but not for a mini-golf pass.
// Max number of languages: 100.
// Recommended.
repeated Language languages = 14;
// Meeting point -- the start location. Only add where relevant and
// beneficial, e.g. the place where participant will meet the tour guide to
// start a walking tour, the place where participant will be picked up for a
// city tour, the dock where a cruise trip will start.
// Optional.
Location meeting_point = 15;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| chuỗi | id | BẮT BUỘC. Mã lựa chọn. Phải là duy nhất trong một sản phẩm. |
| LocalizedTextSet | tiêu đề | BẮT BUỘC, độ dài đề xuất: 50, độ dài tối đa: 150 ký tự. Nếu chỉ có một lựa chọn, tiêu đề của lựa chọn đó có thể giống với tiêu đề của sản phẩm. Nếu bạn trình bày nhiều lựa chọn sản phẩm, thì tiêu đề phải là duy nhất đối với lựa chọn đó. Hãy xem Nguyên tắc về tiêu đề và nội dung mô tả để biết thêm thông tin chi tiết. |
| LocalizedTextSet | mô tả | ĐỀ XUẤT, độ dài đề xuất: 10000, độ dài tối đa: 16000. Hãy xem Nguyên tắc về tiêu đề và nội dung mô tả để biết thêm thông tin chi tiết. |
| DeepLink | landing_page | BẮT BUỘC. Phải có nút hoặc đường liên kết để đặt sản phẩm. Hãy xem Nguyên tắc về trang đích để biết thêm thông tin. |
| DeepLink | landing_page_list_view | NÊN DÙNG. Liên kết đến chế độ xem danh sách ở cấp độ cao hơn về các vé và chuyến tham quan hiện có, cho thấy rõ lựa chọn này có thể là một trong số các lựa chọn khác. Hãy xem Nguyên tắc về trang đích để biết thêm thông tin. |
| repeated TextFeature |
option_features | KHÔNG BẮT BUỘC, số lượng đối tượng tối đa: 100. Không được trùng lặp thông tin chi tiết ở cấp sản phẩm. |
| CancellationPolicy | cancellation_policy | NÊN DÙNG. |
| repeated Category |
option_categories | Không bắt buộc, số lượng danh mục tối đa: 100. Các danh mục có liên quan cho Lựa chọn này. Hãy tham khảo tài liệu về Danh mục sản phẩm để biết thêm các giá trị nên dùng. |
| repeated RelatedLocation |
related_location | ĐƯỢC ĐỀ XUẤT, số lượng vị trí tối đa: 100. Việc cung cấp danh sách chính xác về các vị trí liên quan là cực kỳ quan trọng để sản phẩm xuất hiện ở những nơi phù hợp nhất. Tuy nhiên, việc gắn thẻ quá mức hoặc cung cấp dữ liệu không chính xác sẽ dẫn đến việc sản phẩm bị xoá. Hãy xem hướng dẫn về Vị trí và địa điểm yêu thích để biết thêm thông tin chi tiết. |
| bool | base_ticket | KHÔNG BẮT BUỘC. Dùng để cho biết liệu lựa chọn sản phẩm có phải là vé vào cửa cơ bản hay không. |
| repeated PriceOption |
price_options | BẮT BUỘC, ít nhất 1. Tất cả các mức giá có thể có cho lựa chọn này. Lưu ý: Chỉ hỗ trợ giá Người lớn. Nếu bạn cung cấp nhiều lựa chọn về giá, thì giá đầu tiên vượt qua quy trình kiểm tra hạn chế về địa lý sẽ được sử dụng. Đối với vé nhóm, bạn phải sử dụng toàn bộ giá của cả nhóm. |
| uint32 | duration_sec | KHÔNG BẮT BUỘC. Thời lượng của lựa chọn tính bằng giây (nếu có), chẳng hạn như đối với chuyến tham quan có hướng dẫn viên, chuyến đi thuyền. Thời gian này phải phản ánh thời lượng của trải nghiệm (không phải thời gian hợp lệ). |
| repeated Language |
ngôn ngữ | ĐƯỢC ĐỀ XUẤT, số lượng ngôn ngữ tối đa: 100. Các ngôn ngữ mà lựa chọn này hỗ trợ. Khi người dùng cuối cần hiểu và/hoặc đọc bằng ngôn ngữ đó để tận hưởng trải nghiệm. Chẳng hạn như cho chuyến tham quan có hướng dẫn viên. |
| Vị trí | meeting_point | KHÔNG BẮT BUỘC. Chỉ thêm địa điểm khi phù hợp và có lợi, chẳng hạn như địa điểm mà người tham gia sẽ gặp hướng dẫn viên để bắt đầu chuyến tham quan đi bộ hoặc địa điểm mà người tham gia sẽ được đón để tham quan thành phố, bến tàu nơi chuyến du thuyền sẽ bắt đầu. |
Ví dụ
{
"id": "option-1",
"title": {
"localized_texts": [
{
"language_code": "en",
"text": "Sunset tour"
},
{
"language_code": "es",
"text": "Tour al atardecer"
},
{
"language_code": "zh-HK",
"text": "日落之旅"
}
]
},
"landing_page": {
"url": "https://www.danstour.com/sunset?language={lang}¤cy={currency}"
},
"cancellation_policy": {
"refund_conditions": [
{
"min_duration_before_start_time_sec": 86400,
"refund_percent": 100
}
]
},
"option_categories": [
{
"label": "sports"
},
{
"label": "bike-tours"
}
],
"related_locations": [
{
"location": {
"location": {
"place_id": "ChIJ3S-JXmauEmsRUcIaWtf4MzE"
}
},
"relation_type": "RELATION_TYPE_RELATED_NO_ADMISSION"
},
{
"location": {
"location": {
"lat_lng": {
"latitude": 53.339688,
"longitude": 6.236688
}
}
},
"relation_type": "RELATION_TYPE_RELATED_NO_ADMISSION"
}
],
"price_options": [
{
"id": "option-1-adult",
"title": "Adult (14+)",
"price": {
"currency_code": "EUR",
"units": 20
},
"fees_and_taxes": {
"per_ticket_fee": {
"currency_code": "EUR",
"units": 1
},
"per_ticket_tax": {
"currency_code": "EUR",
"units": 1
}
}
}
]
}
TextFeature
Proto
message TextFeature {
enum TextFeatureType {
// Don't use, for backwards compatibility only.
TEXT_FEATURE_UNKNOWN = 0;
// Feature is an inclusion.
TEXT_FEATURE_INCLUSION = 1;
// Feature is an exclusion.
TEXT_FEATURE_EXCLUSION = 2;
// Feature is a highlight.
TEXT_FEATURE_HIGHLIGHT = 3;
// Feature is a "must know".
TEXT_FEATURE_MUST_KNOW = 4;
// Feature represents information about safety measures.
TEXT_FEATURE_SAFETY_INFORMATION = 5;
}
// Feature type.
// Required.
TextFeatureType feature_type = 1;
// LocalizedTextSet content of the feature. Values support both plain-text
// and HTML-like text for basic formatting. Supported HTML formatting tags:
//
// Phrase tags: <br>, <strong>, <em>, <i>:
// Only the four tags mentioned above are supported. <br> can be used to
// break lines in paragraphs, and <strong>/<em>/<i> can be used to highlight
// important text. Any other phrase tags will be ignored.
//
// All other tags and custom styles are not allowed and will be removed. Any
// URLs, anchors, and links will be stripped, and will never be displayed to
// end-users.
// Recommended to not exceed length of 1000 in any language. Max length: 2000.
// Required.
LocalizedTextSet value = 2;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| enum | feature_type | BẮT BUỘC. Loại đối tượng, các giá trị có thể: TEXT_FEATURE_INCLUSION: Tính năng này được đưa vào.TEXT_FEATURE_EXCLUSION: Tính năng là một trường hợp loại trừ.TEXT_FEATURE_HIGHLIGHT: Tính năng là điểm nổi bật.TEXT_FEATURE_MUST_KNOW: Tính năng này là "điều bắt buộc phải biết".TEXT_FEATURE_SAFETY_INFORMATION: Đối tượng này thể hiện thông tin về các biện pháp an toàn. |
| LocalizedTextSet | value | BẮT BUỘC, độ dài đề xuất <= 1000 ký tự, độ dài tối đa: 2000. Các thẻ định dạng HTML được hỗ trợ: br, strong, em, i Chỉ hỗ trợ 4 thẻ được đề cập. Bạn có thể dùng br để ngắt dòng trong đoạn văn và dùng strong/em/i để làm nổi bật văn bản quan trọng. Mọi thẻ cụm từ khác đều sẽ bị bỏ qua.Bạn không được phép sử dụng tất cả các thẻ và kiểu tuỳ chỉnh khác, đồng thời những thẻ và kiểu tuỳ chỉnh này sẽ bị xoá. Mọi URL, điểm neo và đường liên kết sẽ bị xoá và không bao giờ hiển thị cho người dùng cuối. |
Ví dụ
{
"feature_type": "TEXT_FEATURE_HIGHLIGHT",
"value": {
"localized_texts": [
{
"language_code": "en",
"text": "<p>A very fun bike tour<p>"
},
{
"language_code": "es",
"text": "<p>Un recorrido en bicicleta muy divertido.</p>"
},
{
"language_code": "zh-HK",
"text": "<p>一個非常有趣的自行車之旅.</p>"
}
]
}
}
Rating
Proto
message Rating {
// Average rating value.
// The value must be in the range of [1, 5] and can be omitted if and only if
// the rating_count is zero.
double average_value = 1;
// Number of ratings used in calculating the value.
// Required.
uint64 rating_count = 2;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| gấp đôi | average_value | KHÔNG BẮT BUỘC. Giá trị điểm xếp hạng trung bình. Giá trị phải nằm trong phạm vi [1, 5] và chỉ có thể bỏ qua nếu rating_count bằng 0. |
| uint64 | rating_count | BẮT BUỘC. Số lượng lượt xếp hạng được dùng để tính giá trị. |
Ví dụ
// Example 1
{
"average_value": 4.6,
"rating_count": 192
}
// Example 2: No ratings data
{
"rating_count": 0
}
Nội dung nghe nhìn
Proto
message Media {
// URL of this media source. Google will crawl the media hosted at this URL.
// Max length: 2000.
// Required.
string url = 1;
enum MediaType {
// Don't use, for backwards compatibility only.
MEDIA_TYPE_UNSPECIFIED = 0;
// Indicates the media provided by the url is a photo.
MEDIA_TYPE_PHOTO = 1;
}
// Type of this media source.
// Required.
MediaType type = 2;
// Attribution information about the source of the media. Note that if
// the attribution is required to display with the media to give credit to
// photographer or agency, this field must be set.
// Recommended to not exceed length of 1000 in any language.
// Max length: 2000.
// Optional.
LocalizedTextSet attribution = 3;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| chuỗi | url | BẮT BUỘC, độ dài tối đa: 2000. URL của nguồn nội dung nghe nhìn này. Google sẽ thu thập dữ liệu nội dung nghe nhìn được lưu trữ tại URL này. |
| enum | loại | BẮT BUỘC. Loại nguồn nội dung nghe nhìn này. Các giá trị có thể là: MEDIA_TYPE_PHOTO: Cho biết nội dung nghe nhìn do URL cung cấp là ảnh. |
| LocalizedTextSet | thuộc tính | KHÔNG BẮT BUỘC, độ dài đề xuất: 1.000, độ dài tối đa: 2.000. Thông tin ghi nhận quyền tác giả về nguồn của nội dung nghe nhìn. Xin lưu ý rằng nếu bạn phải hiển thị thông tin ghi nhận tác giả cùng với nội dung nghe nhìn để ghi công cho nhiếp ảnh gia hoặc công ty quảng cáo, thì bạn phải đặt trường này. |
Ví dụ
{
"url": "http://www.danstour.com/photo2.jpg",
"type": "MEDIA_TYPE_PHOTO",
"attribution": {
"localized_texts": [
{
"language_code": "en",
"text": "Dans Photos"
}
]
}
}
Danh mục
Proto
message Category {
// Refer to the documentation for the valid values list.
// Required.
string label = 1;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| chuỗi | nhãn | BẮT BUỘC. Hãy tham khảo Tài liệu về danh mục sản phẩm để xem danh sách các giá trị hợp lệ. |
Ví dụ
{
"label": "sports"
}
RelatedLocation
Proto
// Defines relation between an option and a location.
message RelatedLocation {
// Location related to an option. Can be a POI (e.g. Eiffel tower),
// neighbourhood (e.g. Old Town) or an address / arbitrary map point.
// Required.
Location location = 1;
enum RelationType {
RELATION_TYPE_UNSPECIFIED = 0;
// Relation grants admission to this related location.
RELATION_TYPE_ADMISSION_TICKET = 1;
// Relation declares an additional service which doesn't get the user into
// the related location, e.g. a parking ticket, a temporary exhibition, etc.
RELATION_TYPE_SUPPLEMENTARY_ADDON = 2;
// Location is related but relation does not allow admission or admission is
// irrelevant, e.g. location is a square highlighted in a city tour.
RELATION_TYPE_RELATED_NO_ADMISSION = 3;
}
// Relation type of an option for the given location.
// Required.
RelationType relation_type = 2;
}
Lưu ý khi triển khai
Xác định mối quan hệ giữa một lựa chọn và một vị trí.
| Loại | Trường | Ghi chú |
|---|---|---|
| Vị trí | vị trí | BẮT BUỘC. Vị trí liên quan đến một lựa chọn. Có thể là một địa điểm yêu thích (ví dụ: Tháp Eiffel), khu dân cư (ví dụ: Khu phố cổ) hoặc một địa chỉ / điểm bản đồ bất kỳ. |
| enum | relation_type | BẮT BUỘC. Loại mối quan hệ của một lựa chọn cho vị trí đã cho. Các giá trị có thể là: RELATION_TYPE_RELATED_NO_ADMISSION: Vị trí có liên quan nhưng mối quan hệ không cho phép vào cửa hoặc việc vào cửa không liên quan, chẳng hạn như vị trí là một quảng trường được đánh dấu trong một chuyến tham quan thành phố.RELATION_TYPE_ADMISSION_TICKET: Mối quan hệ cho phép bạn vào địa điểm liên quan này.RELATION_TYPE_SUPPLEMENTARY_ADDON: Mối quan hệ khai báo một dịch vụ bổ sung không đưa người dùng đến vị trí có liên quan, chẳng hạn như vé đỗ xe hoặc triển lãm tạm thời. |
Ví dụ
// Example of place ID POI with no admissions
{
"location": {
"location": {
"place_id": "ChIJ3S-JXmauEmsRUcIaWtf4MzE"
}
},
"relation_type": "RELATION_TYPE_RELATED_NO_ADMISSION"
}
// Example of Address POI with admissions
{
"location": {
"location": {
"place_info": {
"name": "Eiffel Tower",
"unstructured_address": "5 Av. Anatole France, 75007 Paris, France"
}
}
},
"relation_type": "RELATION_TYPE_ADMISSION_TICKET"
}
DeepLink
Proto
// Deep link definition. Can include value parameters that will be expanded on
// serve time.
message DeepLink {
// Landing page URL template for desktop. If both `url` and `localized_url`
// are provided, the former is used as a fallback in case
// no URL matches the user’s locale.
// Max length: 2000.
// Either `url` or `localized_url` is required.
string url = 1;
// Localized landing page URL template for desktop. If both `url` and
// `localized_url` are provided, the former is used as a fallback in case
// no URL matches the user’s locale.
// Max length: 2000.
// Max number of locales: 50.
// Either `url` or `localized_url` is required.
LocalizedTextSet localized_url = 3;
reserved 2, 4;
}
Lưu ý khi triển khai
Định nghĩa về đường liên kết sâu. Có thể bao gồm các thông số giá trị sẽ được mở rộng tại thời điểm phân phát.
| Loại | Trường | Ghi chú |
|---|---|---|
| chuỗi | url | KHÔNG BẮT BUỘC, độ dài tối đa: 2000. Mẫu URL trang đích cho máy tính. Bạn phải cung cấp "url" hoặc "localized_url". |
| LocalizedTextSet | localized_url | KHÔNG BẮT BUỘC, độ dài tối đa: 2000, số lượng ngôn ngữ tối đa: 50. Mẫu URL trang đích được bản địa hoá cho máy tính. Nếu bạn cung cấp cả url và localized_url, thì url sẽ được dùng làm giá trị dự phòng trong trường hợp không có URL nào khớp với ngôn ngữ của người dùng. Nếu url không có sẵn và bạn không cung cấp ngôn ngữ, thì URL tiếng Anh sẽ được dùng. |
Ví dụ
// Example 1: single landing page URL.
{
"url": "https://www.danstour.com/bike-tours/?language={lang}¤cy={currency}"
}
// Example 2: localized landing page url with fallback
{
"url": "https://www.danstour.com/bike-tours/?currency={currency}",
"localized_url": {
"localized_texts": [{
"language_code": "de",
"text": "https://www.danstour.com.de/bike-tours/?currency={currency}"
}, {
"language_code": "es-MX",
"text": "https://mx.danstour.com/bike-tours/?currency={currency}"
}, {
"language_code": "zh-HK",
"text": "https://hk.danstour.com.es/bike-tours/?currency={currency}"
}]
}
}
Đơn vị tổ chức
Proto
message Operator {
// Operator name.
// Recommended to not exceed length of 50 in any language. Max length: 100.
// Required.
LocalizedTextSet name = 1;
// Operator business name as it is registered in Google Business Profile and
// appearing on Google Maps.
// Recommended to not exceed length of 50 in any language.
// Max length: 100.
// Required.
LocalizedTextSet google_business_profile_name = 4;
// Operator phone number. Prefer full international phone number format.
// Max length: 64.
// Optional.
string phone_number = 2;
// List of operator locations.
// Max number of locations: 1.
// Optional.
repeated Location locations = 3;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| LocalizedTextSet | tên [deprecated] | KHÔNG BẮT BUỘC, độ dài nên có: 50, độ dài tối đa: 100. Tên thương hiệu của người bán sản phẩm này. OTA nên đặt giá trị này làm thương hiệu OTA. Trường này hiện không còn dùng nữa và được thay thế bằng brand_name trong phần products |
| LocalizedTextSet | google_business_profile_name | BẮT BUỘC, độ dài tối đa: 100. Tên doanh nghiệp của nhà cung cấp dịch vụ như đã đăng ký trong Trang doanh nghiệp trên Google và xuất hiện trên Google Maps. Bạn phải điền trường này để tham gia mô-đun đặt chỗ của đơn vị vận hành. |
| chuỗi | phone_number | KHÔNG BẮT BUỘC, độ dài tối đa: 64. Số điện thoại của nhân viên vận hành. Ưu tiên định dạng số điện thoại quốc tế đầy đủ. |
| repeated Location |
vị trí | KHÔNG BẮT BUỘC, số lượng tối đa: 1. Địa chỉ doanh nghiệp của đơn vị vận hành. Nếu bạn sử dụng chuỗi địa chỉ, hãy thêm tên doanh nghiệp vào chuỗi địa chỉ. Ví dụ: "tên doanh nghiệp, địa chỉ đường phố". Doanh nghiệp của nhà điều hành phải xuất hiện trên Google Maps thì mô-đun đặt chỗ của nhà điều hành mới kích hoạt. Nhà điều hành nên đăng ký Trang doanh nghiệp trên Google nếu doanh nghiệp của họ không xuất hiện trên Google Maps. |
Ví dụ
// Example 1: Sending operator information for operator booking module:
operator: {
"google_business_profile_name": {
"localized_texts": [{
"language_code": "en",
"text": "Dans Bikes"}]
},
"locations": [{
"location": { //Operator business address
"place_info": {
"name": "Dans Bike Tour",
"unstructured_address": "123 Baker st..."
}
}}]
}
Ngôn ngữ
Proto
message Language {
// A BCP 47 compliant language code such as "en" or "de-CH".
string code = 1;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| chuỗi | mã | Mã ngôn ngữ tuân thủ BCP-47, chẳng hạn như "en" hoặc "de-CH". |
Ví dụ
{
"code": "de-CH"
}
PriceOption
Proto
message PriceOption {
// Unique ID within the price set.
// Max length: 255.
// Required.
string id = 1;
// Short description of the price option, e.g. "Adult weekday".
// Max length: 150.
// Required.
string title = 2;
// Price value, must match the final price on the checkout page, including all
// taxes and charges, see price policy. Currency will be converted to the user
// currency on rendering.
// Required when is_free is false.
google.type.Money price = 3;
// Admission or ticket is free. Must be set to true for zero-price options.
// Optional, default is false.
bool is_free = 4;
// List of geographical regions this price is applicable to. If empty,
// applicable to all locations.
// Optional.
repeated GeoCriterion geo_criteria = 5;
// Break down of fees and taxes included in the price above.
// Optional.
PriceFeesAndTaxes fees_and_taxes = 6;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| chuỗi | id | BẮT BUỘC, độ dài tối đa: 255. Mã nhận dạng duy nhất trong bộ giá. |
| chuỗi | tiêu đề | BẮT BUỘC, độ dài tối đa: 150. Nội dung mô tả ngắn về lựa chọn giá, ví dụ: "Người lớn vào các ngày trong tuần". |
| google.type.Money | price | BẮT BUỘC khi is_free là false.Giá trị giá, phải khớp với giá cuối cùng trên trang thanh toán, bao gồm tất cả các khoản thuế và phí, hãy xem chính sách về giá. Đơn vị tiền tệ sẽ được chuyển đổi sang đơn vị tiền tệ của người dùng khi hiển thị. |
| bool | is_free | KHÔNG BẮT BUỘC, mặc định là false. Vé vào cửa hoặc vé miễn phí. Phải đặt thành true cho các lựa chọn có giá bằng 0. |
| repeated GeoCriterion |
geo_criteria | KHÔNG BẮT BUỘC. Danh sách các khu vực địa lý áp dụng giá này. Nếu bạn để trống trường này, thì điều kiện này sẽ áp dụng cho tất cả các địa điểm. |
| repeated PriceFeesAndTaxes |
fees_and_taxes | KHÔNG BẮT BUỘC. Thông tin chi tiết về các khoản phí và thuế có trong giá. |
Ví dụ
{
"id": "option-1-adult",
"title": "Adult (14+)",
"price": {
"currency_code": "EUR",
"units": 20
},
"fees_and_taxes": {
"per_ticket_fee": {
"currency_code": "EUR",
"units": 1
},
"per_ticket_tax": {
"currency_code": "EUR",
"units": 1
}
}
}
GeoCriterion
Proto
message GeoCriterion {
// 2-letter country code as defined in ISO 3166-1.
// Required.
string country_code = 1;
// If true, criterion is negative (the country code is excluded).
bool is_negative = 2;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| chuỗi | country_code | BẮT BUỘC. Mã quốc gia gồm 2 chữ cái theo định nghĩa trong ISO 3166-1. |
| bool | is_negative | KHÔNG BẮT BUỘC. Nếu đúng, tiêu chí là tiêu chí phủ định (mã quốc gia bị loại trừ). |
Ví dụ
{
"country_code": "US",
"is_negative": "true"
}
PriceFeesAndTaxes
Proto
message PriceFeesAndTaxes {
// Booking fees included in the final product price for a single ticket.
// Optional.
google.type.Money per_ticket_fee = 1;
// State taxes included in the final product price for a single ticket.
// Optional.
google.type.Money per_ticket_tax = 2;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| google.type.Money | per_ticket_fee | KHÔNG BẮT BUỘC. Phí đặt vé có trong giá cuối cùng của sản phẩm cho một vé. |
| google.type.Money | per_ticket_tax | KHÔNG BẮT BUỘC. Thuế tiểu bang được tính vào giá cuối cùng của sản phẩm cho một vé. |
Ví dụ
{
"per_ticket_fee": {
"currency_code": "EUR",
"units": 1
},
"per_ticket_tax": {
"currency_code": "EUR",
"units": 1
}
}
Thông tin vị trí
Proto
message Location {
// At least one of (location, description) must be set, and we highly
// recommend populating location wherever possible.
//
// To emphasize, both fields can be populated together, e.g. you can set
// Central Park New York for the location and "In front of the 72 Street
// Station" for the description.
GeoLocation location = 1;
// Additional description in human-readable form, e.g.
// "On the left side of the fountain on the Palace square".
// At least one of (location, description) must be set.
// Recommended to not exceed length of 1000 in any language. Max length: 2000.
LocalizedTextSet description = 2;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| GeoLocation | vị trí | KHÔNG BẮT BUỘC, bạn phải cung cấp ít nhất một trong hai thông tin là vị trí hoặc nội dung mô tả. Vị trí địa lý. |
| LocalizedTextSet | mô tả | KHÔNG BẮT BUỘC, độ dài nên có: 1000, độ dài tối đa: 2000, phải có ít nhất một vị trí hoặc nội dung mô tả. Nội dung mô tả bổ sung ở dạng con người có thể đọc được, chẳng hạn như "Ở bên trái đài phun nước trên quảng trường Cung điện". |
Ví dụ
{
"location": {
"place_id": "ChIJ3S-JXmauEmsRUcIaWtf4MzE"
}
}
{
"location": {
"place_info": {
"name": "Eiffel Tower",
"unstructured_address": "5 Av. Anatole France, 75007 Paris, France"
}
}
}
GeoLocation
Hãy xem nguyên tắc sử dụng để biết thêm thông tin chi tiết về từng loại gợi ý.
Proto
message GeoLocation {
// Required (exactly one variant from oneof).
// See
// https://developers.google.com/travel/things-to-do/guides/partner-integration/location
// for detailed guidelines.
oneof value {
// Place ID as defined by the Places API:
// https://developers.google.com/places/web-service/place-id
//
// Uniquely identifies a POI on Google.
// It can be sourced using the Places API endpoints, for instance Place
// Search or Place Autocomplete, or manually using the Find Location Matches
// tool in Things to Do Center.
string place_id = 1;
// Legacy single-line address.
// Components are expected to be comma-separated, with the first component
// being the place name as it is displayed on Google.
// For higher matching accuracy, use the street address shown on Google for
// the place.
//
// Examples:
// - "Colosseum, Piazza del Colosseo, 1, 00184 Roma RM, Italy"
// - "The British Museum, Great Russell St, London WC1B 3DG, United Kingdom"
//
// Max length: 200.
//
// Deprecated: use `place_info` for higher matching accuracy, which provides
// a separate field for the place name and supports both structured and
// unstructured address formats.
string address = 3 [deprecated = true];
// Structured place information.
PlaceInfo place_info = 4;
// Business Profile ID, as found in the Google Business Profile settings
// page. Use this field when sourcing locations directly from the place
// owner, who has access to the Google Business Profile for the place and
// can provide such ID.
uint64 business_profile_id = 5;
// Geographic coordinates.
// This field can only be used to determine a city or geographical region,
// as it is too ambiguous to identify a specific place or businesses.
// Use `place_info` instead to match to a specific place by name and
// coordinates.
google.type.LatLng lat_lng = 2;
}
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| chuỗi | place_id | KHÔNG BẮT BUỘC, bạn phải cung cấp chính xác một trong các tham số place_id, address, place_info, business_profile_id hoặc lat_lng.PlaceId như được xác định bởi Places API. Xác định duy nhất một địa điểm yêu thích trên Google. Bạn có thể lấy mã này bằng cách sử dụng điểm cuối của Places API, chẳng hạn như Tìm kiếm địa điểm hoặc Place Autocomplete, hoặc lấy theo cách thủ công bằng công cụ Tìm vị trí trùng khớp trong Trung tâm Điểm tham quan. |
| chuỗi | xử lý | KHÔNG BẮT BUỘC, bạn phải cung cấp chính xác một trong các tham số place_id, address, place_info, business_profile_id hoặc lat_lng.KHÔNG DÙNG NỮA. Địa chỉ cũ trên một dòng. Chiều dài tối đa: 200. Các thành phần phải được phân tách bằng dấu phẩy, trong đó thành phần đầu tiên là tên địa điểm như xuất hiện trên Google. Để tăng độ chính xác khi so khớp, hãy sử dụng địa chỉ đường phố xuất hiện trên Google cho địa điểm đó. |
| PlaceInfo | place_info | KHÔNG BẮT BUỘC, bạn phải cung cấp chính xác một trong các tham số place_id, address, place_info, business_profile_id hoặc lat_lng.Thông tin có cấu trúc về địa điểm. |
| uint64 | business_profile_id | KHÔNG BẮT BUỘC, bạn phải cung cấp chính xác một trong các tham số place_id, address, place_info, business_profile_id hoặc lat_lng.Mã Trang doanh nghiệp, có trong trang cài đặt Trang doanh nghiệp trên Google. Sử dụng trường này khi lấy thông tin về vị trí trực tiếp từ chủ sở hữu địa điểm. Chủ sở hữu này có quyền truy cập vào Trang doanh nghiệp trên Google của địa điểm đó và có thể cung cấp mã nhận dạng này. |
| google.type.LatLng | lat_lng | KHÔNG BẮT BUỘC, bạn phải cung cấp chính xác một trong các tham số place_id, address, place_info, business_profile_id hoặc lat_lng.Toạ độ địa lý. Bạn chỉ có thể dùng trường này để xác định một thành phố hoặc khu vực địa lý, vì trường này quá mơ hồ để xác định một địa điểm hoặc doanh nghiệp cụ thể. Thay vào đó, hãy sử dụng place_info để so khớp với một địa điểm cụ thể theo tên và toạ độ. |
Ví dụ
"place_id": "ChIJ3S-JXmauEmsRUcIaWtf4MzE"
"place_info": {
"name": "Eiffel Tower",
"unstructured_address": "5 Av. Anatole France, 75007 Paris, France"
}
"business_profile_id": 11458995034835395294
"lat_lng": {
"latitude": -25.3511774,
"longitude": 131.0326859
}
PlaceInfo
Proto
message PlaceInfo {
// Place or business name.
// For higher matching accuracy, this should be the same as the name shown on
// Google for the place. For places with a claimed Google Business Profile,
// this should be the same as the business name configured in the business
// profile.
// Max length: 100.
// Required.
string name = 1;
// Phone number, including the international prefix.
// For higher matching accuracy, this should be the same as the phone number
// shown on Google for the place.
// It can include commonly used separator characters.
// Examples: "+1 212-363-3200", "+91 562 222 7261".
// Max length: 30.
// Optional.
string phone_number = 2;
// Website URL shown on Google for the place, preferably the URL linked from
// the business listing in Google Maps or Search for the place.
// Max length: 1000.
// Optional.
string website_url = 3;
// Geographic coordinates of the place.
// If left empty, Google will infer the coordinates from the address.
// Optional, but either `coordinates` or one of `address_type` must be
// provided.
google.type.LatLng coordinates = 4;
// Optional, but either `coordinates` or one of `address_type` must be
// provided.
oneof address_type {
// Structured address.
// Prefer this format whenever possible for higher matching accuracy.
StructuredAddress structured_address = 5;
// Unstructured address.
// It should not include the place or business name, which must instead be
// provided separately using the `name` field.
//
// Examples:
// - `name`: "Colosseum", `unstructured_address`: "Piazza del Colosseo, 1,
// 00184 Roma RM, Italy".
// - `name`: "The British Museum", `unstructured_address`: "Great Russell
// St, London WC1B 3DG, United Kingdom".
//
// Max length: 400.
string unstructured_address = 6;
}
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| chuỗi | tên | BẮT BUỘC. Độ dài tối đa: 300. Tên địa điểm hoặc tên doanh nghiệp. Để có độ chính xác cao hơn, tên này phải giống với tên xuất hiện trên Google cho địa điểm đó. Đối với những địa điểm có Trang doanh nghiệp trên Google đã được xác nhận quyền sở hữu, tên này phải giống với tên doanh nghiệp được định cấu hình trong Trang doanh nghiệp. |
| chuỗi | phone_number | KHÔNG BẮT BUỘC. Độ dài tối đa: 30. Số điện thoại, bao gồm cả tiền tố quốc tế. Để có độ chính xác cao hơn khi so khớp, số điện thoại này phải giống với số điện thoại xuất hiện trên Google cho địa điểm. Nội dung này có thể bao gồm các ký tự phân cách thường dùng. Ví dụ: "+1 212-363-3200", "+91 562 222 7261". |
| chuỗi | website_url | KHÔNG BẮT BUỘC. Chiều dài tối đa: 1.000. URL trang web xuất hiện trên Google cho địa điểm, tốt nhất là URL được liên kết từ trang thông tin doanh nghiệp trong Google Maps hoặc Tìm kiếm cho địa điểm đó. |
| google.type.LatLng | toạ độ | KHÔNG BẮT BUỘC. Toạ độ địa lý của địa điểm. Nếu bạn để trống, Google sẽ suy luận toạ độ từ địa chỉ. Không bắt buộc, nhưng bạn phải cung cấp coordinates hoặc bất kỳ thuộc tính nào trong số structured_address và unstructured_address. |
| StructuredAddress | structured_address | KHÔNG BẮT BUỘC, chỉ có thể có một trong hai structured_address hoặc unstructured_address, không bao giờ có cả hai. |
| chuỗi | unstructured_address | KHÔNG BẮT BUỘC, chỉ có thể có một trong hai structured_address hoặc unstructured_address, không bao giờ có cả hai. |
Ví dụ
"place_info": {
"name": "Colosseum",
"phone_number": "+39 063 99 67 700",
"website_url": "https://colosseo.it/",
"coordinates": {
"latitude": 41.8902102,
"longitude": 12.4922309
},
"structured_address" {
"street_address": "Piazza del Colosseo, 1",
"locality": "Roma",
"administrative_area": "RM",
"postal_code": "00184",
"country_code": "IT"
}
}
"place_info": {
"name": "Eiffel Tower",
"unstructured_address": "5 Av. Anatole France, 75007 Paris, France"
}
"place_info": {
"name": "Mutitjulu Waterhole",
"coordinates": {
"latitude": -25.3511774,
"longitude": 131.0326859
}
}
StructuredAddress
Proto
message StructuredAddress {
// Street address, including house number and any other component that cannot
// be provided using the more specific fields defined below. It should not
// include the place or business name, which must instead be provided
// separately using the `name` field under `PlaceInfo`. It should also not
// include postal code, locality or country as those should be provided using
// the corresponding fields below.
//
// Examples:
// - "Piazza del Colosseo, 1" for the Colosseum.
// - "Great Russell St" for The British Museum.
// - "Champ de Mars, 5 Av. Anatole France" for the Eiffel Tower.
//
// Max length: 200.
// Required.
string street_address = 1;
// Locality, generally referring to the city/town portion of an address.
// Examples: "New York", "Rome", "London", "Tokyo".
// In regions of the world where localities are not well defined or do not fit
// into this structure well, leave empty.
// Max length: 80.
// Optional.
string locality = 2;
// Highest administrative subdivision used for postal addresses of the
// specific country or region. This can be a state, a region, a province, an
// oblast, a prefecture, etc.
// It can be an abbreviation or a full name, depending on how the region is
// usually represented in the postal addresses of the specific country. For
// example, "CA" or "California" for US addresses, "RM" for Rome province in
// Italy.
// Many countries don't use an administrative area in postal addresses. For
// instance, this field should not be used for addresses in Switzerland.
// Max length: 80.
// Optional.
string administrative_area = 3;
// The postal code or zip code.
// Examples: "75007", "WC1B 3DG", etc.
// Required if the country supports postal codes, otherwise it should be left
// empty.
// Max length: 30.
// Optional.
string postal_code = 4;
// Country code, as defined by Unicode's "CLDR", itself based on the ISO 3166
// alpha-2 standard. See
// https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html.
//
// Examples: "US" for the United States, "FR" for France, "GB" for the United
// Kingdom, etc.
// Max length: 2.
// Required.
string country_code = 5;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| chuỗi | street_address | BẮT BUỘC. Chiều dài tối đa: 200. Địa chỉ đường phố, bao gồm cả số nhà và mọi thành phần khác mà bạn không thể cung cấp bằng các trường cụ thể hơn. Bạn không nên thêm tên địa điểm hoặc tên doanh nghiệp. Thay vào đó, bạn phải cung cấp riêng tên địa điểm hoặc tên doanh nghiệp bằng cách sử dụng trường name trong PlaceInfo. Địa chỉ này cũng không được bao gồm mã bưu chính, địa phương hoặc quốc gia vì bạn phải cung cấp những thông tin đó bằng các trường tương ứng. |
| chuỗi | thành phố | KHÔNG BẮT BUỘC. Độ dài tối đa: 80. Địa phương, thường đề cập đến phần thành phố hoặc thị trấn của một địa chỉ. Ở những khu vực trên thế giới mà địa phương không được xác định rõ hoặc không phù hợp với cấu trúc này, hãy để trống. |
| chuỗi | administrative_area | KHÔNG BẮT BUỘC. Độ dài tối đa: 80. Phân khu hành chính cao nhất được dùng cho địa chỉ bưu chính của quốc gia hoặc khu vực cụ thể. Đây có thể là một tiểu bang, khu vực, tỉnh, vùng hoặc tỉnh. Đó có thể là tên viết tắt hoặc tên đầy đủ, tuỳ thuộc vào cách khu vực đó thường được thể hiện trong địa chỉ bưu chính của quốc gia cụ thể. |
| chuỗi | postal_code | KHÔNG BẮT BUỘC. Độ dài tối đa: 30. Mã bưu chính hoặc mã vùng. Bắt buộc nếu quốc gia hỗ trợ mã bưu chính, nếu không, bạn nên để trống. |
| chuỗi | country_code | KHÔNG BẮT BUỘC. Độ dài tối đa: 2. Mã quốc gia, theo định nghĩa của "CLDR" Unicode, dựa trên tiêu chuẩn ISO 3166 alpha-2. Xem tài liệu về Unicode. |
Ví dụ
{
"structured_address" {
"street_address": "Piazza del Colosseo, 1",
"locality": "Roma",
"administrative_area": "RM",
"postal_code": "00184",
"country_code": "IT"
}
}
LocalizedTextSet
Proto
// Values of the localized fields.
message LocalizedTextSet {
// Per-locale LocalizedText values.
// Maximum repeatedness: 50
repeated google.type.LocalizedText localized_texts = 1;
}
Lưu ý khi triển khai
| Loại | Trường | Ghi chú |
|---|---|---|
| repeated google.type.LocalizedText |
localized_texts | Giá trị văn bản đã bản địa hoá theo từng ngôn ngữ. Số lượng ngôn ngữ tối đa: 50. |
Ví dụ
{
"language_code": "en",
"text": "Sunrise tour"
}
CancellationPolicy
Proto
// Cancellation policy for a product.
message CancellationPolicy {
// Defines a single refund condition. Multiple refund conditions could be
// used together to describe "refund steps" as various durations before the
// service start time.
message RefundCondition {
// Duration in seconds before the start time, until when the customer can
// receive a refund for part of the service's cost specified in
// `refund_percent`.
// When unset or set to 0 the service can be cancelled at any time.
// Optional.
uint32 min_duration_before_start_time_sec = 1;
// The percent that can be refunded, as long as the service booking is
// cancelled at least `min_duration_before_start_time` before the service
// start time, in the range of [0, 100].
// When unset or set to 0, the service is not refundable. When set to 100
// this service is fully refundable.
// Optional.
uint32 refund_percent = 2;
// A flat fee deducted on refund. Could be used separately, or in
// combination with the refund_percent above. In the latter case, refund
// percent applies first, then the fee is deducted.
// Optional.
google.type.Money refund_fee = 3;
}
// Zero or more refund conditions applicable to the policy.
// Max number of refund conditions: 10.
repeated RefundCondition refund_conditions = 1;
}
Lưu ý khi triển khai
Xác định một điều kiện hoàn tiền duy nhất. Bạn có thể sử dụng nhiều điều kiện hoàn tiền cùng nhau để mô tả "các bước hoàn tiền" theo nhiều khoảng thời gian trước thời gian bắt đầu dịch vụ.
| Loại | Trường | Ghi chú |
|---|---|---|
| RefundCondition | refund_conditions | KHÔNG BẮT BUỘC, số lượng điều kiện hoàn tiền tối đa: 10. |
RefundCondition
| Loại | Trường | Ghi chú |
|---|---|---|
| uint32 | min_duration_before_start_time_sec | Không bắt buộc. Khoảng thời gian tính bằng giây trước thời gian bắt đầu, cho đến khi khách hàng có thể nhận được tiền hoàn lại cho một phần chi phí dịch vụ được chỉ định trong refund_percent. Khi chưa đặt hoặc đặt thành 0, dịch vụ có thể bị huỷ bất cứ lúc nào. |
| uint32 | refund_percent | KHÔNG BẮT BUỘC. Tỷ lệ phần trăm có thể hoàn lại, miễn là bạn huỷ đặt lịch hẹn dịch vụ ít nhất min_duration_before_start_time trước thời gian bắt đầu dịch vụ, trong phạm vi [0, 100]. Khi bạn không đặt hoặc đặt thành 0, dịch vụ sẽ không hoàn tiền. Khi được đặt thành 100, dịch vụ này sẽ được hoàn tiền đầy đủ. |
| google.type.Money | refund_fee | KHÔNG BẮT BUỘC. Một khoản phí cố định được khấu trừ khi hoàn tiền. Có thể dùng riêng hoặc kết hợp với refund_percent. Trong trường hợp thứ hai, tỷ lệ hoàn tiền sẽ được áp dụng trước, sau đó phí sẽ được khấu trừ. |
Ví dụ
"refund_conditions": [
{
"min_duration_before_start_time_sec": 86400,
"refund_percent": 100
}]