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.
Endpoint
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.
Request fields
Field names are matched without regard to capitals. This endpoint shares its request layout with Edit Item HSN Code and Edit Item GST Tax Group; 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.
Reason
text
No
""
Reason for the change. Accepted, but not recorded with the item – it does not appear in the item's change history or rate history.
ListItems
list
No
empty
The item codes and their new rates. See below.
ListItems – one entry per item code:
ItemCode
text
One of the two
""
The item code as shown in Logic ERP (UserCode in Get Item Master). 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
0or 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
ListItemsis not refused: the request answersStatus: trueand nothing is changed.The item's modified date is not changed, so this change does not bring the item into a Get Item Master request for a period. Fetch the item by its code if you need to confirm the change.
This endpoint is covered by the same licence as creating items through the API.
Known issue – an entry with no code changes an unrelated item. A
ListItemsentry with bothItemCodeandEANCodeempty is not refused: it is matched to an item code that has no barcode (if there is one), and that item's rates are changed. Always fillItemCode(orEANCode) in every entry.
Example request
New MRP and sale rate for one size, and a new purchase rate for another item found by barcode:
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.
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.
The user name and password of your API site.
Reason for the change. Accepted, but not recorded with the item – it does not appear in the item's change history or rate history.
Always HTTP 200. Check Status and Message.
true when the rates were saved.
Empty when saved; otherwise the reason.
Always 0.
The ID of this request. null when an item code was not found, or when ListItems was sent as null.
No login was sent.
POST /api/EditItemRates HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 118
{
"Reason": "API test price revision",
"ListItems": [
{
"ItemCode": "APITEST0001",
"EANCode": "",
"MRP": 3199,
"Sale_Rate": 3099
}
]
}{
"Status": true,
"Message": "text",
"LastSavedCode": 1,
"request_ID": "text"
}Response
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 an item code was not found, or when ListItems was sent as null.
Example response
Messages you may see
Invalid EAN Code : …
An item code in ListItems was not found. 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.
A database error (with Status: false)
A code contained an apostrophe. Nothing was saved. The reason may be followed by technical detail – read the first line.
Correct the code.
An error with no clear reason (with Status: false)
ListItems was sent as null.
Send a list, or leave ListItems out.