Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class TransactionInfo.
A transaction represents the entire purchase transaction.
Generated from protobuf messagegoogle.cloud.discoveryengine.v1.TransactionInfo
Namespace
Google \ Cloud \ DiscoveryEngine \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ value
float
Required. Total non-zero value associated with the transaction. This value may include shipping, tax, or other adjustments to the total value that you want to include.
↳ currency
string
Required. Currency code. Use three-character ISO-4217 code.
↳ transaction_id
string
The transaction ID with a length limit of 128 characters.
↳ tax
float
All the taxes associated with the transaction.
↳ cost
float
All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that: * * Profit =value-tax-cost
Required. Total non-zero value associated with the transaction. This value
may include shipping, tax, or other adjustments to the total value that you
want to include.
Returns
Type
Description
float
hasValue
clearValue
setValue
Required. Total non-zero value associated with the transaction. This value
may include shipping, tax, or other adjustments to the total value that you
want to include.
Parameter
Name
Description
var
float
Returns
Type
Description
$this
getCurrency
Required. Currency code. Use three-character ISO-4217 code.
Returns
Type
Description
string
setCurrency
Required. Currency code. Use three-character ISO-4217 code.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getTransactionId
The transaction ID with a length limit of 128 characters.
Returns
Type
Description
string
setTransactionId
The transaction ID with a length limit of 128 characters.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getTax
All the taxes associated with the transaction.
Returns
Type
Description
float
hasTax
clearTax
setTax
All the taxes associated with the transaction.
Parameter
Name
Description
var
float
Returns
Type
Description
$this
getCost
All the costs associated with the products. These can be manufacturing
costs, shipping expenses not borne by the end user, or any other costs,
such that:
All the costs associated with the products. These can be manufacturing
costs, shipping expenses not borne by the end user, or any other costs,
such that:
[[["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-09-04 UTC."],[],[],null,["# Google Cloud Discovery Engine V1 Client - Class TransactionInfo (1.7.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.7.0 (latest)](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo)\n- [1.6.1](/php/docs/reference/cloud-discoveryengine/1.6.1/V1.TransactionInfo)\n- [1.5.1](/php/docs/reference/cloud-discoveryengine/1.5.1/V1.TransactionInfo)\n- [1.4.0](/php/docs/reference/cloud-discoveryengine/1.4.0/V1.TransactionInfo)\n- [1.3.3](/php/docs/reference/cloud-discoveryengine/1.3.3/V1.TransactionInfo)\n- [1.2.0](/php/docs/reference/cloud-discoveryengine/1.2.0/V1.TransactionInfo)\n- [1.1.0](/php/docs/reference/cloud-discoveryengine/1.1.0/V1.TransactionInfo)\n- [1.0.0](/php/docs/reference/cloud-discoveryengine/1.0.0/V1.TransactionInfo)\n- [0.11.3](/php/docs/reference/cloud-discoveryengine/0.11.3/V1.TransactionInfo)\n- [0.8.0](/php/docs/reference/cloud-discoveryengine/0.8.0/V1.TransactionInfo)\n- [0.7.1](/php/docs/reference/cloud-discoveryengine/0.7.1/V1.TransactionInfo)\n- [0.6.0](/php/docs/reference/cloud-discoveryengine/0.6.0/V1.TransactionInfo)\n- [0.5.0](/php/docs/reference/cloud-discoveryengine/0.5.0/V1.TransactionInfo)\n- [0.4.0](/php/docs/reference/cloud-discoveryengine/0.4.0/V1.TransactionInfo)\n- [0.3.0](/php/docs/reference/cloud-discoveryengine/0.3.0/V1.TransactionInfo)\n- [0.2.0](/php/docs/reference/cloud-discoveryengine/0.2.0/V1.TransactionInfo)\n- [0.1.1](/php/docs/reference/cloud-discoveryengine/0.1.1/V1.TransactionInfo) \nReference documentation and code samples for the Google Cloud Discovery Engine V1 Client class TransactionInfo.\n\nA transaction represents the entire purchase transaction.\n\nGenerated from protobuf message `google.cloud.discoveryengine.v1.TransactionInfo`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ DiscoveryEngine \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getValue\n\nRequired. Total non-zero value associated with the transaction. This value\nmay include shipping, tax, or other adjustments to the total value that you\nwant to include.\n\n### hasValue\n\n### clearValue\n\n### setValue\n\nRequired. Total non-zero value associated with the transaction. This value\nmay include shipping, tax, or other adjustments to the total value that you\nwant to include.\n\n### getCurrency\n\nRequired. Currency code. Use three-character ISO-4217 code.\n\n### setCurrency\n\nRequired. Currency code. Use three-character ISO-4217 code.\n\n### getTransactionId\n\nThe transaction ID with a length limit of 128 characters.\n\n### setTransactionId\n\nThe transaction ID with a length limit of 128 characters.\n\n### getTax\n\nAll the taxes associated with the transaction.\n\n### hasTax\n\n### clearTax\n\n### setTax\n\nAll the taxes associated with the transaction.\n\n### getCost\n\nAll the costs associated with the products. These can be manufacturing\ncosts, shipping expenses not borne by the end user, or any other costs,\nsuch that:\n\n- Profit = [value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) - [tax](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getTax__) - [cost](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getCost__)\n\n### hasCost\n\n### clearCost\n\n### setCost\n\nAll the costs associated with the products. These can be manufacturing\ncosts, shipping expenses not borne by the end user, or any other costs,\nsuch that:\n\n- Profit = [value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) - [tax](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getTax__) - [cost](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getCost__)\n\n### getDiscountValue\n\nThe total discount(s) value applied to this transaction.\n\nThis figure should be excluded from\n[TransactionInfo.value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__)\nFor example, if a user paid\n[TransactionInfo.value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__)\namount, then nominal (pre-discount) value of the transaction is the sum of\n[TransactionInfo.value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__)\nand\n[TransactionInfo.discount_value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getDiscountValue__)\nThis means that profit is calculated the same way, regardless of the\ndiscount value, and that\n[TransactionInfo.discount_value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getDiscountValue__)\ncan be larger than\n[TransactionInfo.value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__):\n\n- Profit = [value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) - [tax](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getTax__) - [cost](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getCost__)\n\n### hasDiscountValue\n\n### clearDiscountValue\n\n### setDiscountValue\n\nThe total discount(s) value applied to this transaction.\n\nThis figure should be excluded from\n[TransactionInfo.value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__)\nFor example, if a user paid\n[TransactionInfo.value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__)\namount, then nominal (pre-discount) value of the transaction is the sum of\n[TransactionInfo.value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__)\nand\n[TransactionInfo.discount_value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getDiscountValue__)\nThis means that profit is calculated the same way, regardless of the\ndiscount value, and that\n[TransactionInfo.discount_value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getDiscountValue__)\ncan be larger than\n[TransactionInfo.value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__):\n\n- Profit = [value](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) - [tax](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getTax__) - [cost](/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getCost__)"]]