> ## Documentation Index
> Fetch the complete documentation index at: https://docs.morf.health/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Order

> Event payload details and trigger documentation for Order data from Shopify

<img src="https://mintlify.s3.us-west-1.amazonaws.com/morfhealth/images/shopify.svg" alt="images/shopify.svg" />

# Events

## Triggering Webhook Types

The following event types are associated with the Order event payload from Shopify.

* `Shopify Order Created`

<RequestExample>
  ```json Example theme={null}
  {
    "billing_address": {
      "address1": "123 Shipping Street",
      "address2": "Suite 100",
      "city": "Shippington",
      "country": "United States",
      "country_code": "US",
      "first_name": "Steve",
      "last_name": "Shipper",
      "phone": "555-555-7447",
      "province": "Kentucky",
      "province_code": "KY",
      "zip": "40003"
    },
    "cancel_reason": "customer",
    "cancelled_at": null,
    "created_at": null,
    "currency": "USD",
    "customer": {
      "email": "john@example.com",
      "first_name": "John",
      "id": 115310627314723950,
      "last_name": "Smith",
      "phone": "+15555555555"
    },
    "email": "jon@example.com",
    "financial_status": "paid",
    "fulfillment_status": "fulfilled",
    "id": 820982911946154500,
    "line_items": [
      {
        "id": 487817672276298560,
        "name": "Aviator sunglasses",
        "price": "89.99",
        "product_id": 788032119674292900,
        "quantity": 1,
        "sku": "SKU2006-001",
        "title": "Aviator sunglasses",
        "variant_id": 12345678
      }
    ],
    "name": "#9999",
    "order_number": 1234,
    "shipping_address": {
      "address1": "123 Shipping Street",
      "address2": "Suite 100",
      "city": "Shippington",
      "country": "United States",
      "country_code": "US",
      "first_name": "Steve",
      "last_name": "Shipper",
      "phone": "555-555-7447",
      "province": "Kentucky",
      "province_code": "KY",
      "zip": "40003"
    },
    "tags": "tag1, tag2",
    "total_price": "404.95",
    "updated_at": null
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Description theme={null}
  {
    "billing_address": {
      "address1": "Street address line 1",
      "address2": "Street address line 2",
      "city": "City",
      "country": "Country name",
      "country_code": "Two-letter ISO country code",
      "first_name": "First name",
      "last_name": "Last name",
      "phone": "Phone number",
      "province": "Province or state name",
      "province_code": "Province or state code",
      "zip": "ZIP or postal code"
    },
    "cancel_reason": "Reason for cancellation if the order was cancelled",
    "cancelled_at": "When the order was cancelled, if applicable",
    "created_at": "When the order was placed",
    "currency": "Three-letter ISO currency code",
    "customer": {
      "email": "Customer email address",
      "first_name": "Customer first name",
      "id": "Shopify customer ID",
      "last_name": "Customer last name",
      "phone": "Customer phone number"
    },
    "email": "Contact email for the order",
    "financial_status": "Payment status, e.g. paid, pending, voided, refunded",
    "fulfillment_status": "Fulfillment status, e.g. fulfilled, partial, unfulfilled",
    "id": "Shopify order ID",
    "line_items": {
      "id": "Shopify line item ID",
      "name": "Line item display name (may include variant)",
      "price": "Unit price as a decimal string",
      "product_id": "Shopify product ID",
      "quantity": "Number of units",
      "sku": "Stock-keeping unit identifier",
      "title": "Product title",
      "variant_id": "Shopify product variant ID"
    },
    "name": "Human-readable order identifier, e.g. #9999",
    "order_number": "Sequential order number",
    "shipping_address": {
      "address1": "Street address line 1",
      "address2": "Street address line 2",
      "city": "City",
      "country": "Country name",
      "country_code": "Two-letter ISO country code",
      "first_name": "First name",
      "last_name": "Last name",
      "phone": "Phone number",
      "province": "Province or state name",
      "province_code": "Province or state code",
      "zip": "ZIP or postal code"
    },
    "tags": "Comma-separated list of tags applied to the order",
    "total_price": "Total order amount as a decimal string",
    "updated_at": "When the order was last updated"
  }
  ```
</ResponseExample>

### Payload Field Details

