Edit Item HSN Code
Sets the HSN code (or SAC code for services) of one or more items in Logic ERP. You send the HSN details once and a list of items; if the HSN code is not in Logic ERP yet, it is created from the details you send, and then given to every item in the list. Use it when your system decides or corrects the HSN classification of items that already exist in Logic ERP.
Endpoint
Address
https://your-server/api/EditItemHSN
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 Rates and Edit Item GST Tax Group; only the fields below are read. GST_Group_Name, GST_Group_Short_Name, GST_Group_Level, Reason and the rate fields in ListItems are ignored.
HSSerial_No
number
Yes
0
The HSN or SAC number, for example 62044290. Logic ERP finds the HSN code by this number. Must not be 0.
HS_Code
text
No
the HSSerial_No value
The HSN code as it is to be shown (HSN_Code in Get Item Master). Up to 20 characters. Used only when the HSN code is created.
HS_Description
text
Yes
–
Description of the HSN code. Up to 200 characters.
HS_Short_Desc
text
Yes
–
Short description. Up to 30 characters.
HS_Long_Desc
text
Yes
–
Long description.
Unit_of_Measurement
text
Yes
–
The GST unit (UQC), written exactly as in the list below, in capitals, for example PCS-PIECES.
HS_Type
text
No
"HSN"
"SAC" (in capitals) for a service code; anything else is saved as a goods (HSN) code.
SION_Number
text
No
empty
SION number, if you use one. Up to 20 characters.
SION_Rate
number
No
0
SION rate.
ListItems
list
No
empty
The items to change. See below.
ListItems – one entry per item:
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.
Both codes are matched without regard to capitals; spaces at the end are ignored.
Units accepted in Unit_of_Measurement: PCS-PIECES, BAG-BAGS, BGS-BAGS, BKL-BUCKLES, BOU-BOU, BOU-BILLIONS OF UNITS, BOX-BOX, BTL-BOTTLES, BUN-BUNCHES, CBM-CUBIC METER, CCM-CUBIC CENTIMETER, CIN-CUBIC INCHES, CMS-CENTIMETER, CQM-CUBIC METERS, CTN-CARTONS, DOZ-DOZEN, DRM-DRUM, FTS-FEET, GGR-GREAT GROSS, GMS-GRAMS, GRS-GROSS, GYD-GROSS YARDS, HKS-HANKS, INC-INCHES, KGS-KILOGRAMS, KLR-KILOLITER, KME-KILOMETRE, LBS-POUNDS, LOT-LOTS, LTR-LITERS, MGS-MILLI GRAMS, MTR-METERS, MTS-METRIC TON, NOS-NUMBERS, ODD-ODDS, PAC-PACKS, PRS-PAIRS, QTL-QUINTAL, ROL-ROLLS, SDM-DECAMETER SQUARE, SET-SETS, SHT-SHEETS, SQF-SQUARE FEET, SQI-SQUARE INCHES, SQM-SQUARE METERS, SQY-SQUARE YARDS, TBS-TABLETS, THD-THOUSANDS, TOL-TOLA, TON-GREAT BRITAIN TON, TON-TONNES, TUB-TUBES, UGS-US GALLONS, UNT-UNITS, VLS-VIALS, YDS-YARDS, OTH-OTHERS, BAL-BALE, BDL-BUNDLES, CAN-CANS, MLT-MILILITRE, TGM-TEN GROSS. The spelling and capitals must match exactly (NOS-Numbers is refused).
Rules Logic ERP applies
Existing HSN code: if an HSN code with this
HSSerial_Nois already in Logic ERP, it is used as it is – its code, descriptions, unit, type and SION details are not changed, even though the description fields and the unit must still be filled in the request.New HSN code: otherwise a new HSN code is created from the fields you send.
The whole item changes. The HSN code belongs to the item (item and shade), so the change applies to every item code of each item in the list – all its sizes and packs.
All items are checked before anything is saved. If any one of them is not found, nothing is saved – not even the new HSN code.
Everything is saved in one go: if anything fails, nothing is saved.
With an empty
ListItemsthe request answersHSN allocated successfully.but nothing is saved – the HSN code is not created either, andLastSavedCodeis0.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 that has no barcode (if there is one), and that item's HSN code is changed. Always fillItemCode(orEANCode) in every entry.
Example request
Gives HSN 62044290 to two items, creating it if needed:
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 gives the test item APITEST0001 an HSN code that already exists in the sandbox.
Sets the HSN code (or SAC code for services) of one or more items in Logic ERP. You send the HSN details once and a list of items; if the HSN code is not in Logic ERP yet, it is created from the details you send, and then given to every item in the list. Use it when your system decides or corrects the HSN classification of items that already exist in Logic ERP.
The user name and password of your API site.
The HSN or SAC number, for example 62044290. Logic ERP finds the HSN code by this number. Must not be 0.
The HSN code as it is to be shown (HSN_Code in Get Item Master). Up to 20 characters. Used only when the HSN code is created.
Description of the HSN code. Up to 200 characters.
Short description. Up to 30 characters.
Long description.
The GST unit (UQC), written exactly as in the list below, in capitals, for example PCS-PIECES.
"SAC" (in capitals) for a service code; anything else is saved as a goods (HSN) code.
Always HTTP 200. Check Status and Message.
true when the items were saved.
HSN allocated successfully. when saved; otherwise the reason.
Logic ERP's internal number of the HSN code that was given to the items (0 when ListItems was empty).
The ID of this request. null when the request was refused by one of the checks below before anything was saved.
No login was sent.
POST /api/EditItemHSN HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 356
{
"HSSerial_No": 64029190,
"HS_Code": "64029190",
"HS_Description": "Other footwear with outer soles and uppers of rubber or plastics",
"HS_Short_Desc": "FOOTWEAR RUBBER",
"HS_Long_Desc": "Other footwear with outer soles and uppers of rubber or plastics, other",
"Unit_of_Measurement": "PRS-PAIRS",
"HS_Type": "HSN",
"ListItems": [
{
"ItemCode": "APITEST0001",
"EANCode": ""
}
]
}{
"Status": true,
"Message": "text",
"LastSavedCode": 1,
"request_ID": "text"
}Response
Status
true when the items were saved.
Message
HSN allocated successfully. when saved; otherwise the reason.
LastSavedCode
Logic ERP's internal number of the HSN code that was given to the items (0 when ListItems was empty).
request_ID
The ID of this request. null when the request was refused by one of the checks below before anything was saved.
Example response
Messages you may see
Invalid HSSerial_No : 0
HSSerial_No was 0 or left out.
Send the HSN number.
Invalid HS_Description : . Do not allow entry without HS Description.
HS_Description was empty or left out.
Fill it in.
Invalid HS_Short_Desc : . Do not allow entry without HS_Short_Desc.
HS_Short_Desc was empty or left out.
Fill it in.
Invalid HS_Long_Desc : . Do not allow entry without HS_Long_Desc.
HS_Long_Desc was empty or left out.
Fill it in.
Invalid Unit_of_Measurement not defined. Do not allow entry without Unit_of_Measurement.
Unit_of_Measurement was empty or left out.
Send a unit from the list.
Invalid Unit_of_Measurement : …. Do not allow entry without Unit_of_Measurement. (your value in place of …)
The unit is not in the list, or not written exactly as in the list.
Use a unit from the list, in capitals.
Invalid EAN Code : …
An item 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 text was longer than the limits above, or a code contained an apostrophe. Nothing was saved. The reason may be followed by technical detail – read the first line.
Correct the request and send again.