> For the complete documentation index, see [llms.txt](https://docs.getpurpledot.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getpurpledot.com/docs/shopify-stores/pre-order-tracking/braze-integration.md).

# Braze integration

{% hint style="info" %}
This guide applies only when selling pre-orders through Purple Dot's own checkout. Pre-orders sold through the Shopify checkout benefit from the same tracking as your regular sales.
{% endhint %}

If you have enabled the Braze integration from the Integration settings page in the [Merchant Portal](https://www.purpledotprice.com/merchant-portal/integration), when a shopper buys a pre‑order the Purple Dot checkout will send one `POST /users/track` request that:

1. Upserts marketing consent to the shopper’s profile  ( `attributes`)
2. Logs the `pre_order_placed` event (`events`)
3. Emits a purchase row per line‑item (`purchases`)

***

```
{
  "attributes": [
    {
      "email": "<shopper_email>",
      "has_email_marketing_consent": <true|false>,
      "has_sms_marketing_consent": <true|false>
    }
  ],
  "events": [
    {
      "email": "<shopper_email>",
      "name": "pre_order_placed",
      "time": "<ISO8601_timestamp>",
      "properties": {
        "order_id": "<pre_order_reference>",
        "source": "Purple Dot",
        "shipping": {
          "address": {
            "first_name": "<first_name>",
            "last_name": "<last_name>",
            "address1": "<address_line_1>",
            "address2": "<address_line_2>",
            "city": "<city>",
            "region": "<state_or_region>",
            "country": "<country_code>",
            "postal_code": "<postal_code>",
            "phone_number": "<phone_number>"
          }
        },
        "total_price":  { 
            amount: <pre-order total price>,
            currency: <price currency> 
        },
        "discounts": <array_of_discount_objects>,
        "items": [{
            product_id: <line-item product ID>,
            product_name: <line-item product name>,
            variant_id: <line-item variant ID>,
            sku: <line-item variant SKU>,
            quantity: <line-item quantity>,
            item_price: <price of single item>,
            row_total: <total price of row>, 
        }]
      }
    }
  ],
  "purchases": [{
    email: "<shopper_email>",
    time: "<ISO8601_timestamp>",
    currency: <pre_order currency>,

    product_id:  <line-item product ID>,
    product_name: <line-item product name>,
    variant_id: <line-item variant ID>,
    sku:<line-item variant SKU>,
    quantity:  <line-item quantity>,
    price: <price of single item>,
  }]
}
```
