Update Item Conversion Factors
Changes the conversion factors of one item code in Logic ERP – up to three alternate units for the item (for example a BOX of 12 pieces), each with a factor (units per pack) and the name of the unit. These are the values Get Item Master returns as CF_1 … CF_3 and CF_Desc_1 … CF_Desc_3. Use it when your system changes how an item is packed.
Endpoint
Address
https://your-server/api/UpdateItemCF
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.
LogicUserCode
text
Yes
""
The item code as shown in Logic ERP (UserCode in Get Item Master). Matched without regard to capitals.
EANCode
text
No
""
The item's barcode (AddlItemCode in Get Item Master). Used only when no item has the code in LogicUserCode. Send "" or leave it out when you have none – null makes the request fail.
Cf_1, Cf_2, Cf_3
number
No
0
Conversion factor 1, 2, 3: how many units make one of the alternate unit, for example 12. Kept to 4 decimal places. Only a value above 0 changes the item.
Cf_1_Desc, Cf_2_Desc, Cf_3_Desc
text
No
""
Name of alternate unit 1, 2, 3, for example BOX. Up to 15 characters. Only a non-empty value changes the item.
ItemDetCode is accepted but ignored.
Rules Logic ERP applies
At least one of the six
Cf_…fields must be filled (a factor above 0 or a unit name), otherwise nothing is saved. A request whose only filled field is a negative factor passes this check and answersStatus: true, but changes nothing.Only the fields you fill are changed; the others keep their values. A factor of
0or less, or an empty unit name, never changes anything, so you cannot clear a conversion factor or a unit name with this endpoint.The change applies to this item code only – one size or pack – not to the other sizes of the same item.
Finding the item: first by
LogicUserCode; if no item has that code andEANCodeis filled, by the barcode. If neither is found, nothing is saved.The factor and the unit name are not checked against each other: you can send a factor without a unit name or the reverse.
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.
Example request
Item KR1045-M is also sold in boxes of 12 and cartons of 48:
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 sets the pack units of the test item APITEST0001.
Changes the conversion factors of one item code in Logic ERP – up to three alternate units for the item (for example a BOX of 12 pieces), each with a factor (units per pack) and the name of the unit. These are the values Get Item Master returns as CF_1 … CF_3 and CF_Desc_1 … CF_Desc_3. Use it when your system changes how an item is packed.
The user name and password of your API site.
The item code as shown in Logic ERP (UserCode in Get Item Master). Matched without regard to capitals.
The item's barcode (AddlItemCode in Get Item Master). Used only when no item has the code in LogicUserCode. Send "" or leave it out when you have none – null makes the request fail.
Conversion factor 1, 2, 3: how many units make one of the alternate unit, for example 12. Kept to 4 decimal places. Only a value above 0 changes the item.
Name of alternate unit 1, 2, 3, for example BOX. Up to 15 characters. Only a non-empty value changes the item.
Conversion factor 1, 2, 3: how many units make one of the alternate unit, for example 12. Kept to 4 decimal places. Only a value above 0 changes the item.
Name of alternate unit 1, 2, 3, for example BOX. Up to 15 characters. Only a non-empty value changes the item.
Always HTTP 200. Check Status and Message.
true when the item was saved.
Empty when saved; otherwise the reason.
Always 0.
The ID of this request. null when the request failed on the first two checks (no item code, nothing to change).
No login was sent.
POST /api/UpdateItemCF HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 99
{
"LogicUserCode": "APITEST0001",
"EANCode": "",
"Cf_1": 6,
"Cf_1_Desc": "BOX",
"Cf_2": 24,
"Cf_2_Desc": "CTN"
}{
"Status": true,
"Message": "text",
"LastSavedCode": 1,
"request_ID": "text"
}Response
Status
true when the item was saved.
Message
Empty when saved; otherwise the reason.
LastSavedCode
Always 0.
request_ID
The ID of this request. null when the request failed on the first two checks (no item code, nothing to change).
Example response
Messages you may see
LogicUserCode Is Missing...
LogicUserCode was empty or left out.
Send the item code.
Data Not Found...
None of the six Cf_… fields was filled.
Send at least one factor above 0 or a unit name.
A message containing Invalid LogicUserCode / EANCode : … (with Status: false)
No item has that item code or barcode. The code shown (in capitals) is the barcode if you sent one, otherwise the item code. The reason is surrounded by technical detail – look for this text.
Check the item code and barcode.
A database error (with Status: false)
A unit name was longer than 15 characters, or a code contained an apostrophe. Nothing was saved. The reason may be followed by technical detail – read the first line.
Shorten the unit name, or correct the code.
An error with no clear reason (with Status: false)
EANCode was sent as null.
Send "" or leave EANCode out.