---
schema_version: "1"
id: c6551e796b82f3fa7a0befdb857c15fa9b14b1bf8b8ec328a57e1a2d73989a07
title: Order Attribute (Version 2.x)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-engagement-mobile-sdk/guides/c360a-api-engagement-mobile-sdk-order-attribute-v2.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-engagement-mobile-sdk/guide/c360a-api-engagement-mobile-sdk-order-attribute-v2.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 579d68e80ce967c0fe8d18626fc29170d2aa4145df07bbdc07a32bd0a74fa02f
products:
  - Data 360 Engagement Mobile SDK
  - Data 360 Developer Documentation
---
# Order Attribute (Version 2.x)

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](https://developer.salesforce.com/docs/data/data-cloud-engagement-mobile-sdk/guide/c360a-api-engagement-mobile-sdk-line-item-attribute.md) | An array of line item attribute values.                     |
| `order.totalValue` | number                                                                        | **Required**. The order's total value.                      |

## Order Attribute Example for iOS

```nolang
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

```nolang
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
            )
        )
    )
    )
```
