> For the complete documentation index, see [llms.txt](https://kb.logicerp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/push/edit-item-rates.md).

# Edit Item Rates

Changes the **rates** of one or more item codes in Logic ERP: MRP, sale rate, basic rate, purchase rate and the five special rates. Only the rates you send are changed, and each change is recorded in the item's **rate history**. Use it when prices are decided in your system and must reach Logic ERP.

These are the item's own rates, the same for all branches. Branch rate-group rates are changed with [Edit Branch Rate Group Rates](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/push/edit-branch-rate-group-rates.md).

### **Endpoint**

| Name          | Detail                                  |
| ------------- | --------------------------------------- |
| Address       | `https://your-server/api/EditItemRates` |
| Method        | `POST`                                  |
| Authorization | Basic Auth                              |

The response and the common messages are explained in [How Every API Call Works](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/how-every-api-call-works.md).

### **Request fields**

Field names are matched without regard to capitals. This endpoint shares its request layout with [Edit Item HSN Code](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/push/edit-item-hsn-code.md) and [Edit Item GST Tax Group](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/push/edit-item-gst-tax-group.md); only the fields below are read. The HSN fields (`HSSerial_No`, `HS_Code`, `HS_Description`, `HS_Short_Desc`, `HS_Long_Desc`, `HS_Type`, `SION_Number`, `SION_Rate`, `Unit_of_Measurement`) and the GST group fields (`GST_Group_Name`, `GST_Group_Short_Name`, `GST_Group_Level`) are ignored.

| Field       | Type | Required | Default | Meaning                                                                                                 |
| ----------- | ---- | -------- | ------- | ------------------------------------------------------------------------------------------------------- |
| `Reason`    | text | No       | `""`    | Reason for the change. Recorded with the change in the item's change history (not in the rate history). |
| `ListItems` | list | **Yes**  | –       | The item codes and their new rates. See below.                                                          |

**`ListItems`** – one entry per item code:

| Field                   | Type   | Required       | Default | Meaning                                                                                                                                                                                                                                   |
| ----------------------- | ------ | -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ItemCode`              | text   | One of the two | `""`    | The item code as shown in Logic ERP (`UserCode` in [Get Item Master](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/pull/get-item-master.md)). When filled, `EANCode` is not used. |
| `EANCode`               | text   | One of the two | `""`    | The item's barcode (`AddlItemCode` in Get Item Master). Used only when `ItemCode` is empty. Other barcodes of the item (`ListEANCode`) are not searched.                                                                                  |
| `MRP`                   | number | No             | `0`     | New MRP in ₹ (`MRP` in Get Item Master).                                                                                                                                                                                                  |
| `Sale_Rate`             | number | No             | `0`     | New sale rate (`SaleRate`).                                                                                                                                                                                                               |
| `Basic_Rate`            | number | No             | `0`     | New basic rate (`BasicRate`).                                                                                                                                                                                                             |
| `Pur_Rate`              | number | No             | `0`     | New purchase rate (`PurRate`).                                                                                                                                                                                                            |
| `SP_Rate1` … `SP_Rate5` | number | No             | `0`     | New special rates 1 – 5 (`Sp_Rate1` … `Sp_Rate5`), as named in your Logic ERP setup.                                                                                                                                                      |

Both codes are matched without regard to capitals; spaces at the end are ignored.

### **Rules Logic ERP applies**

* Only a rate **above 0** is changed; a rate you leave out, or send as `0` or less, keeps its current value. You **cannot set a rate to zero** with this endpoint.
* The change applies to **this item code only** – one size or pack – not to the other sizes of the same item.
* **Rate history:** each rate that actually changes is recorded in the item's rate history with its old and new value, dated the current working date of your API site (normally today). If the same rate of the same item code is changed again on the same day, that day's entry is updated with the newest value; the old value stays the one from before the first change that day.
* All item codes are checked before anything is saved. If any one of them is not found, **nothing** is saved.
* Everything is saved in one go: if anything fails, no rate is changed.
* An empty or missing `ListItems` is refused with `EAN Codes not defined...`.
* The item code gets today's date as its modified date, and the change is recorded in Logic ERP's change log, so the item comes back in Get Item Master – by bookmark, or for a period that includes today.
* This endpoint is covered by the same licence as creating items through the API.

### **Example request**

New MRP and sale rate for one size, and a new purchase rate for another item found by barcode:

```json
{
  "Reason": "Price revision October 2026",
  "ListItems": [
    { "ItemCode": "KR1045-M", "EANCode": "", "MRP": 1099.00, "Sale_Rate": 899.00 },
    { "ItemCode": "", "EANCode": "8901234567892", "Pur_Rate": 425.50 }
  ]
}
```

### **Test it**

Send a request to the Logic ERP **sandbox** (a test company) from this page: open the block below, enter the sandbox user name and password (ask your Logic ERP support team), change the request if you like, and press **Test it**. This really saves in the sandbox, so use test values like the example. The example changes the MRP and sale rate of the test item `APITEST0001`.

## Edit Item Rates

> Changes the rates of one or more item codes in Logic ERP: MRP, sale rate, basic rate, purchase rate and the five special rates. Only the rates you send are changed, and each change is recorded in the item's rate history. Use it when prices are decided in your system and must reach Logic ERP.

```json
{"openapi":"3.0.3","info":{"title":"Logic ERP API","version":"1.0"},"tags":[{"name":"Masters - Push"}],"servers":[{"url":"https://demo.logicerp.com/api","description":"Logic ERP sandbox (test company)"}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"The user name and password of your API site."}}},"paths":{"/EditItemRates":{"post":{"tags":["Masters - Push"],"operationId":"EditItemRates","summary":"Edit Item Rates","description":"Changes the rates of one or more item codes in Logic ERP: MRP, sale rate, basic rate, purchase rate and the five special rates. Only the rates you send are changed, and each change is recorded in the item's rate history. Use it when prices are decided in your system and must reach Logic ERP.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"Reason":{"type":"string","description":"Reason for the change. Recorded with the change in the item's change history (not in the rate history)."},"ListItems":{"type":"array","items":{"type":"object","properties":{"ItemCode":{"type":"string","description":"The item code as shown in Logic ERP (`UserCode` in Get Item Master). When filled, `EANCode` is not used."},"EANCode":{"type":"string","description":"The item's barcode (`AddlItemCode` in Get Item Master). Used only when `ItemCode` is empty. Other barcodes of the item (`ListEANCode`) are not searched."},"MRP":{"type":"integer","description":"New MRP in ₹ (`MRP` in Get Item Master)."},"Sale_Rate":{"type":"integer","description":"New sale rate (`SaleRate`)."}}},"description":"The item codes and their new rates. See below."}}}}}},"responses":{"200":{"description":"Always HTTP 200. Check Status and Message.","content":{"application/json":{"schema":{"type":"object","properties":{"Status":{"type":"boolean","description":"`true` when the rates were saved."},"Message":{"type":"string","description":"Empty when saved; otherwise the reason."},"LastSavedCode":{"type":"integer","description":"Always `0`."},"request_ID":{"type":"string","description":"The ID of this request. `null` when `ListItems` was empty or missing, or an item code was not found."}}}}}},"401":{"description":"No login was sent."}}}}}}
```

### **Response**

| Field           | What it holds for this endpoint                                                                      |
| --------------- | ---------------------------------------------------------------------------------------------------- |
| `Status`        | `true` when the rates were saved.                                                                    |
| `Message`       | Empty when saved; otherwise the reason.                                                              |
| `LastSavedCode` | Always `0`.                                                                                          |
| `request_ID`    | The ID of this request. `null` when `ListItems` was empty or missing, or an item code was not found. |

### **Example response**

```json
{
  "Status": true,
  "Message": "",
  "LastSavedCode": 0,
  "request_ID": "5e8b1d07-6a3f-4c29-b0e4-7f2d9c1a8e63"
}
```

### **Messages you may see**

| Message                                 | Meaning                                                                                                                                                                                                                    | What to do                             |
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
| `Invalid EAN Code : …`                  | An item code in `ListItems` was not found, or an entry has neither `ItemCode` nor `EANCode`. The barcode you sent is shown in place of …; when you sent an `ItemCode` the message ends after the colon. Nothing was saved. | Check the item codes and barcodes.     |
| `EAN Codes not defined...`              | `ListItems` was empty or left out.                                                                                                                                                                                         | Send at least one item.                |
| A database error (with `Status: false`) | Saving failed. Nothing was saved.                                                                                                                                                                                          | Correct the request and send it again. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/push/edit-item-rates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
