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

Assign Stock to a Delivery Order

Records that goods of a delivery order that is already in Logic ERP have been picked and packed. A delivery order lists sale-order goods to be dispatched; each of its lines has stock (a lot) set aside for it. With this endpoint you tell Logic ERP, item by item, how many units you packed and in which packing box. Logic ERP assigns that set-aside stock to the delivery order, takes the units off the line's pending quantity and remembers the box of every unit, ready for the delivery order to be invoiced or transferred later. It does not create a delivery order and does not change its items or quantities.

The usual flow: read the delivery order with Get Delivery Orders, pick and pack the goods, then send this request with the delivery order's number, the items, the quantities packed and the box numbers. The request uses the same shape as a Get Delivery Orders record, so you can send that record back with Packing_Box_No and Quantity filled in.

Endpoint

Name
Detail

Address

https://your-server/api/SaveAssignedDO

Method

POST

Authorization

Basic Auth

The response envelope, dates, queueing and the common messages are explained in How Every API Call Works. When request queueing is switched on for your API site, all requests to this endpoint run one at a time, whatever their branch.

Request fields

Field names are not case-sensitive. Item codes and set names are matched as you send them – spaces in front of them are not removed; capital and small letters do not matter.

Field
Type
Required
Default
Meaning

Doc_Code

number

Yes

0

Logic ERP's internal number of the delivery order – Doc_Code in Get Delivery Orders.

DO_Branch_Code

number

No – but always send it

0

The branch of the delivery order (Branch_Code in Get Branch Info). See the known issue below.

Doc_Prefix, Doc_Number

text, number

No

empty, 0

The delivery order's number, as in Get Delivery Orders. Used only in the message for an item that is not on the delivery order.

LstItems

list

Yes

empty list

What you packed – see below.

DisplayError

text

No

empty

Not used for the answer.

LstItems – one entry per item and packing box

Field
Type
Required
Default
Meaning

LogicUser_Code

text

Yes

empty

The item code shown in Logic ERP (UserCode in Get Item Master). When your Logic ERP is set to use additional item codes, an additional item code / barcode is accepted here too. For a set, the set's name – see ItemType.

Quantity

number

Yes

0

Units packed in this box. Must be above 0. Whole units only – a fraction is not assigned.

Packing_Box_No

text

Yes

empty

The packing box the units are in, for example B-0412. Up to 30 characters are kept.

Packing_Box_Weight

number

No

0

The box's weight. Saved for the box when it is not 0; when several entries name the same box, the first entry's weight is used.

BinCode

number

No

0

Only for a delivery order that works with bins: the bin the stock is taken from. When sent, only delivery-order lines of that bin are used.

ItemType

text

No

empty

SET = LogicUser_Code is the name of an item set; every unit then assigns each item of the set, in the set's quantities. Anything else = a single item.

Ignored fields. AddlItemCode (only LogicUser_Code is read), Lot_MRP, MRP, DO_Txn_Code, Lot_Code, ItemDetCode, Packing, Packing_CF1, Packing_CF1_Desc, BinName, and at the top: Doc_Type, DO_Date, BranchCode_To, PartyUserCode, SO_Head_Code, SO_No, SO_Date, Customer_Name, SO_Delivery_Date, Action_Code, Logic_User_Name, CurrencyName, ExchangeRate, PickListDocCode. They are accepted so that a Get Delivery Orders record can be sent back unchanged.

