Bug: Checkout URL only shows 1 item after draftOrderUpdate via Flow

Hi all,

I’m running into a strange issue when using Shopify Flow with the Admin API. After updating a draft order’s line items via draftOrderUpdate, the checkout URL only displays one item, even though the draft order contains multiple line items.

Steps to reproduce:

  1. Create a Flow triggered by “Draft order created”, and add a “Send Admin API request” action
  2. In the API request, I’m using draftOrderUpdate mutation to add custom attributes to each line item. Here’s the JSON I’m using:
{
  "id": "{{draftOrder.id}}",
  "input": {
    "lineItems": [
      {% for line in draftOrder.lineItems %}
      {
          "customAttributes": [
              {
                "key": "_custom_id",
                "value": "{{ line.id }}"
              }
          ],  
          "quantity": {{ line.quantity }},
          "requiresShipping": true,
          "sku": "{{ line.variant.sku }}",
          "taxable": true,
          "title": "{{ line.title }}",
          "variantId": "{{ line.variant.id }}",
          "weight": {
            "value": {{ line.weight.value }},
            "unit": "{{ line.weight.unit }}"
          },
          "uuid": "{{ line.id }}"
        }
        {% unless forloop.last %},{% endunless %}
      {% endfor %}
    ]
  }
}
  1. Create a draft order with multiple line items and trigger the Flow (manually or automatically).
  2. Ensure that Flow has updated the line items
  3. click “Share” on the draft order to get the checkout URL
  4. Open the checkout URL, only one item shows in the cart.

Notes:

  • If I disable Flow - so the draft order is unedited, the checkout URL shows all items correctly.

Am I doing something wrong or is this a bug?

Any insight would be appreciated. Many thanks!

Moving this to the Flow board as the folks there might be able to help troubleshoot this further.

Hi Liam, it’s not just a Flow issue, I believe it’s actually related to the Admin API. I initially demonstrated the problem using Flow, but the same issue occurs when I run the mutation directly via GraphQL app.

Hi! Would someone be able to help me with this request?