> ## Documentation Index
> Fetch the complete documentation index at: https://doc-test-my.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update an Item

> Update an Item details using this endpoint.

Use this endpoint to update the details of an item. You can also edit the details of a created item from the Dashboard by clicking on that specific item from the list of items.

<RequestExample>
  ```bash Curl theme={null}
  curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
    -H "Content-Type: application/json" \
    -X PATCH https://api.razorpay.com/v1/items/item_7Oy8OMV6BdEAac \
    -d '{
          "name":"Book / Ignited Minds - Updated name!",
          "description":"New descirption too."
        }'
  ```

  ```java Java theme={null}
  RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");

  String itemId = "item_7Oy8OMV6BdEAac";

  JSONObject itemRequest = new JSONObject();
  itemRequest.put("name","Book / Ignited Minds - Updated name!");
  itemRequest.put("description","An indian story, Booker prize winner.");
  itemRequest.put("amount", 20000);
  itemRequest.put("currency","MYR");
  itemRequest.put("active",true);

  Item item = razorpay.items.edit(itemId, itemRequest);
  ```

  ```python Python theme={null}
  import razorpay
  client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))

  client.item.edit({
    "name": "Book / Ignited Minds - Updated name!",
    "description": "New descirption too.",
    "amount": 20000,
    "currency": "MYR",
    "active": true
  })
  ```

  ```ruby Ruby theme={null}
  require "razorpay"
  Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')

  itemId = "item_7Oy8OMV6BdEAac"

  para_attr = {
    "name": "Book / Ignited Minds - Updated name!",
    "description": "New descirption too.",
    "amount": 20000,
    "currency": "MYR",
    "active": true
  }

  Razorpay::Item.edit(itemId,para_attr)
  ```

  ```go Go theme={null}
  import ( razorpay "github.com/razorpay/razorpay-go" )
  client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")

  data:= map[string]interface{}{
      "name": "Book / Ignited Minds - Updated name!",
      "description": "New descirption too.",
      "amount": 20000,
      "currency": "MYR",
      "active": true,
  }
  body, err := client.Item.Update("<itemId>", data, nil)
  ```

  ```php PHP theme={null}
  $api = new Api($key_id, $secret);

  $api->Item->fetch($itemId)->edit(array("name" => "Book / Ignited Minds - Updated name!","description" => "New descirption too.","amount" => 20000,"currency" => "MYR","active" => true
  ));
  ```

  ```javascript Node.js theme={null}
  var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })

  instance.Items.edit({
    "name": "Book / Ignited Minds - Updated name!",
    "description": "New descirption too.",
    "amount": 20000,
    "currency": "MYR",
    "active": true
  })
  ```

  ```ruby Ruby theme={null}
  require "razorpay"
  Razorpay.setup('YOUR_KEY_ID', 'YOUR_SECRET')

  itemId = "item_JDcbIdX9xojCje"

  para_attr = {
    "name": "Book / Ignited Minds - Updated name!",
    "description": "New descirption too.",
    "amount": 20000,
    "currency": "MYR",
    "active": true
  }

  Razorpay::Item.edit(itemId,para_attr)
  ```

  ```csharp .NET theme={null}
  RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");

  string itemId = "item_7Oy8OMV6BdEAac";

  Dictionary<string, object> itemRequest = new Dictionary<string, object>();
  itemRequest.Add("name", "Book / Ignited Minds - Updated name!");
  itemRequest.Add("description", "An indian story, Booker prize winner.");
  itemRequest.Add("amount", 20000);
  itemRequest.Add("currency", "MYR");
  itemRequest.Add("active", true);

  Item payment = client.Item.Fetch(itemId).Edit(itemRequest);
  ```

  ```bash CLI theme={null}
  razorpay invoices items update item_ABC123 \
    --name "Updated Item Name" \
    --amount 499 \
    --description "Updated description" \
    --active=false
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "id": "item_7Oy8OMV6BdEAac",
    "active": true,
    "name": "Book / Ignited Minds - Updated name!",
    "description": "New descirption too.",
    "amount": 20000,
    "unit_amount": 20000,
    "currency": "MYR",
    "type": "invoice",
    "unit": null,
    "tax_inclusive": false,
    "hsn_code": null,
    "sac_code": null,
    "tax_rate": null,
    "tax_id": null,
    "tax_group_id": null,
    "created_at": 1649843796
  }
  ```

  ```json Failure theme={null}
  {
    "error": {
      "code": "BAD_REQUEST_ERROR",
      "description": "The api key provided is invalid",
      "source": "NA",
      "step": "NA",
      "reason": "NA",
      "metadata": {}
    }
  }
  ```
