public sealed class PurchaseTransaction : IMessage<PurchaseTransaction>, IEquatable<PurchaseTransaction>, IDeepCloneable<PurchaseTransaction>, IBufferMessage, IMessage
Reference documentation and code samples for the Recommendations AI v1beta1 API class PurchaseTransaction.
A transaction represents the entire purchase transaction.
Optional. All the costs associated with the product. These can be
manufacturing costs, shipping expenses not borne by the end user, or any
other costs.
Total product cost such that
profit = revenue - (sum(taxes) + sum(costs))
If product_cost is not set, then
profit = revenue - tax - shipping - sum(CatalogItem.costs).
If CatalogItem.cost is not specified for one of the items, CatalogItem.cost
based profit cannot be calculated for this Transaction.
Required. Total revenue or grand total associated with the transaction.
This value include shipping, tax, or other adjustments to total revenue
that you want to include as part of your revenue calculations. This field
is not required if the event type is refund.
[[["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-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003ePurchaseTransaction\u003c/code\u003e class in the Recommendations AI v1beta1 API represents a complete purchase transaction within the Google Cloud environment.\u003c/p\u003e\n"],["\u003cp\u003eThis class is part of the \u003ccode\u003eGoogle.Cloud.RecommendationEngine.V1Beta1\u003c/code\u003e namespace and is available in the \u003ccode\u003eGoogle.Cloud.RecommendationEngine.V1Beta1.dll\u003c/code\u003e assembly.\u003c/p\u003e\n"],["\u003cp\u003eIt implements interfaces like \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, providing functionalities for message handling, equality checks, deep cloning, and buffer operations.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of \u003ccode\u003ePurchaseTransaction\u003c/code\u003e include \u003ccode\u003eCosts\u003c/code\u003e, \u003ccode\u003eCurrencyCode\u003c/code\u003e, \u003ccode\u003eId\u003c/code\u003e, \u003ccode\u003eRevenue\u003c/code\u003e, and \u003ccode\u003eTaxes\u003c/code\u003e, which capture essential data like associated costs, currency, transaction ID, total revenue, and taxes respectively.\u003c/p\u003e\n"],["\u003cp\u003eThere are two constructors available for the \u003ccode\u003ePurchaseTransaction\u003c/code\u003e class, one empty, and one that takes another \u003ccode\u003ePurchaseTransaction\u003c/code\u003e as a parameter, and there are also inherited members such as \u003ccode\u003eGetHashCode()\u003c/code\u003e, \u003ccode\u003eGetType()\u003c/code\u003e and \u003ccode\u003eToString()\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,[]]