latestSwagger 2.02026-08-10148196271.0 KB

afaab604b58c

commerce

Track a purchase

Track purchase events. <code>shoppingCartItems</code> field on the user profile is cleared. User profile is also updated if it already exists (created otherwise) using the user request field. Also, note that there is a soft limit on the number of unique fields a user can have (default is 1,000). Types of data fields must match the types sent in previous requests, across all data fields in the project.<br/><br/>Learn about <a href="https://support.iterable.com/hc/articles/29156459027348">identifying users by <code>userId</code> and <code>email</code></a>.

post/api/commerce/trackPurchase

Request body

campaignIdinteger
createdAtinteger

Time event happened. Set to the time event was received if unspecified. Expects a Unix timestamp.

dataFieldsobject

Additional fields to be tracked.

idstring

Optional purchase id. If a purchase exists with that id, the purchase will be updated. If none is specified, a new id will automatically be generated and returned. Note that this ID cannot be longer than 512 bytes.

templateIdinteger

Used in AB testing attribution

totalnumber double required

Total order dollar amount

Response

successful operation