Rules Logic ERP applies

  • Which line. For each unit, Logic ERP takes the first line of the delivery order for that item that still has a pending quantity, limited to BinCode when you send it. When an item is on several lines, you cannot choose which line is used, and it is not necessarily the order in which Get Delivery Orders lists them.

  • Which stock. The stock assigned is the lot set aside for that line (from the sale order), in its godown and bin, in the current financial year. You cannot choose another lot. For items tracked piece by piece, Logic ERP picks the next free piece of that lot.

  • Pending quantity. Each assigned unit is taken off the line's pending quantity and off the stock set aside, and counted as stock on a delivery order. Assigning more units than are pending is refused (No pending record found...) and nothing is saved.

  • Boxes. Every unit is recorded with its box. Boxes registered in Logic ERP's box master for this branch, and not yet linked to another document, are linked to the delivery order. For items that are not tracked piece by piece, a box that is already saved on the delivery order for the same item cannot be added to again – use a new box number.

  • Pick lists. When the delivery order was sent for picking (a pick list exists for it), the pick list is updated with the boxes and the quantities packed, and the delivery-order lines that still have a pending quantity are released from the pick list.

  • Several requests. A delivery order can be packed over several requests; each one assigns more units until nothing is pending.

  • Record of the change. The delivery order is recorded as modified in Logic ERP's audit trail.

  • All or nothing. If any entry fails, nothing from the request is saved.

  • No API settings. This endpoint reads no settings of your API site and cannot be switched off per branch.

  • Your Logic ERP licence must include the assign-stock-to-delivery-order (warehouse) API.

Known issue – units can be skipped when stock has run out. If the lot set aside for a line no longer has enough free stock in its godown, the units that cannot be covered are skipped without a message and the answer is still Status: true. After packing, check the delivery order's pending quantity in Logic ERP (or with Get Delivery Orders) before you rely on it.

Known issue – an empty message for pieces. For an item tracked piece by piece, when no free piece is left in the lot, the request fails with Status: false and an empty Message. Nothing is saved; check the lot's stock in Logic ERP.

Known issue – always send DO_Branch_Code. Without it the boxes are not linked to the delivery order in the box master (the units are still assigned to their boxes). Send the delivery order's branch code.

Known issue – the "not on the delivery order" message shows your own number. The message quotes Doc_Prefix and Doc_Number from your request, so it reads DO Nummber : -0 when you did not send them. The delivery order checked is always the one in Doc_Code.

Example request

Response

Field
Type
Meaning

Status

true / false

true when the request was saved – see the first known issue.

Message

text

Empty when saved; the reason when not saved.

LastSavedCode

number

Always 0. Use your Doc_Code to refer to the delivery order.

request_ID

text

The ID of this request – quote it to support.

Example response

Messages you may see

When your API site has logging switched on, every message comes with technical text around it – look for the reason in the first lines.

Message
Meaning
What to do

No Items Present in API Request...

LstItems is empty.

Send at least one item.

Cannot allow zero Doc_Code.

Doc_Code is 0 or missing.

Send the delivery order's internal number.

Unable to found Doc_Code : …

No delivery order has this internal number.

Check Doc_Code in Get Delivery Orders.

Packing BOX Number cannot be blank....for Item :…

An entry has no Packing_Box_No.

Send the box number.

Assign Quantity cannot be zero....for Item :…

Quantity is 0 or less.

Send a quantity above 0.

Invalid Item

LogicUser_Code is not an item code.

Send the code exactly as in Logic ERP.

Item : … not exists in selected delivery order. DO Nummber : …

The item is not on the delivery order, or none of its lines is pending any more.

Check the delivery order; do not resend a request that was already saved.

No pending record found...

More units were sent than are pending for the item (or for the bin you sent).

Send no more than the pending quantity.

Unable to found Item Code :…

The item is on the delivery order, but not in the bin you sent.

Check BinCode.

Unable to found Set : …

With ItemType SET, no set has this name.

Send the set's name exactly as in Logic ERP.

Scanning not allowed if box No. is already saved in database for the same Item...

This box was already saved for the item on this delivery order.

Use a new box number.

Invalid Lot / Carton Code

The stock set aside for the line is not found in its godown for the current financial year.

Check the sale order's reserved stock in Logic ERP.

Bin not exist in Sale Order Reserve. Cann't Save. Aborting... / Bin not exist in against scaning. Cann't Save. Aborting...

The delivery order works with bins, but the stock set aside has no bin.

Correct the reservation in Logic ERP.

DO Un Assign Pending Quantity in Do Txn will go -ve...DO Txn Code:…

The line would go below zero pending (usually two requests at the same time).

Read the delivery order again before resending.

"Status": false with an empty Message

See the known issue on pieces. Nothing was saved.

Check the lot's stock in Logic ERP.

Another technical error

Saving failed inside Logic ERP; nothing was saved.

Retry once; if it repeats, send the request_ID to support.

Last updated