</ResponseExample>

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifer of the item whose details are to be updated.
</ParamField>

## Request Parameters

<ParamField body="name" type="string">
  The name of the item.
</ParamField>

<ParamField body="description" type="string">
  A brief description about the item.
</ParamField>

<ParamField body="amount" type="integer">
  The price of the item in the lowest unit of currency.
</ParamField>

<ParamField body="currency" type="string">
  The currency in which the amount should be charged. Check the list of [supported currencies](/docs/payments/international-payments#supported-currencies).
</ParamField>

<ParamField body="active" type="boolean">
  Indicates the status of the item. Possible values:

  * `true` (default): Item is in the active state.
  * `false`: Item is in the inactive state.
</ParamField>

## Response Parameters

<ResponseField name="id" type="string">
  The unique identifier of the item.
</ResponseField>

<ResponseField name="active" type="boolean">
  Indicates the status of the item. Possible values:

  * `true` (default): Item is in the active state.
  * `false`: Item is in the inactive state.
</ResponseField>

<ResponseField name="name" type="string">
  The name of the item.
</ResponseField>

<ResponseField name="description" type="string">
  A text description about the item.
</ResponseField>

<ResponseField name="amount" type="integer">
  The price of the item.
</ResponseField>

<ResponseField name="unit_amount" type="integer">
  The per unit billing amount for each individual unit.
</ResponseField>

<ResponseField name="currency" type="string">
  The currency in which the amount should be charged. Check the list of [supported currencies](/docs/payments/international-payments#supported-currencies).
</ResponseField>

<ResponseField name="type" type="string">
  Here, it must be `invoice`.
</ResponseField>

<ResponseField name="unit" type="integer">
  The number of units of the item billed in the invoice.
</ResponseField>

<ResponseField name="tax_inclusive" type="boolean">
  Indicates whether the base amount includes tax.

  * `true`: The base amount includes tax.
  * `false`: The base amount does not include tax. By default, the value is set to `false`.
</ResponseField>

<ResponseField name="hsn_code" type="integer">
  The 8-digit code used to classify the product as per the Harmonised System of Nomenclature.
</ResponseField>

<ResponseField name="sac_code" type="integer">
  The 6-digit code used to classify the service as per the Services Accounting Code.
</ResponseField>

<ResponseField name="tax_rate" type="string">
  The percentage at which an individual or a corporation is taxed.
</ResponseField>

<ResponseField name="tax_id" type="string">
  The identification number that gets displayed on invoices issued to the customer.
</ResponseField>

<ResponseField name="tax_group_id" type="string">
  The identification number for the tax group. A tax group is a collection of taxes that can be applied as a single set of rules.
</ResponseField>

<ResponseField name="created_at" type="integer">
  Unix timestamp, at which the item was created. For example, `1649843796`.
</ResponseField>

## Errors

<AccordionGroup>
  <Accordion
    title="The API `<key/secret>
` provided is invalid."
  >
    **Code:** `4xx`

    The API key or secret are not entered or an invalid API key is used.

    **Solution:** Use and enter the correct API details while executing the API.
  </Accordion>

  <Accordion title="The id provided does not exist.">
    **Code:** `400`

    The invoice id entered is either invalid or does not belong to the requester account.

    **Solution:** Enter a valid invoice id.
  </Accordion>

  <Accordion title="The amount field is required when item id is not present.">
    **Code:** `400`

    Only name is entered without item id or amount.

    **Solution:** Provide either the item id or the amount with the name.
  </Accordion>

  <Accordion title="The name field is required when item id is not present.">
    **Code:** `400`

    Possible reasons:

    * Only the amount field is entered without a name or item id.
    * The amount, name or item id are not entered.

    **Solution:** Provide the name field of the item when passing the amount.
  </Accordion>

  <Accordion title="The name may not be greater than 512 characters.">
    **Code:** `400`

    The `name` value exceeds the 512-character limit.

    **Solution:** Keep `name` to 512 characters or fewer.
  </Accordion>

  <Accordion title="The amount must be an integer.">
    **Code:** `400`

    A non-integer value (for example a decimal like `100.5` or a string like `"abc"`) was passed for `amount`.

    **Solution:** Pass `amount` as an integer in currency subunits.
  </Accordion>

  <Accordion title="Update operation not allowed for item of type: {type}.">
    **Code:** `400`

    The item id passed belongs to a non-invoice item type (for example, `payment_page`). Only items of type `invoice` can be updated through this endpoint.

    **Solution:** Confirm the item's type using the Fetch Item API. Only invoice-type items support updates via `PATCH /v1/items/:id`.
  </Accordion>
</AccordionGroup>
