# Update a line item option

To [update](https://docs.commercelayer.io/core/updating-resources) an existing line item option, send a `PATCH` request to the `/api/line_item_options/:id` endpoint, where `id` is the ID of the resource that you want to update.

Here below the list of all the possible arguments that you can pass with the request body.

## Request

**PATCH** <https://yourdomain.commercelayer.io/api/line\\_item\\_options/:id>

### Arguments

| Body Parameter                     | Type      | Required |
| ---------------------------------- | --------- | -------- |
| **type**                           | `string`  | Required |
| **id**                             | `string`  | Required |
| attributes.**name**                | `string`  | Optional |
| attributes.**quantity**            | `integer` | Optional |
| attributes.**unit\_amount\_cents** | `integer` | Optional |
| attributes.**options**             | `object`  | Optional |
| attributes.**\_add\_tags**         | `string`  | Optional |
| attributes.**\_remove\_tags**      | `string`  | Optional |
| attributes.**reference**           | `string`  | Optional |
| attributes.**reference\_origin**   | `string`  | Optional |
| attributes.**metadata**            | `object`  | Optional |
| relationships.**sku\_option**      | `object`  | Optional |
| relationships.**tags**             | `array`   | Optional |

### Example

{% tabs %}
{% tab title="Request" %}
The following request updates the line item option identified by the ID "XAyRWNUzyN":

```shell
curl -g -X PATCH \
  'https://yourdomain.commercelayer.io/api/line_item_options/XAyRWNUzyN' \
  -H 'Accept: application/vnd.api+json' \
  -H 'Authorization: Bearer your-access-token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
  "data": {
    "type": "line_item_options",
    "id": "xYZkjABcde",
    "attributes": {
      "name": "Embossing"
    },
    "relationships": {
      "sku_option": {
        "data": {
          "type": "sku_options",
          "id": "ABCRtyUpBa"
        }
      }
    }
  }
}'
```

{% endtab %}

{% tab title="Response" %}
On success, the API responds with a `200 OK` status code, returning the updated resource object:

```json
{
  "data": {
    "id": "XAyRWNUzyN",
    "type": "line_item_options",
    "links": {
      "self": "https://yourdomain.commercelayer.io/api/line_item_options/XAyRWNUzyN"
    },
    "attributes": {
      "name": "Embossing",
      "quantity": 2,
      "currency_code": "EUR",
      "unit_amount_cents": 990,
      "unit_amount_float": 9.9,
      "formatted_unit_amount": "€9,90",
      "total_amount_cents": 1880,
      "total_amount_float": 18.8,
      "formatted_total_amount": "€18,80",
      "delay_hours": 48,
      "delay_days": 2,
      "options": {
        "embossing_text": "Happy Birthday!"
      },
      "created_at": "2018-01-01T12:00:00.000Z",
      "updated_at": "2018-01-01T12:00:00.000Z",
      "reference": "ANY-EXTERNAL-REFEFERNCE",
      "reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
      "metadata": {
        "foo": "bar"
      }
    },
    "relationships": {
      "line_item": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/line_item_options/XAyRWNUzyN/relationships/line_item",
          "related": "https://yourdomain.commercelayer.io/api/line_item_options/XAyRWNUzyN/line_item"
        }
      },
      "sku_option": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/line_item_options/XAyRWNUzyN/relationships/sku_option",
          "related": "https://yourdomain.commercelayer.io/api/line_item_options/XAyRWNUzyN/sku_option"
        }
      },
      "events": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/line_item_options/XAyRWNUzyN/relationships/events",
          "related": "https://yourdomain.commercelayer.io/api/line_item_options/XAyRWNUzyN/events"
        }
      },
      "tags": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/line_item_options/XAyRWNUzyN/relationships/tags",
          "related": "https://yourdomain.commercelayer.io/api/line_item_options/XAyRWNUzyN/tags"
        }
      },
      "event_stores": {
        "links": {
          "self": "https://yourdomain.commercelayer.io/api/line_item_options/XAyRWNUzyN/relationships/event_stores",
          "related": "https://yourdomain.commercelayer.io/api/line_item_options/XAyRWNUzyN/event_stores"
        }
      }
    },
    "meta": {
      "mode": "test",
      "organization_id": "xRRkjDFafe",
      "trace_id": "69abaa3545913c78132e5578bd26208d44aa9043647d78698fd0021f3958cd74"
    }
  }
}
```

{% endtab %}
{% endtabs %}
