---
schema_version: "1"
id: 560d07c099ffbf43fafb3bc52c6497d3e4bcf656aeffe1baf1a6cb135d52ec11
title: Order Event
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-event.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-engagement-mobile-sdk/guide/c360a-api-engagement-mobile-sdk-order-event.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 4b1cf4e2c1cfc279736f3bd9db02ef79e6b72a8412bd40221d9648134f0207f8
products:
  - Data 360 Engagement Mobile SDK
  - Data 360 Developer Documentation
---
# 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](https://developer.salesforce.com/docs/data/data-cloud-engagement-mobile-sdk/guide/c360a-api-engagement-mobile-sdk-order-attribute.md) | 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.

```
PurchaseOrderEvent(
    order: Order(
        id: "order-1",
        totalValue: 9.99,
        currency: "USD",
        attributes: [
            "PROMO_CODE": "HELLO"
        ],
        lineItems: [
            LineItem(
                catalogObjectType: "Product",
                catalogObjectId: "product-11",
                quantity: 1,
                price: 20,
                currency: "USD",
                attributes: [
                    "gift_wrap": true
                ]
            )
        ]
    )
)
```

```
OrderEvent.purchase(
    order = Order(
        id = "order-1",
        totalValue = 9.99,
        currency = "USD",
        attributes = mapOf(
            "PROMO_CODE" to "HELLO"
        ),
        lineItems = listOf(
            LineItem(
                catalogObjectId = "product-1",
                catalogObjectType = "Product",
                quantity = 1,
                price = 20.0,
                currency = "USD",
                attributes = mapOf(
                    "gift_wrap" to true
                )
            )
        )
    )
)
```

## Preorder Order Event

Capture when customers place preorders.

```
PreOrderEvent(
    order: Order(
        id: "order-1",
        totalValue: 9.99,
        currency: "USD",
        attributes: [
            "PROMO_CODE": "HELLO"
        ],
        lineItems: [
            LineItem(
                catalogObjectType: "Product",
                catalogObjectId: "product-11",
                quantity: 1,
                price: 20,
                currency: "USD",
                attributes: [
                    "gift_wrap": true
                ]
            )
        ]
    )
)
```

```
OrderEvent.preorder(
    order = Order(
        id = "order-1",
        totalValue = 9.99,
        currency = "USD",
        attributes = mapOf(
            "PROMO_CODE" to "HELLO"
        ),
        lineItems = listOf(
            LineItem(
                catalogObjectId = "product-1",
                catalogObjectType = "Product",
                quantity = 1,
                price = 20.0,
                currency = "USD",
                attributes = mapOf(
                    "gift_wrap" to true
                )
            )
        )
    )
)
```

## Cancel Order Event

Track when customers cancel orders.

```
CancelOrderEvent(
    order: Order(
        id: "order-1",
        totalValue: 9.99,
        currency: "USD",
        attributes: [
            "PROMO_CODE": "HELLO"
        ],
        lineItems: [
            LineItem(
                catalogObjectType: "Product",
                catalogObjectId: "product-11",
                quantity: 1,
                price: 20,
                currency: "USD",
                attributes: [
                    "gift_wrap": true
                ]
            )
        ]
    )
)
```

```
OrderEvent.cancel(
    order = Order(
        id = "order-1",
        totalValue = 9.99,
        currency = "USD",
        attributes = mapOf(
            "PROMO_CODE" to "HELLO"
        ),
        lineItems = listOf(
            LineItem(
                catalogObjectId = "product-1",
                catalogObjectType = "Product",
                quantity = 1,
                price = 20.0,
                currency = "USD",
                attributes = mapOf(
                    "gift_wrap" to true
                )
            )
        )
    )
)
```

## Ship Order Event

Monitor when orders are shipped.

