Order Event
Use order events to capture customer interactions with ecommerce orders in your mobile application, such as purchases, cancellations, returns, and order status changes. These events help you understand customer purchasing behavior and order management patterns.
Event Structure
All order events require an order with these fields:
| Field Name | Field Type | Required | Description |
|---|---|---|---|
order | Order Attribute | Yes | A single order attribute value. |
Event Types
The Order Event supports these interaction types:
- Purchase: Track when customers complete a purchase
- Preorder: Capture when customers place preorders
- Cancel: Track when customers cancel orders
- Ship: Monitor when orders are shipped
- Deliver: Track when orders are delivered
- Return: Capture when customers return orders
- Exchange: Track when customers exchange orders
Purchase Order Event
Track when customers complete a purchase.
1PurchaseOrderEvent(
2 order: Order(
3 id: "order-1",
4 totalValue: 9.99,
5 currency: "USD",
6 attributes: [
7 "PROMO_CODE": "HELLO"
8 ],
9 lineItems: [
10 LineItem(
11 catalogObjectType: "Product",
12 catalogObjectId: "product-11",
13 quantity: 1,
14 price: 20,
15 currency: "USD",
16 attributes: [
17 "gift_wrap": true
18 ]
19 )
20 ]
21 )
22)1OrderEvent.purchase(
2 order = Order(
3 id = "order-1",
4 totalValue = 9.99,
5 currency = "USD",
6 attributes = mapOf(
7 "PROMO_CODE" to "HELLO"
8 ),
9 lineItems = listOf(
10 LineItem(
11 catalogObjectId = "product-1",
12 catalogObjectType = "Product",
13 quantity = 1,
14 price = 20.0,
15 currency = "USD",
16 attributes = mapOf(
17 "gift_wrap" to true
18 )
19 )
20 )
21 )
22)Preorder Order Event
Capture when customers place preorders.
1PreOrderEvent(
2 order: Order(
3 id: "order-1",
4 totalValue: 9.99,
5 currency: "USD",
6 attributes: [
7 "PROMO_CODE": "HELLO"
8 ],
9 lineItems: [
10 LineItem(
11 catalogObjectType: "Product",
12 catalogObjectId: "product-11",
13 quantity: 1,
14 price: 20,
15 currency: "USD",
16 attributes: [
17 "gift_wrap": true
18 ]
19 )
20 ]
21 )
22)1OrderEvent.preorder(
2 order = Order(
3 id = "order-1",
4 totalValue = 9.99,
5 currency = "USD",
6 attributes = mapOf(
7 "PROMO_CODE" to "HELLO"
8 ),
9 lineItems = listOf(
10 LineItem(
11 catalogObjectId = "product-1",
12 catalogObjectType = "Product",
13 quantity = 1,
14 price = 20.0,
15 currency = "USD",
16 attributes = mapOf(
17 "gift_wrap" to true
18 )
19 )
20 )
21 )
22)Cancel Order Event
Track when customers cancel orders.
1CancelOrderEvent(
2 order: Order(
3 id: "order-1",
4 totalValue: 9.99,
5 currency: "USD",
6 attributes: [
7 "PROMO_CODE": "HELLO"
8 ],
9 lineItems: [
10 LineItem(
11 catalogObjectType: "Product",
12 catalogObjectId: "product-11",
13 quantity: 1,
14 price: 20,
15 currency: "USD",
16 attributes: [
17 "gift_wrap": true
18 ]
19 )
20 ]
21 )
22)1OrderEvent.cancel(
2 order = Order(
3 id = "order-1",
4 totalValue = 9.99,
5 currency = "USD",
6 attributes = mapOf(
7 "PROMO_CODE" to "HELLO"
8 ),
9 lineItems = listOf(
10 LineItem(
11 catalogObjectId = "product-1",
12 catalogObjectType = "Product",
13 quantity = 1,
14 price = 20.0,
15 currency = "USD",
16 attributes = mapOf(
17 "gift_wrap" to true
18 )
19 )
20 )
21 )
22)Ship Order Event
Monitor when orders are shipped.
1ShipOrderEvent(
2 order: Order(
3 id: "order-1",
4 totalValue: 9.99,
5 currency: "USD",
6 attributes: [
7 "PROMO_CODE": "HELLO"
8 ],
9 lineItems: [
10 LineItem(
11 catalogObjectType: "Product",
12 catalogObjectId: "product-11",
13 quantity: 1,
14 price: 20,
15 currency: "USD",
16 attributes: [
17 "gift_wrap": true
18 ]
19 )
20 ]
21 )
22)1OrderEvent.ship(
2 order = Order(
3 id = "order-1",
4 totalValue = 9.99,
5 currency = "USD",
6 attributes = mapOf(
7 "PROMO_CODE" to "HELLO"
8 ),
9 lineItems = listOf(
10 LineItem(
11 catalogObjectId = "product-1",
12 catalogObjectType = "Product",
13 quantity = 1,
14 price = 20.0,
15 currency = "USD",
16 attributes = mapOf(
17 "gift_wrap" to true
18 )
19 )
20 )
21 )
22)Deliver Order Event
Track when orders are delivered.
1DeliverOrderEvent(
2 order: Order(
3 id: "order-1",
4 totalValue: 9.99,
5 currency: "USD",
6 attributes: [
7 "PROMO_CODE": "HELLO"
8 ],
9 lineItems: [
10 LineItem(
11 catalogObjectType: "Product",
12 catalogObjectId: "product-11",
13 quantity: 1,
14 price: 20,
15 currency: "USD",
16 attributes: [
17 "gift_wrap": true
18 ]
19 )
20 ]
21 )
22)1OrderEvent.deliver(
2 order = Order(
3 id = "order-1",
4 totalValue = 9.99,
5 currency = "USD",
6 attributes = mapOf(
7 "PROMO_CODE" to "HELLO"
8 ),
9 lineItems = listOf(
10 LineItem(
11 catalogObjectId = "product-1",
12 catalogObjectType = "Product",
13 quantity = 1,
14 price = 20.0,
15 currency = "USD",
16 attributes = mapOf(
17 "gift_wrap" to true
18 )
19 )
20 )
21 )
22)Return Order Event
Capture when customers return orders.
1ReturnOrderEvent(
2 order: Order(
3 id: "order-1",
4 totalValue: 9.99,
5 currency: "USD",
6 attributes: [
7 "PROMO_CODE": "HELLO"
8 ],
9 lineItems: [
10 LineItem(
11 catalogObjectType: "Product",
12 catalogObjectId: "product-11",
13 quantity: 1,
14 price: 20,
15 currency: "USD",
16 attributes: [
17 "gift_wrap": true
18 ]
19 )
20 ]
21 )
22)1OrderEvent.returnOrder(
2 order = Order(
3 id = "order-1",
4 totalValue = 9.99,
5 currency = "USD",
6 attributes = mapOf(
7 "PROMO_CODE" to "HELLO"
8 ),
9 lineItems = listOf(
10 LineItem(
11 catalogObjectId = "product-1",
12 catalogObjectType = "Product",
13 quantity = 1,
14 price = 20.0,
15 currency = "USD",
16 attributes = mapOf(
17 "gift_wrap" to true
18 )
19 )
20 )
21 )
22)Exchange Order Event
Track when customers exchange orders.
1ExchangeOrderEvent(
2 order: Order(
3 id: "order-1",
4 totalValue: 9.99,
5 currency: "USD",
6 attributes: [
7 "PROMO_CODE": "HELLO"
8 ],
9 lineItems: [
10 LineItem(
11 catalogObjectType: "Product",
12 catalogObjectId: "product-11",
13 quantity: 1,
14 price: 20,
15 currency: "USD",
16 attributes: [
17 "gift_wrap": true
18 ]
19 )
20 ]
21 )
22)1OrderEvent.exchange(
2 order = Order(
3 id = "order-1",
4 totalValue = 9.99,
5 currency = "USD",
6 attributes = mapOf(
7 "PROMO_CODE" to "HELLO"
8 ),
9 lineItems = listOf(
10 LineItem(
11 catalogObjectId = "product-1",
12 catalogObjectType = "Product",
13 quantity = 1,
14 price = 20.0,
15 currency = "USD",
16 attributes = mapOf(
17 "gift_wrap" to true
18 )
19 )
20 )
21 )
22)