> For the complete documentation index, see [llms.txt](https://docs.chord.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chord.co/reference/apis/order-completed.md).

# Order Completed

## Order Completed

This event is triggered when a customer completes a purchase.

## Properties

| **Name**           | **Type**   | **Description**                                                                          | **Required** |
| ------------------ | ---------- | ---------------------------------------------------------------------------------------- | ------------ |
| `affiliation`      | `string`   | Store or affiliation from which this transaction occurred (for example, "Google Store"). | No           |
| `channel`          | `string`   | The sales channel                                                                        | No           |
| `checkout_id`      | `string`   | ID of the checkout session for the purchase                                              | No           |
| `checkout_type`    | `string`   | Checkout provider (e.g. `Stripe`)                                                        | No           |
| `currency`         | `string`   | ISO currency code of the transaction (e.g. `USD`)                                        | Yes          |
| `discount`         | `number`   | The total discount applied to the order                                                  | No           |
| `email`            | `string`   | Email address associated with the order                                                  | No           |
| `first_name`       | `string`   | Customer's first name                                                                    | No           |
| `last_name`        | `string`   | Customer's last name                                                                     | No           |
| `order_date`       | `date`     | Date and time the order was placed                                                       | Yes          |
| `order_id`         | `string`   | Order/transaction ID                                                                     | Yes          |
| `phone`            | `string`   | Customer's phone number                                                                  | No           |
| `products`         | `object[]` | Products in the order                                                                    | Yes          |
| `revenue`          | `number`   | Revenue ($) associated with the transaction (excluding shipping and tax)                 | Yes          |
| `shipping`         | `number`   | The total amount for shipping                                                            | No           |
| `shipping_city`    | `string`   | City of the shipping address                                                             | No           |
| `shipping_country` | `string`   | ISO country code for the shipping address                                                | No           |
| `shipping_state`   | `string`   | ISO state code for the shipping address                                                  | No           |
| `shipping_zipcode` | `string`   | Zip or postal code for the shipping address                                              | No           |
| `subscription_id`  | `string`   | ID of the subscription created from this purchase, if applicable                         | No           |
| `subtotal`         | `number`   | Order total including discounts but excluding shipping and tax                           | No           |
| `tax`              | `number`   | The total tax captured on the order                                                      | No           |
| `total`            | `number`   | The order grand total, summing the subtotal, discount, shipping, and tax                 | Yes          |

### Products array

| **Name**       | **Type** | **Description**                                                                          | **Required** |
| -------------- | -------- | ---------------------------------------------------------------------------------------- | ------------ |
| `affiliation`  | `string` | Store or affiliation from which this transaction occurred (for example, "Google Store"). | No           |
| `brand`        | `string` | Brand associated with the product                                                        | No           |
| `line_item_id` | `string` | ID of the line item in the database                                                      | No           |
| `name`         | `string` | Name of the product                                                                      | Yes          |
| `position`     | `number` | Position in the product list                                                             | No           |
| `price`        | `number` | Price of the product                                                                     | Yes          |
| `product_id`   | `string` | ID of the product in the database                                                        | Yes          |
| `quantity`     | `number` | The quantity of products purchased in this line item                                     | Yes          |
| `revenue`      | `number` | Revenue ($) associated with this line item (excluding shipping and tax)                  | Yes          |
| `sku`          | `string` | SKU of the variant                                                                       | Yes          |
| `variant_name` | `string` | Name of the variant                                                                      | No           |
| `variant_id`   | `string` | ID of the variant in the database                                                        | No           |

## Sample payload

```json
{
  "type": "track",
  "event": "Order Completed",
  "properties": {
    "affiliation": "Afilliation",
    "checkout_id": "40854979018855",
    "checkout_type": "Shopify | OMS | Other",
    "currency": "USD",
    "discount": 5,
    "email": "user@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "order_date": "2025-09-12T11:45:45-07:00",
    "order_id": "6736819880039",
    "order_number": "1895671",
    "phone": "+15555555555",
    "revenue": 219,
    "shipping": 9.9,
    "shipping_city": "Fall River",
    "shipping_country": "US",
    "shipping_state": "MA",
    "shipping_zipcode": "02720",
    "subtotal": 219,
    "tax": 13.69,
    "total": 237.59,
    "products": [
      {
        "affiliation": "Affiliation",
        "brand": "Brand",
        "line_item_id": "16207084552295",
        "name": "Product Name",
        "position": 1,
        "price": 219,
        "product_id": "7036464939671",
        "quantity": 1,
        "revenue": 219,
        "sku": "SKU123",
        "variant": "Variant Name",
        "variant_id": "40952658057847"
      }
    ],
    "meta": {
      "i18n": {
        "currency": "USD",
        "locale": "en-US"
      },
      "platform": {
        "name": "Shopify | OMS | Other",
        "type": "web"
      },
      "store": {
        "domain": "domain"
      },
      "version": {
        "major": 3,
        "minor": 0,
        "patch": 0
      }
    }
  },
  "userId": "8046328840295",
  "anonymousId": "7a76b270-c318-4477-b1e1-33eac94dbd1e"
}
```

## Example

```bash
curl https://production.cdp.ingest.chord.co/api/track \
--header "Content-Type: application/json" \
--header "X-Write-Key: $CDP_WRITE_KEY" \
--data-raw '{
{
  "type": "track",
  "event": "Order Completed",
  "properties": {}
  "meta": {},
  "userId": "123456",
  "anonymousId": "7a76b270-c318-4477-b1e1-33eac94dbd1e"
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chord.co/reference/apis/order-completed.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
