## Overview
Order events represent the key events once the customer **finishes the checkout process**, **completes the purchase**, and the **order confirmation page loads**. Affirm’s machine learning systems draw upon this transaction data to improve our marketing products off- and onsite, providing more relevant, better converting financial offers to your customers over time.
## trackOrderConfirmed ([Order](🔗), Optional[Strict])
An event triggered when a customer completes the purchase. You can measure the sale of one or more products by this event.
#### Parameters
Parameters | Data type | Description |
`order ` <span style="color:red">required</span> | _object_ | The confirmed order. |
`strict `
_optional_ | _boolean_ | True/False flag for ensuring the `currency `, `orderID `, `paymentMethod `, and total are sent in the `Order ` object. This value must be true in order to use the new Enhanced Analytics implementation. |
#### Example
## trackOrderCancelled ([Order](🔗), Optional\[[Product](🔗), Optional[Strict])
An event triggered when a user cancels an order.
#### Parameters
Parameter | Data type | Description |
`order ` <span style="color:red">required</span> | _object_ | The canceled order. |
`product `
_optional_ | _array_ | Products that were canceled by this order. |
`strict `
_optional_ | _boolean_ | True/False flag for ensuring the `currency `, `orderID `, `paymentMethod `, and total are sent in the `Order ` object. This value must be true in order to use the new Enhanced Analytics implementation. |
#### Example
## trackOrderRefunded (String, String, Integer, Optional\[[Product](🔗)])
An event triggered when an order is partially or fully refunded.
#### Parameters
Parameter | Data type | Description |
`orderId ` <span style="color:red">required</span> | _string_ | A unique identifier representing the transaction to fully or partially refund. |
`amount ` <span style="color:red">required</span> | _integer_ | The amount to refund, either partially or fully. |
`currency ` | _string_ | Three-letter ISO currency code, in uppercase. Possible values: - USD - CAD |
`product `
_optional_ | _array_ | An array of objects representing the products within the order correlated to the refund amount. |
#### Example
## trackOrderUpdated ([Order](🔗), Optional\[[Product](🔗)], Optional[Strict])
An event triggered when a user updates an order.
#### Parameters
Parameter | Data type | Description |
`order ` <span style="color:red">required</span> | _object_ | The updated order. |
`product `
_optional_ | _array_ | Products that were updated by this order. |
`strict `
_optional_ | _boolean_ | True/False flag for ensuring the `currency `, `orderID `, `paymentMethod `, and total are sent in the `Order ` object. This value must be true in order to use the new Enhanced Analytics implementation. |
#### Example
## Objects
### Order
Represents a single customer's checkout transaction. This includes parameters related to the transaction once the customer completes their checkout.
Parameter | Column Title | Description |
`order ` <span style="color:red">required</span> | _string_ | Unique identifier of order in your system |
`currency `
style="color:red">required</span> | _string_ | Three-letter ISO currency code, in uppercase. Possible values: - USD - CAD |
`paymentMethod ` <span style="color:red">required</span> | _string_ | Description of payment method used (ex. “Visa”, “Mastercard”, “Gift Card”) |
`total ` <span style="color:red">required</span> | _integer_ | The total value of the transaction, including tax and shipping. If not sent, this value will be automatically calculated using the product quantity and price fields of all products in the same hit. The value must be non-negative and represented as cents instead of dollars. |
### Product
Represents any offered product or service.
Parameter | Column Title | Description |
**brand** _optional_ | _string_
**Maximum length**: 500
**Protocol parameter**: `prbr ` | The brand of the product (e.g., Affirm). |
**category** _optional_ | _string_
**Maximum length**: 500
**Protocol parameter**: `prca ` | The category the product belongs to (e.g. Apparel). |
**coupon** _optional_ | _string_
**Maximum length**: 500
**Protocol parameter**: `prcc ` | Any coupon code associated with the particular instance of this product. |
**name** _optional_ | _string_
**Maximum length**: 500
**Protocol parameter**: `osn ` | The full name of the product (e.g., Affirm T-Shirt). |
**price** _optional_ | _integer_
**Protocol parameter**: `prpr ` | The price of the product. The value must be non-negative and represented as cents instead of dollars. |
**productID ** _optional_ | _string_
**Maximum length**: 500
**Protocol parameter**: `prid ` | A unique identifier representing the product, such as the SKU or an internal database identifier used by the merchant. |
**quantity** _optional_ | _integer_
**Protocol parameter**: `prqt ` | The quantity of the product. The value must be non-negative. |
**variant** _optional_ | _string_
**Maximum length**: 500
**Protocol parameter**: `prva ` | The variant of the product (e.g., black). |
**currency** _optional_ | _string_
**Protocol parameter**: `prcu ` | A [currency code](🔗) associated with this product (USD). |