Use line item properties to populate delivery dates and time windows

EasyRoutes supports time window and delivery date information in order attributes. However, some date picker and booking apps store this information in line item properties (for example, on the main product in the cart), and EasyRoutes doesn’t read those directly.

You can use Shopify Flow and the Shopify Admin GraphQL API to copy delivery details from line item properties into order attributes as orders are created.

This article shows how to:

  • Detect delivery-related details stored on a line item
  • Copy those values into order attributes using the orderUpdate   mutation
  • Ensure the attributes are in a format that EasyRoutes can use for delivery dates and time windows

Example: delivery info stored on a line item

Here’s a simplified example of a cart or order where the main product includes delivery information in its line item properties:

JSON

{
  "items": [
    {
      "id": 42987635638427,
      "properties": {
        "Method": "Local delivery",
        "Delivery Date": "January 31, 2026",
        "Delivery Day": "Saturday",
        "Delivery Time": "6:00 AM - 9:00 AM"
      },
      "quantity": 1,
      "title": "Product Mode Demo",
      ...
    },
    {
      "id": 42987641831579,
      "properties": {},
      "quantity": 1,
      "title": "Saturday delivery",
      ...
    }
  ]
}

We want to translate that into order attributes:

  • Delivery Date: January 31, 2026   
  • Delivery Time: 6:00 AM - 9:00 AM   

so that EasyRoutes can read dates and time windows when generating routes.


How this works: orderUpdate    and customAttributes   

Shopify’s Admin GraphQL API has an orderUpdate    mutation that lets you update an existing order. We’ll use its customAttributes    field:

  • OrderInput.customAttributes    is a list of key–value pairs.
  • These show up as order attributes (Additional details) in the Shopify admin.
  • EasyRoutes can be configured to look at these attributes for delivery information.

Under the hood, Shopify Flow will call something like:

Operation

Open in GraphiQL

mutation OrderUpdate($input: OrderInput!) {
  orderUpdate(input: $input) {
    order {
      id
      customAttributes {
        key
        value
      }
    }
    userErrors {
      field
      message
    }
  }
}


We won’t paste this mutation into Flow directly — Flow’s Send admin API request action handles the GraphQL mutation. What you configure in Flow is the input    JSON for OrderInput   .

Important: According to the OrderInput    speccustomAttributes   replaces the existing order attributes. If the store already uses order attributes for other data, you’ll need to include both the existing attributes and your new Delivery Date / Delivery Time attributes in the same list.


Overview of the Flow you’ll build

You’ll create a Shopify Flow workflow that:

  1. Triggers when an order is created.
  2. Locates the line item that holds your delivery properties.
  3. Pulls values like Delivery Date    and Delivery Time    from that line item’s properties.
  4. Calls Send admin API request (Admin GraphQL) to run orderUpdate   and set the corresponding order attributes.

We’ll assume:

  • There is at least one line item with properties such as Delivery Date   and Delivery Time   .
  • Either:
    • Only one line item has these properties (typical), or
    • You treat the first such line item as the “source of truth”.

Step 1 – Confirm your line item properties

Start by confirming exactly how your line item properties look in Shopify:

  1. In Shopify admin, open an order created by your storefront or app.
  2. Scroll to the line items section.
  3. Expand the line item that contains the delivery information.

You should see something like:

  • Properties:
    • Method: Local delivery   
    • Delivery Date: January 31, 2026   
    • Delivery Day: Saturday   
    • Delivery Time: 6:00 AM - 9:00 AM   

These names and values are what we will map into order attributes.


Step 2 – Create a Flow triggered on order creation

  1. In the Shopify admin, go to Apps → Shopify Flow.
  2. Click Create workflow.
  3. Set the Trigger to Order created.

This ensures the workflow runs whenever a new order is placed.


Step 3 – (Optional) Add a condition to check for delivery properties

To avoid running this logic for orders that don’t have delivery information, you can add a condition.

  1. After Order created, add a Condition.

    Configure it to check for line item properties that contain delivery info. For example:

    • Condition: Order → Line items → any line item → Properties → key is equal to Delivery Date   

      or

    • Condition: Order → Line items → any line item → Properties → key is equal to Delivery Time   

The exact options will depend on the Flow UI, but the goal is to proceed only if at least one line item has the delivery-related properties you expect.

Under the “Yes” branch of this condition, you’ll add the API call.


Step 4 – Add “Send admin API request” to write order attributes

Now we’ll configure a Send admin API request action to call orderUpdate   and set the order attributes.

  1. Under the “Yes” branch of your condition, click Add action.
  2. Choose Send admin API request.
  3. For API type, select Admin GraphQL API.
  4. In the Request body field, we’ll construct the input    JSON that will be sent to orderUpdate   .