```
ShipOrderEvent(
    order: Order(
        id: "order-1",
        totalValue: 9.99,
        currency: "USD",
        attributes: [
            "PROMO_CODE": "HELLO"
        ],
        lineItems: [
            LineItem(
                catalogObjectType: "Product",
                catalogObjectId: "product-11",
                quantity: 1,
                price: 20,
                currency: "USD",
                attributes: [
                    "gift_wrap": true
                ]
            )
        ]
    )
)
```

```
OrderEvent.ship(
    order = Order(
        id = "order-1",
        totalValue = 9.99,
        currency = "USD",
        attributes = mapOf(
            "PROMO_CODE" to "HELLO"
        ),
        lineItems = listOf(
            LineItem(
                catalogObjectId = "product-1",
                catalogObjectType = "Product",
                quantity = 1,
                price = 20.0,
                currency = "USD",
                attributes = mapOf(
                    "gift_wrap" to true
                )
            )
        )
    )
)
```

## Deliver Order Event

Track when orders are delivered.

```
DeliverOrderEvent(
    order: Order(
        id: "order-1",
        totalValue: 9.99,
        currency: "USD",
        attributes: [
            "PROMO_CODE": "HELLO"
        ],
        lineItems: [
            LineItem(
                catalogObjectType: "Product",
                catalogObjectId: "product-11",
                quantity: 1,
                price: 20,
                currency: "USD",
                attributes: [
                    "gift_wrap": true
                ]
            )
        ]
    )
)
```

```
OrderEvent.deliver(
    order = Order(
        id = "order-1",
        totalValue = 9.99,
        currency = "USD",
        attributes = mapOf(
            "PROMO_CODE" to "HELLO"
        ),
        lineItems = listOf(
            LineItem(
                catalogObjectId = "product-1",
                catalogObjectType = "Product",
                quantity = 1,
                price = 20.0,
                currency = "USD",
                attributes = mapOf(
                    "gift_wrap" to true
                )
            )
        )
    )
)
```

## Return Order Event

Capture when customers return orders.

```
ReturnOrderEvent(
    order: Order(
        id: "order-1",
        totalValue: 9.99,
        currency: "USD",
        attributes: [
            "PROMO_CODE": "HELLO"
        ],
        lineItems: [
            LineItem(
                catalogObjectType: "Product",
                catalogObjectId: "product-11",
                quantity: 1,
                price: 20,
                currency: "USD",
                attributes: [
                    "gift_wrap": true
                ]
            )
        ]
    )
)
```

```
OrderEvent.returnOrder(
    order = Order(
        id = "order-1",
        totalValue = 9.99,
        currency = "USD",
        attributes = mapOf(
            "PROMO_CODE" to "HELLO"
        ),
        lineItems = listOf(
            LineItem(
                catalogObjectId = "product-1",
                catalogObjectType = "Product",
                quantity = 1,
                price = 20.0,
                currency = "USD",
                attributes = mapOf(
                    "gift_wrap" to true
                )
            )
        )
    )
)
```

## Exchange Order Event

Track when customers exchange orders.

```
ExchangeOrderEvent(
    order: Order(
        id: "order-1",
        totalValue: 9.99,
        currency: "USD",
        attributes: [
            "PROMO_CODE": "HELLO"
        ],
        lineItems: [
            LineItem(
                catalogObjectType: "Product",
                catalogObjectId: "product-11",
                quantity: 1,
                price: 20,
                currency: "USD",
                attributes: [
                    "gift_wrap": true
                ]
            )
        ]
    )
)
```

```
OrderEvent.exchange(
    order = Order(
        id = "order-1",
        totalValue = 9.99,
        currency = "USD",
        attributes = mapOf(
            "PROMO_CODE" to "HELLO"
        ),
        lineItems = listOf(
            LineItem(
                catalogObjectId = "product-1",
                catalogObjectType = "Product",
                quantity = 1,
                price = 20.0,
                currency = "USD",
                attributes = mapOf(
                    "gift_wrap" to true
                )
            )
        )
    )
)
```
