Order Attribute (Version 3.x)

An order attribute is contained within the event structure of Order Event and mapped in accordance with the order schema.

Field NameField TypeDescription
namestringRequired. An event name described from the order event.
order.attributesobjectA dictionary of user-supplied values.
order.currencystringThe currency of the order’s total value.
order.idstringRequired. A unique order ID.
order.lineItemsLine Item AttributeAn array of line item attribute values.
order.totalValuenumberThe order’s total value.

Order Attribute Example for 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)

Order Attribute Example for 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    )