Order Attribute

An order attribute is contained within the event structure of Order Event, and mapped in accordance with the Order Schema.
Field Name Field Type Description
name string Required. An event name described from the order event.
order.attributes object A dictionary of user-supplied values.
order.currency string The currency of the total value for the order.
order.id string Required. A unique order ID.
order.lineItems Line Item Attribute An array of line item attribute values.
order.totalValue number Required. The total value of the order.

Order Attribute Example

iOS
1Order(
2    id: "order-1",
3    totalValue: 9.99,
4    currency: "USD",
5    attributes: [
6        "PROMO_CODE": "HELLO"
7    ]
8    lineItems: [
9        LineItem(
10            catalogObjectType: "Product",
11            catalogObjectId: "product-1",
12            quantity: 1,
13            price: 20,
14            currency: "USD",
15            attributes: [
16                "gift_wrap": true,
17                "gift card": "Dearly Beloved"
18            ]
19        ),
20        LineItem(
21            catalogObjectType: "Product",
22            catalogObjectId: "product-2",
23            quantity: 2,
24            price: 5,
25            currency: "USD",
26            attributes: [
27                "gift_wrap": false
28            ]
29        )
30    ]
31)
Android
1Order(
2    id = "order-1",
3    totalValue = 30.00,
4    currency = "USD",
5    attributes = mapOf(
6        "PROMO_CODE" to "HELLO"
7    ),
8    lineItems = listOf(
9        LineItem(
10            catalogObjectId = "product-1",
11            catalogObjectType = "Product",
12            quantity = 1,
13            price = 20.00,
14            currency = "USD",
15            attributes = mapOf(
16                "gift_wrap" to true,
17                "gift card" to "Dearly Beloved"
18            )
19        ),
20        LineItem(
21            catalogObjectId = "product-2",
22            catalogObjectType = "Product",
23            quantity = 2,
24            price = 5.00,
25            currency = "USD",
26            attributes = mapOf(
27                "gift_wrap" to false
28            )
29        )
30    )
31    )