# Issue adding data to line item via API

**URL:** <https://developer-forum.veeqo.com/t/issue-adding-data-to-line-item-via-api/458>\
**Category:** API Queries (How To)\
**Created:** [September 28, 2021, 8:41am UTC](https://developer-forum.veeqo.com/t/issue-adding-data-to-line-item-via-api/458 "2021-09-28T08:41:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattcrane](https://avatars.discourse-cdn.com/v4/letter/m/00F8F8/32.png) [@mattcrane](https://developer-forum.veeqo.com/u/mattcrane)\
**Post date:** [September 28, 2021, 8:42am UTC](https://developer-forum.veeqo.com/t/issue-adding-data-to-line-item-via-api/458/1 "2021-09-28T08:42:00Z")

</div>

Hi…i’m trying to update an order line by the api, but it doesn’t appear to be working

i can add a general note, but not additional options on the order line

i’m doing a put request on UpdateOrderDetail

i tried

put request to

[https://api.veeqo.com/orders/XXXXXXX](https://api.veeqo.com/orders/XXXXXXX)

{  
“order”: {  
“line\_items\_attributes”: [  
{  
“sellable\_id”: XXXX,  
“additional\_options”: “Test Udate”  
}  
]  
}  
}

When i send the request the results just show the order JSON, without the update

---

<div class="post-metadata">

**Author:** ![Kristien](https://yyz1.discourse-cdn.com/flex033/user_avatar/developer-forum.veeqo.com/kristien/32/157_2.png) [@Kristien](https://developer-forum.veeqo.com/u/Kristien)\
**Post date:** [September 29, 2021, 6:29pm UTC](https://developer-forum.veeqo.com/t/issue-adding-data-to-line-item-via-api/458/2 "2021-09-29T18:29:08Z")

</div>

Hi, @mattcrane!  
Welcome to the Veeqo Developer Forum!

I’ve tested this on my account and it is working. Here’s my request data:

```auto
{
  "order": {
    "line_items_attributes": [
      {
        "sellable_id": 57293219,
        "quantity": 1,
        "additional_options": "www.veeqo.com"
      }
    ]
  }
}

```

Please ensure you are adding the correct sellable ID to your request, as well as the correct order ID.

To find a sellable ID, make a GET request for the order, and the sellable ID’s are listed under “line\_items”. Here’s an example:

```auto
"line_items": [
        {
            "id": 153952194,
            "price_per_unit": 21.658,
            "quantity": 6,
            "tax_rate": 0.2,
            "taxless_discount_per_unit": 0.0,
            "additional_options": "test te",
            "created_at": "2021-09-29T15:59:01.158Z",
            "updated_at": "2021-09-29T18:16:24.660Z",
            "remote_id": null,
            "sellable": {
                "allocated_stock_level_at_all_warehouses": 37,
                "id": 57293219,
                "type": "ProductVariant",
                "title": "Default Title",
                "sku_code": "MB829Z/A",
                "upc_code": "5052089017450",
                "model_number": "",
                "price": 21.658,
                "cost_price": 5.0,
                "min_reorder_level": 0,
                "quantity_to_reorder": 0,
                "created_by_id": 43826,
                "created_at": "2021-08-02T09:40:32.111Z",
                "updated_at": "2021-09-29T15:59:01.509Z",
                "weight_grams": 250.0,
                "weight_unit": "g",
                "product_title": "Apple Magic Mouse",
                ...

```

Hope this helps!

---

<div class="post-metadata">

**Author:** ![mattcrane](https://avatars.discourse-cdn.com/v4/letter/m/00F8F8/32.png) [@mattcrane](https://developer-forum.veeqo.com/u/mattcrane)\
**Post date:** [October 6, 2021, 8:17am UTC](https://developer-forum.veeqo.com/t/issue-adding-data-to-line-item-via-api/458/3 "2021-10-06T08:17:19Z")

</div>

Hi Kristien, thank you for your reply.

I found the issue, I wasn’t supplying the quantity, it doesn’t appear to specify that this is required in the update details.

Is it possible for this field to be mandatory in the update order detail api call…as the line would have already naturally had a qty to begin with…we just would like be able to use the api call to add text detail to the line.

---

<div class="post-metadata">

**Author:** ![Kristien](https://yyz1.discourse-cdn.com/flex033/user_avatar/developer-forum.veeqo.com/kristien/32/157_2.png) [@Kristien](https://developer-forum.veeqo.com/u/Kristien)\
**Post date:** [October 6, 2021, 10:35am UTC](https://developer-forum.veeqo.com/t/issue-adding-data-to-line-item-via-api/458/4 "2021-10-06T10:35:56Z")

</div>

Hi, @mattcrane.  
I’ve found a little workaround for you.

You can use a PUT request to endpoint: [https://api.veeqo.com/line\_items/{line\_item\_id}](https://api.veeqo.com/line_items/%7Bline_item_id%7D)

with the following body:

```auto
{
    "additional_options": "test"
}

```

Note:  
Replace “{line\_item\_id}” with the line items ID, not the sellable ID. In my case, the ID was 153952194.

This endpoint is not documented and only allows certain things to be updated, but it works for additional options without specifying anything else.

Hope this help you!
