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

# How do I edit an order after it's been created?

> Add, change, or remove line items while the order is in received status. Address, external_id, and shipping preferences use PATCH /api/v1/orders/{order_id} and stay editable later in the pipeline.

There are two different editing windows on a Blend order, and confusing them is the most common source of unexpected `400`s.

**Line items** — adding products, changing quantities, removing a line — are editable while the order is in `received`. Once picking begins, the contents are fixed.

**Address, `external_id`, and shipping preferences** go through `PATCH /api/v1/orders/{order_id}` and remain editable further into the pipeline. Shipping options, including address, can be edited up until the moment a shipping label has been purchased.

## Add products to an existing order

```bash theme={null}
curl -X POST https://api.byblend.com/api/v1/orders/ORD250312003548IAU4/products \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "prescription": [
      { "product_code": "HC-RAPA31", "quantity": 1 }
    ],
    "non_prescription": [
      { "sku": "SHARPS-SM", "quantity": 2 }
    ]
  }'
```

Product references follow the same rules as order creation: Blend `id`, your `sku`, or `product_code` for prescription products.

## Change or remove a line

```bash theme={null}
# Change quantity
curl -X PATCH "https://api.byblend.com/api/v1/orders/{order_id}/products/prescription/{id}" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{ "quantity": 2 }'

# Remove the line
curl -X DELETE "https://api.byblend.com/api/v1/orders/{order_id}/products/prescription/{id}" \
  -H "Authorization: Bearer {access_token}"
```

`product_type` in the path is one of `prescription`, `non_prescription`, or `order_material`.

<Warning>
  If the **same product appears more than once** on an order, you must pass the `order_item_id` query parameter to say which line you mean. Take the value from the order's `products` object. Without it, Blend can't disambiguate.
</Warning>

## Update the address, external ID, or shipping

```bash theme={null}
curl -X PATCH "https://api.byblend.com/api/v1/orders/ORD250312003548IAU4?update_patient=true" \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "address": {
      "address_1": "22 Beacon Street",
      "city": "Boston",
      "state": "MA",
      "zip_code": "02108"
    },
    "external_id": "my-system-128318AA2"
  }'
```

This is a partial update — send only the fields you're changing. `PUT` is accepted with identical merge semantics for backward compatibility.

<Note>
  `update_patient=true` writes the new address back to the **patient record** as well as the order. Without it, only this one order moves. Use it for a genuine relocation; omit it for a one-time ship-to-somewhere-else.
</Note>

## Removing a line from an auto-created order

<Warning>
  If Blend creates your orders automatically from inbound prescriptions, removing a prescription line is not enough on its own — the order is generated **from** the prescription, so the line is simply re-added. You also have to decide what happens to the underlying prescription. Cancelling or pausing the prescription is what makes the removal stick.
</Warning>

## When editing isn't the right tool

* The whole order shouldn't ship → [cancel it](/guides/cancel-an-order)
* It should ship, but later → [pause it](/guides/pause-an-order)
* It shipped and was wrong → [request a replacement](/guides/replacement-orders)
* Only the carrier or service level is wrong → [shipping preferences](/guides/shipping-preferences)

<Tip>
  Orders are editable in the Blend Dashboard under the same rules, which is usually faster for a one-off correction than writing an API call.
</Tip>

<CardGroup cols={2}>
  <Card title="Add products to an order" icon="plus" href="/api-reference/orders/add-products-to-an-order">
    POST /orders/{'{'}order\_id{'}'}/products
  </Card>

  <Card title="Update order item quantity" icon="pen" href="/api-reference/orders/update-order-item-quantity">
    PATCH a single line
  </Card>

  <Card title="Remove a product from an order" icon="trash" href="/api-reference/orders/remove-a-product-from-an-order">
    DELETE a single line
  </Card>

  <Card title="Update an order" icon="location-dot" href="/api-reference/orders/update-an-order">
    Address, external ID, shipping
  </Card>
</CardGroup>
