Fundamentals
Getting started
Setup
Integrations
Strategies
Lexi
Security
Identity resolution
Troubleshooting
Data
Onboarding
Data specification
Formatting
APIs
Datasets
Logs
Forms
Javascript Tag
Customer data
Partner data
Compliance
Offboarding
Understand
Segment
Attributes
Compare
Engage
Activate
Respond
Contact
Schedule
Serve
Measure
Track
Activity
Listen
Visualize
Report
Commerce data specification
Commerce data is critical to providing actionable insights to your enriched customer profiles.
The Lexer Commerce Data specification provides a standard format for your product entities, transactions, and returns to enrich your customer profiles into the CDXP. When data is provided using this API, this data will enrich your customer’s profiles with additional attributes.
More detail about the attributes that can be created from this API are in the links below:
For more information about these attributes you can find our full attribute list here.
Product entities
A sample of a product entity record:
// Commerce API: Product Entities | |
{ | |
"records": [ | |
{ | |
"product_id": "b7c901...", | |
"sku": "ac6674...", | |
"upc": "ce6378...", | |
"product_reference_type": "product_id", | |
"name": "Organic Sawyer Rib Crew Knit", | |
"description": "Whether your look is clean and casual or sharp and sophisticated, Staple Superior has what you need to achieve that effortlessly cool style.\n", | |
"brand": "Sawyer", | |
"size": "L", | |
"color": "Navy", | |
"price": 89, | |
"options": { | |
"department": [ | |
"menswear" | |
], | |
"category": [ | |
"outerwear" | |
], | |
"subcategory": [ | |
"knits", | |
"wool" | |
] | |
}, | |
"url": "https://fake.com/menswear/sawyer-rib-crew-knit", | |
"images": [ | |
"https://fake.com/images/menswear/sawyer-rib-crew-knit.jpg" | |
] | |
} | |
] | |
} |
Required fields
- product_id: A product object requires a product_id. This should be unique and used in purchase, and return events.
Purchase
A sample of a transaction record:
// Commerce API: Purchase Events | |
{ | |
"records": [ | |
{ | |
"link": { | |
"email": "jane@fake.com" | |
}, | |
"action_at": "2023-09-20T11:01:01Z", | |
"purchase_id": "53059a...", | |
"store": { | |
"store_id": "40bf96...", | |
"type": "physical", | |
"name": "St Kilda Outlet", | |
"location": { | |
"name": "St Kilda", | |
"coordinates": { | |
"longitude": "float", | |
"latitude": "float" | |
} | |
} | |
}, | |
"type": "ecommerce", | |
"currency": "USD", | |
"payment_types": [ | |
{ | |
"name": "visa", | |
"total": 100 | |
} | |
], | |
"adjustments": [ | |
{ | |
"price_adjustment": 50, | |
"adjusted_at": "2023-09-20T11:01:01Z", | |
"reason": "gift card" | |
} | |
], | |
"products": [ | |
{ | |
"product_reference": { | |
"id": "7ede97...", | |
"id_type": "sku", | |
"dataset_id": "0e2187..." | |
}, | |
"price_paid": 90, | |
"quantity": 2, | |
"full_price": 50, | |
"discount": 10 | |
} | |
], | |
"custom_fields": { | |
"is_gift": true, | |
"gift_message": "Happy Birthday Kevin!" | |
} | |
} | |
] | |
} |
Required fields
- link: Where a customer record is defined by a single identifying link (email, email_sha256, email_md5, mobile, customer_id or external_id). To add more links for unification purposes, you will need to provide Unification data.
- action_at: The purchase date and time.
- purchase_id: A product object requires a purchase_id. This should be unique and used in purchase, and return events.
- type: The type of process the customer went through to make a purchase. This usually differentiates between ecommerce and in-store purchases.
Returns
A sample of a returns record:
// Commerce API: Return Events | |
{ | |
"records": [ | |
{ | |
"link": { | |
"email": "jane@fake.com" | |
}, | |
"action_at": "2023-09-20T11:01:01Z", | |
"return_id": "69baab...", | |
"type": "ecommerce", | |
"currency": "USD", | |
"adjustments": [ | |
{ | |
"price_adjustment": 50, | |
"adjusted_at": "2023-09-20T11:01:01Z", | |
"reason": "gift card" | |
} | |
], | |
"products": [ | |
{ | |
"product_reference": { | |
"id": "7ede97...", | |
"id_type": "sku", | |
"dataset_id": "0e2187..." | |
}, | |
"price_paid": "integer", | |
"quantity": "integer" | |
} | |
], | |
"custom_fields": { | |
"is_damaged": true, | |
"customer_reason": "glass broken on delivery" | |
} | |
} | |
] | |
} |
Required fields
- link: Where a customer record is defined by a single identifying link (email, email_sha256, email_md5, mobile, customer_id or external_id). To add more links for unification purposes, you will need to provide Unification data
- action_at: The return date and time.
- return_id: A product object that is being returned requires a unique return_id.
That’s a wrap on Commerce data specifications
This page has covered some samples of the commerce data schema itself, and the requirements of the schema. If you have any questions, please reach out to your Success Manager.