For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

Name
Detail

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.

Field
Type
Required
Default
Meaning

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 answers Status: true, but changes nothing.

  • Only the fields you fill are changed; the others keep their values. A factor of 0 or 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 and EANCode is 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.

Update Item Conversion Factors

post

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.

Authorizations
AuthorizationstringRequired

The user name and password of your API site.

Body
LogicUserCodestringOptional

The item code as shown in Logic ERP (UserCode in Get Item Master). Matched without regard to capitals.

EANCodestringOptional

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_1integerOptional

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_DescstringOptional

Name of alternate unit 1, 2, 3, for example BOX. Up to 15 characters. Only a non-empty value changes the item.

Cf_2integerOptional

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_2_DescstringOptional

Name of alternate unit 1, 2, 3, for example BOX. Up to 15 characters. Only a non-empty value changes the item.

Responses
200

Always HTTP 200. Check Status and Message.

application/json
StatusbooleanOptional

true when the item was saved.

MessagestringOptional

Empty when saved; otherwise the reason.

LastSavedCodeintegerOptional

Always 0.

request_IDstringOptional

The ID of this request. null when the request failed on the first two checks (no item code, nothing to change).

post/UpdateItemCF
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

Field
What it holds for this endpoint

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

Message
Meaning
What to do

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.