Mapping from line item properties to order attributes

We want to map:

  • Line item property Delivery Date    → Order attribute Delivery Date   
  • Line item property Delivery Time    → Order attribute Delivery Time   

The conceptual JSON looks like:

JSON

{
  "input": {
    "id": "{{order.id}}",
    "customAttributes": [
      {
        "key": "Delivery Date",
        "value": {{line_item_delivery_date_value}}
      },
      {
        "key": "Delivery Time",
        "value": {{line_item_delivery_time_value}}
      }
    ]
  }
}


You do not type the {{line_item_delivery_date_value}}    placeholders directly. Instead, you’ll use Add a variable to pull in the correct line item property values.

In practice, configuring the JSON in Flow

  1. Start by typing this base JSON into the Request body:

JSON

   {
     "input": {
       "id": "{{order.id}}",
       "customAttributes": [
         {
           "key": "Delivery Date",
           "value": ""
         },
         {
           "key": "Delivery Time",
           "value": ""
         }
       ]
     }
   }


  1. Place your cursor inside the first "value": ""    (for Delivery Date   ).

    Click Add a variable.

    Navigate through the variable picker to the line item property that contains the delivery date. This will typically look like:

    • Order → Line items → [pick the line item] → Properties → Delivery Date → value

      or, if Flow exposes them in a slightly different structure, choose the property that clearly represents the line item’s “Delivery Date” value.

  2. Flow will insert a template placeholder, something like:

JSON

   {
     "key": "Delivery Date",
     "value": "{{order.line_items[0].properties['Delivery Date']}}"
   }

(The exact syntax may differ, but Flow will generate it for you.)

  1. Repeat for "Delivery Time"   :
    • Place your cursor in the second "value": ""   .
    • Click Add a variable and select:

      Order → Line items → [same line item] → Properties → Delivery Time → value

After these steps, your Request body will be wired so that, for each new order, Flow:

  • Looks up the target line item’s Delivery Date    and Delivery Time   properties.
  • Sends those values as the value    fields in customAttributes    for orderUpdate   .

What the mutation does

Behind the scenes, Flow uses the orderUpdate    mutation with the input   you’ve provided. customAttributes    will end up with:

  • Delivery Date: January 31, 2026   
  • Delivery Time: 6:00 AM - 9:00 AM   

These attributes are then visible in the Shopify admin under Additional details / Order attributes, and EasyRoutes can read them when preparing routes.


Handling multiple line items with delivery info (optional)

If there’s a chance that multiple line items might have their own delivery properties (for example, multiple gift deliveries in the same order), you have two options:

  1. Single-order-level delivery info (most common):
    • Decide on a rule such as “Use the first line item with a delivery date” or “Use the main product only”.
    • In Flow, use the variable picker to reference that specific line item’s properties (for example, always the first line item, or a line item that matches a specific product title/handle).
  2. Advanced per-line-item handling:
    • Instead of writing order attributes, use line item–level data or an app that supports per-line-item delivery details. 
    • This is a more complex setup and is outside the scope of this article, since EasyRoutes primarily relies on order-level attributes.

For most delivery-routing use cases, option 1 (mapping a single line item’s properties to order attributes) is sufficient.


Attribute names and formats supported by EasyRoutes

EasyRoutes looks for specific attribute names and value formats when reading delivery dates and time windows.

In this article we’ve used:

  • Delivery Date    as the attribute key for the delivery date (for example, January 31, 2026   )
  • Delivery Time    as the attribute key for the time window (for example, 6:00 AM - 9:00 AM   )

Make sure that:

  • The attribute keys in your customAttributes    list match what EasyRoutes expects.
  • The value strings follow one of the supported date/time formats described in the docs above.

Notes and limitations

  • Order attributes are replaced:

    As documented in the OrderInput    reference, providing customAttributes    to orderUpdate    replaces all existing order attributes on the order. If the merchant already uses order attributes for other purposes, your Flow must include both existing and new attributes in the same customAttributes    array.

  • Line item selection logic:
  • If you have multiple line items, make sure your Flow logic clearly chooses which line item’s properties to use. You can:
    • Filter by product title, handle, or SKU.
    • Use the first line item that contains the delivery properties you care about.
  • Shopify Flow and plan requirements:

    This setup requires Shopify Flow and access to the Admin GraphQL API. Ensure the store’s plan includes Flow and that the app/flow has the necessary permissions to call orderUpdate   .


Learn more

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.