> For the complete documentation index, see [llms.txt](https://learn.fueled.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.fueled.io/integrations/destinations/segment.com/segment-event-specifications/order-completed.md).

# Order Completed

### Description <a href="#id-57eff11f-9986-46a5-9322-41cb7a66da4f" id="id-57eff11f-9986-46a5-9322-41cb7a66da4f"></a>

The `Order Completed` event fires when an order is successfully place. Depending upon a merchant’s needs, Fueled implements this event either client-side or server-side.

### Instrumentation <a href="#f620aac1-0878-4d8c-9f71-04869fa4c5e3" id="f620aac1-0878-4d8c-9f71-04869fa4c5e3"></a>

When implemented client-side, this event is implemented with our javascript analytics library. The tracking code is managed in the storefront theme, and this event fires on the storefront “Thank You” Page once an order has been completed. When implemented server-side, this event fires when Shopify signals (via a webhook) that an order has been placed.

**Event Properties**

| Property               | Type   | Description                                                                                                                                                                       |
| ---------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| order\_id              | Number | Order/transaction ID                                                                                                                                                              |
| affiliation            | String | Store or affiliation from which this transaction occurred (e.g. Google Store)                                                                                                     |
| checkout\_id           | String | Checkout ID                                                                                                                                                                       |
| value                  | Number | Revenue ($) with discounts and coupons added in. For better flexibility and total control over tracking, we let you decide how to calculate how coupons and discounts are applied |
| revenue                | Number | Revenue ($) associated with the transaction (excluding shipping and tax)                                                                                                          |
| shipping               | Number | Shipping cost associated with the transaction                                                                                                                                     |
| tax                    | Number | Total tax associated with the transaction                                                                                                                                         |
| discount               | Number | Total discount associated with the transaction                                                                                                                                    |
| coupon                 | String | Transaction coupon redeemed with the transaction                                                                                                                                  |
| currency               | String | [Currency code](https://support.google.com/analytics/answer/6205902#supported-currencies) associated with the transaction                                                         |
| products               | Array  | Products in the order                                                                                                                                                             |
| products.$.product\_id | String | Database id of the product being viewed                                                                                                                                           |
| products.$.sku         | String | Sku of the product being viewed                                                                                                                                                   |
| products.$.name        | String | Name of the product being viewed                                                                                                                                                  |
| products.$.brand       | String | Brand associated with the product                                                                                                                                                 |
| products.$.variant     | String | Variant of the product (e.g. Black)                                                                                                                                               |
| products.$.price       | Number | Price ($) of the product being viewed                                                                                                                                             |
| products.$.quantity    | Number | Quantity of a product                                                                                                                                                             |
| products.$.coupon      | String | Coupon code associated with a product (e.g MAY\_DEALS\_3)                                                                                                                         |
| products.$.position    | Number | Position in the product list (ex. 3)                                                                                                                                              |
| products.$.url         | String | URL of the product page                                                                                                                                                           |
| products.$.image\_url  | String | Image url of the product                                                                                                                                                          |

### Example: <a href="#a8e741f4-7689-4cf7-98c1-edbd968e81a0" id="a8e741f4-7689-4cf7-98c1-edbd968e81a0"></a>

```javascript
analytics.track('Order Completed', {
  order_id: '10254g8e9bcf0000450035100',
  affiliation: 'Google Store',
  value: 30,
  revenue: 25.00,
  shipping: 3,
  tax: 2,
  discount: 2.5,
  coupon: 'hasbros',
  currency: 'USD',
  products: [
    {
      product_id: '509f1f77bcf86cd739734079',
      sku: '337790-12',
      name: 'Monopoly: 3rd Edition',
      price: 19,
      quantity: 1,
      url: 'https://www.example.com/product/path',
      image_url: 'https://www.example.com/product/path.jpg'
    },
    {
      product_id: '202gr79735evb509fc183733',
      sku: '46932-52',
      name: 'Uno Card Game',
      price: 3,
      quantity: 2,
    }
  ]
});
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.fueled.io/integrations/destinations/segment.com/segment-event-specifications/order-completed.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
