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 order's total value. |
order.id |
string | Required. A unique order ID. |
order.lineItems |
Line Item Attribute | An array of line item attribute values. |
order.totalValue |
number | The order's total value. |
Order Attribute Example for iOS
Order(
id: "order-1",
totalValue: 9.99,
currency: "USD",
attributes: [
"PROMO_CODE": "HELLO"
]
lineItems: [
LineItem(
catalogObjectType: "Product",
catalogObjectId: "product-1",
quantity: 1,
price: 20,
currency: "USD",
attributes: [
"gift_wrap": true,
"gift card": "Dearly Beloved"
]
),
LineItem(
catalogObjectType: "Product",
catalogObjectId: "product-2",
quantity: 2,
price: 5,
currency: "USD",
attributes: [
"gift_wrap": false
]
)
]
)
Order Attribute Example for Android
Order(
id = "order-1",
totalValue = 30.00,
currency = "USD",
attributes = mapOf(
"PROMO_CODE" to "HELLO"
),
lineItems = listOf(
LineItem(
catalogObjectId = "product-1",
catalogObjectType = "Product",
quantity = 1,
price = 20.00,
currency = "USD",
attributes = mapOf(
"gift_wrap" to true,
"gift card" to "Dearly Beloved"
)
),
LineItem(
catalogObjectId = "product-2",
catalogObjectType = "Product",
quantity = 2,
price = 5.00,
currency = "USD",
attributes = mapOf(
"gift_wrap" to false
)
)
)
)