<ResponseField name="Order" type="Event Payload">
  <Expandable title="fields" defaultOpen="true">
    <ResponseField name="id" type="int64" required>
      Shopify order ID

      ```json CEL theme={null}
      id
      ```

      ```json Example theme={null}
      820982911946154500
      ```
    </ResponseField>

    <ResponseField name="name" type="string" required>
      Human-readable order identifier, e.g. #9999

      ```json CEL theme={null}
      name
      ```

      ```json Example theme={null}
      "#9999"
      ```
    </ResponseField>

    <ResponseField name="order_number" type="int64" required>
      Sequential order number

      ```json CEL theme={null}
      order_number
      ```

      ```json Example theme={null}
      1234
      ```
    </ResponseField>

    <ResponseField name="email" type="string">
      Contact email for the order

      ```json CEL theme={null}
      email
      ```

      ```json Example theme={null}
      "jon@example.com"
      ```
    </ResponseField>

    <ResponseField name="financial_status" type="string">
      Payment status, e.g. paid, pending, voided, refunded

      ```json CEL theme={null}
      financial_status
      ```

      ```json Example theme={null}
      "paid"
      ```
    </ResponseField>

    <ResponseField name="fulfillment_status" type="string">
      Fulfillment status, e.g. fulfilled, partial, unfulfilled

      ```json CEL theme={null}
      fulfillment_status
      ```

      ```json Example theme={null}
      "fulfilled"
      ```
    </ResponseField>

    <ResponseField name="total_price" type="string" required>
      Total order amount as a decimal string

      ```json CEL theme={null}
      total_price
      ```

      ```json Example theme={null}
      "404.95"
      ```
    </ResponseField>

    <ResponseField name="currency" type="string" required>
      Three-letter ISO currency code

      ```json CEL theme={null}
      currency
      ```

      ```json Example theme={null}
      "USD"
      ```
    </ResponseField>

    <ResponseField name="tags" type="string" required>
      Comma-separated list of tags applied to the order

      ```json CEL theme={null}
      tags
      ```

      ```json Example theme={null}
      "tag1, tag2"
      ```
    </ResponseField>

    <ResponseField name="cancel_reason" type="string">
      Reason for cancellation if the order was cancelled

      ```json CEL theme={null}
      cancel_reason
      ```

      ```json Example theme={null}
      "customer"
      ```
    </ResponseField>

    <ResponseField name="created_at" type="timing.v1.Timestamp" required>
      When the order was placed

      ```json CEL theme={null}
      created_at
      ```

      ```json Example theme={null}
      null
      ```
    </ResponseField>

    <ResponseField name="updated_at" type="timing.v1.Timestamp" required>
      When the order was last updated

      ```json CEL theme={null}
      updated_at
      ```

      ```json Example theme={null}
      null
      ```
    </ResponseField>

    <ResponseField name="cancelled_at" type="timing.v1.Timestamp">
      When the order was cancelled, if applicable

      ```json CEL theme={null}
      cancelled_at
      ```

      ```json Example theme={null}
      null
      ```
    </ResponseField>

    <ResponseField name="customer" type="object">
      Customer who placed the order

      ```json CEL theme={null}
      customer
      ```

      ```json Example theme={null}
      {
      "email": "john@example.com",
      "first_name": "John",
      "id": 115310627314723950,
      "last_name": "Smith",
      "phone": "+15555555555"
      }
      ```
    </ResponseField>

    <ResponseField name="customer.id" type="int64">
      Shopify customer ID

      ```json CEL theme={null}
      customer.id
      ```

      ```json Example theme={null}
      115310627314723950
      ```
    </ResponseField>

    <ResponseField name="customer.email" type="string">
      Customer email address

      ```json CEL theme={null}
      customer.email
      ```

      ```json Example theme={null}
      "john@example.com"
      ```
    </ResponseField>

    <ResponseField name="customer.first_name" type="string">
      Customer first name

      ```json CEL theme={null}
      customer.first_name
      ```

      ```json Example theme={null}
      "John"
      ```
    </ResponseField>

    <ResponseField name="customer.last_name" type="string">
      Customer last name

      ```json CEL theme={null}
      customer.last_name
      ```

      ```json Example theme={null}
      "Smith"
      ```
    </ResponseField>

    <ResponseField name="customer.phone" type="string">
      Customer phone number

      ```json CEL theme={null}
      customer.phone
      ```

      ```json Example theme={null}
      "+15555555555"
      ```
    </ResponseField>

    <ResponseField name="line_items" type="[]object" required>
      Products included in the order

      ```json CEL theme={null}
      line_items
      ```

      ```json Example theme={null}
      [
      {
      "id": 487817672276298560,
      "name": "Aviator sunglasses",
      "price": "89.99",
      "product_id": 788032119674292900,
      "quantity": 1,
      "sku": "SKU2006-001",
      "title": "Aviator sunglasses",
      "variant_id": 12345678
      }
      ]
      ```
    </ResponseField>

    <ResponseField name="line_items.map(x, x.id)" type="[]int64" required>
      Mapped array of: Shopify line item ID

      ```json CEL theme={null}
      line_items.map(x, x.id)
      ```

      ```json Example theme={null}
      [
      487817672276298560
      ]
      ```
    </ResponseField>

    <ResponseField name="line_items.map(x, x.title)" type="[]string" required>
      Mapped array of: Product title

      ```json CEL theme={null}
      line_items.map(x, x.title)
      ```

      ```json Example theme={null}
      [
      "Aviator sunglasses"
      ]
      ```
    </ResponseField>

    <ResponseField name="line_items.map(x, x.name)" type="[]string" required>
      Mapped array of: Line item display name (may include variant)

      ```json CEL theme={null}
      line_items.map(x, x.name)
      ```

      ```json Example theme={null}
      [
      "Aviator sunglasses"
      ]
      ```
    </ResponseField>

    <ResponseField name="line_items.map(x, x.quantity)" type="[]int64" required>
      Mapped array of: Number of units

      ```json CEL theme={null}
      line_items.map(x, x.quantity)
      ```

      ```json Example theme={null}
      [
      1
      ]
      ```
    </ResponseField>

    <ResponseField name="line_items.map(x, x.price)" type="[]string" required>
      Mapped array of: Unit price as a decimal string

      ```json CEL theme={null}
      line_items.map(x, x.price)
      ```

      ```json Example theme={null}
      [
      "89.99"
      ]
      ```
    </ResponseField>

    <ResponseField name="line_items.map(x, x.sku)" type="[]string" required>
      Mapped array of: Stock-keeping unit identifier

      ```json CEL theme={null}
      line_items.map(x, x.sku)
      ```

      ```json Example theme={null}
      [
      "SKU2006-001"
      ]
      ```
    </ResponseField>

    <ResponseField name="line_items.map(x, x.product_id)" type="[]int64" required>
      Mapped array of: Shopify product ID

      ```json CEL theme={null}
      line_items.map(x, x.product_id)
      ```

      ```json Example theme={null}
      [
      788032119674292900
      ]
      ```
    </ResponseField>

    <ResponseField name="line_items.map(x, x.variant_id)" type="[]int64" required>
      Mapped array of: Shopify product variant ID

      ```json CEL theme={null}
      line_items.map(x, x.variant_id)
      ```

      ```json Example theme={null}
      [
      12345678
      ]
      ```
    </ResponseField>

    <ResponseField name="billing_address" type="object">
      Billing address for the order

      ```json CEL theme={null}
      billing_address
      ```

      ```json Example theme={null}
      {
      "address1": "123 Shipping Street",
      "address2": "Suite 100",
      "city": "Shippington",
      "country": "United States",
      "country_code": "US",
      "first_name": "Steve",
      "last_name": "Shipper",
      "phone": "555-555-7447",
      "province": "Kentucky",
      "province_code": "KY",
      "zip": "40003"
      }
      ```
    </ResponseField>

    <ResponseField name="billing_address.first_name" type="string">
      First name

      ```json CEL theme={null}
      billing_address.first_name
      ```

      ```json Example theme={null}
      "Steve"
      ```
    </ResponseField>

    <ResponseField name="billing_address.last_name" type="string">
      Last name

      ```json CEL theme={null}
      billing_address.last_name
      ```

      ```json Example theme={null}
      "Shipper"
      ```
    </ResponseField>

    <ResponseField name="billing_address.address1" type="string">
      Street address line 1

      ```json CEL theme={null}
      billing_address.address1
      ```

      ```json Example theme={null}
      "123 Shipping Street"
      ```
    </ResponseField>

    <ResponseField name="billing_address.address2" type="string">
      Street address line 2

      ```json CEL theme={null}
      billing_address.address2
      ```

      ```json Example theme={null}
      "Suite 100"
      ```
    </ResponseField>

    <ResponseField name="billing_address.city" type="string">
      City

      ```json CEL theme={null}
      billing_address.city
      ```

      ```json Example theme={null}
      "Shippington"
      ```
    </ResponseField>

    <ResponseField name="billing_address.province" type="string">
      Province or state name

      ```json CEL theme={null}
      billing_address.province
      ```

      ```json Example theme={null}
      "Kentucky"
      ```
    </ResponseField>

    <ResponseField name="billing_address.country" type="string">
      Country name

      ```json CEL theme={null}
      billing_address.country
      ```

      ```json Example theme={null}
      "United States"
      ```
    </ResponseField>

    <ResponseField name="billing_address.zip" type="string">
      ZIP or postal code

      ```json CEL theme={null}
      billing_address.zip
      ```

      ```json Example theme={null}
      "40003"
      ```
    </ResponseField>

    <ResponseField name="billing_address.phone" type="string">
      Phone number

      ```json CEL theme={null}
      billing_address.phone
      ```

      ```json Example theme={null}
      "555-555-7447"
      ```
    </ResponseField>

    <ResponseField name="billing_address.country_code" type="string">
      Two-letter ISO country code

      ```json CEL theme={null}
      billing_address.country_code
      ```

      ```json Example theme={null}
      "US"
      ```
    </ResponseField>

    <ResponseField name="billing_address.province_code" type="string">
      Province or state code

      ```json CEL theme={null}
      billing_address.province_code
      ```

      ```json Example theme={null}
      "KY"
      ```
    </ResponseField>

    <ResponseField name="shipping_address" type="object">
      Shipping address for the order

      ```json CEL theme={null}
      shipping_address
      ```

      ```json Example theme={null}
      {
      "address1": "123 Shipping Street",
      "address2": "Suite 100",
      "city": "Shippington",
      "country": "United States",
      "country_code": "US",
      "first_name": "Steve",
      "last_name": "Shipper",
      "phone": "555-555-7447",
      "province": "Kentucky",
      "province_code": "KY",
      "zip": "40003"
      }
      ```
    </ResponseField>

    <ResponseField name="shipping_address.first_name" type="string">
      First name

      ```json CEL theme={null}
      shipping_address.first_name
      ```

      ```json Example theme={null}
      "Steve"
      ```
    </ResponseField>

    <ResponseField name="shipping_address.last_name" type="string">
      Last name

      ```json CEL theme={null}
      shipping_address.last_name
      ```

      ```json Example theme={null}
      "Shipper"
      ```
    </ResponseField>

    <ResponseField name="shipping_address.address1" type="string">
      Street address line 1

      ```json CEL theme={null}
      shipping_address.address1
      ```

      ```json Example theme={null}
      "123 Shipping Street"
      ```
    </ResponseField>

    <ResponseField name="shipping_address.address2" type="string">
      Street address line 2

      ```json CEL theme={null}
      shipping_address.address2
      ```

      ```json Example theme={null}
      "Suite 100"
      ```
    </ResponseField>

    <ResponseField name="shipping_address.city" type="string">
      City

      ```json CEL theme={null}
      shipping_address.city
      ```

      ```json Example theme={null}
      "Shippington"
      ```
    </ResponseField>

    <ResponseField name="shipping_address.province" type="string">
      Province or state name

      ```json CEL theme={null}
      shipping_address.province
      ```

      ```json Example theme={null}
      "Kentucky"
      ```
    </ResponseField>

    <ResponseField name="shipping_address.country" type="string">
      Country name

      ```json CEL theme={null}
      shipping_address.country
      ```

      ```json Example theme={null}
      "United States"
      ```
    </ResponseField>

    <ResponseField name="shipping_address.zip" type="string">
      ZIP or postal code

      ```json CEL theme={null}
      shipping_address.zip
      ```

      ```json Example theme={null}
      "40003"
      ```
    </ResponseField>

    <ResponseField name="shipping_address.phone" type="string">
      Phone number

      ```json CEL theme={null}
      shipping_address.phone
      ```

      ```json Example theme={null}
      "555-555-7447"
      ```
    </ResponseField>

    <ResponseField name="shipping_address.country_code" type="string">
      Two-letter ISO country code

      ```json CEL theme={null}
      shipping_address.country_code
      ```

      ```json Example theme={null}
      "US"
      ```
    </ResponseField>

    <ResponseField name="shipping_address.province_code" type="string">
      Province or state code

      ```json CEL theme={null}
      shipping_address.province_code
      ```

      ```json Example theme={null}
      "KY"
      ```
    </ResponseField>
  </Expandable>
</ResponseField>
