Reference documentation and code samples for the Google Cloud Retail V2 Client class Promotion.
Promotion information.
Generated from protobuf message google.cloud.retail.v2.Promotion
Namespace
Google \ Cloud \ Retail \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ promotion_id
string
ID of the promotion. For example, "free gift". The value must be a UTF-8 encoded string with a length limit of 128 characters, and match the pattern: [a-zA-Z][a-zA-Z0-9_]*. For example, id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is returned. Corresponds to Google Merchant Center property promotion_id.
getPromotionId
ID of the promotion. For example, "free gift".
The value must be a UTF-8 encoded string with a length limit of 128
characters, and match the pattern: [a-zA-Z][a-zA-Z0-9_]*. For example,
id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
returned.
Corresponds to Google Merchant Center property
promotion_id.
Returns
Type
Description
string
setPromotionId
ID of the promotion. For example, "free gift".
The value must be a UTF-8 encoded string with a length limit of 128
characters, and match the pattern: [a-zA-Z][a-zA-Z0-9_]*. For example,
id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
returned.
Corresponds to Google Merchant Center property
promotion_id.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Google Cloud Retail V2 Client - Class Promotion (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-retail/latest/V2.Promotion)\n- [2.3.0](/php/docs/reference/cloud-retail/2.3.0/V2.Promotion)\n- [2.2.1](/php/docs/reference/cloud-retail/2.2.1/V2.Promotion)\n- [2.1.3](/php/docs/reference/cloud-retail/2.1.3/V2.Promotion)\n- [2.0.0](/php/docs/reference/cloud-retail/2.0.0/V2.Promotion)\n- [1.7.0](/php/docs/reference/cloud-retail/1.7.0/V2.Promotion)\n- [1.6.4](/php/docs/reference/cloud-retail/1.6.4/V2.Promotion)\n- [1.5.0](/php/docs/reference/cloud-retail/1.5.0/V2.Promotion)\n- [1.4.2](/php/docs/reference/cloud-retail/1.4.2/V2.Promotion)\n- [1.3.1](/php/docs/reference/cloud-retail/1.3.1/V2.Promotion)\n- [1.2.1](/php/docs/reference/cloud-retail/1.2.1/V2.Promotion)\n- [1.1.1](/php/docs/reference/cloud-retail/1.1.1/V2.Promotion)\n- [1.0.1](/php/docs/reference/cloud-retail/1.0.1/V2.Promotion) \nReference documentation and code samples for the Google Cloud Retail V2 Client class Promotion.\n\nPromotion information.\n\nGenerated from protobuf message `google.cloud.retail.v2.Promotion`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Retail \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getPromotionId\n\nID of the promotion. For example, \"free gift\".\n\nThe value must be a UTF-8 encoded string with a length limit of 128\ncharacters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,\nid0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is\nreturned.\nCorresponds to Google Merchant Center property\n[promotion_id](https://support.google.com/merchants/answer/7050148).\n\n### setPromotionId\n\nID of the promotion. For example, \"free gift\".\n\nThe value must be a UTF-8 encoded string with a length limit of 128\ncharacters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,\nid0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is\nreturned.\nCorresponds to Google Merchant Center property\n[promotion_id](https://support.google.com/merchants/answer/7050148)."]]