Save a Stock Transfer Out Against a Delivery Order
Creates a stock transfer out from a delivery order that is already in Logic ERP. A delivery order sets goods aside for a party – either assigned against a sale order, or packed on a packing slip (with or without a sale order). This endpoint takes the delivery order's open lines, saves them as a transfer out from the branch to the receiving branch, and marks those lines as dispatched.
The transfer itself – stock-transfer series, receiving branch, taxes, automatic stock transfer in – works as described in Save a Stock Transfer Out. This page describes what is different when the transfer is made against a delivery order. To transfer straight from a sale order, use Save a Stock Transfer Out Against a Sale Order.
Endpoint
Address
https://your-server/api/SaveSTOAgainstDO
Method
POST
Authorization
Basic Auth
The response envelope, branches, dates, queueing and the common messages are explained in How Every API Call Works.
Send one transfer, against one delivery order, per request. Field names are matched without regard to upper/lower case; fields not listed below are ignored. Send TenderDetails as [] or leave it out – null makes the request fail – and do not send null for LogicUserCode or AddlItemCode.
How the delivery order is found
Send
Doc_Code: Logic ERP's internal number of the delivery order – theLastSavedCodeyou got when it was saved (for example from Assign Stock to a Delivery Order or Save a Packing Slip Against a Sale Order), or its internal number in Get Delivery Orders. Delivery orders assigned against a sale order, packing slips against a sale order and packing slips without one are all accepted.Or leave
Doc_Codeat0and sendOrderNowithBranchCode: Logic ERP then looks for a delivery order assigned against a sale order that still has something pending, whose sale order belongs toBranchCodeand has the party order numberOrderNo(theParty_Order_Nosent with Save a Sale Order). Packing slips are not found this way – see the known issue.The transfer is saved in the delivery order's branch; the
BranchCodeyou send is replaced by it.The party is the delivery order's party;
PartyUserCodeis ignored. For a proper stock transfer the delivery order must be for the receiving branch's stock-transfer party (see Save a Stock Transfer Out, How the receiving branch and party are chosen).STBranchCodeworks as there.A delivery order that is waiting for approval is refused.
What is transferred
Whole open lines. Every line of the delivery order that still has a pending quantity is transferred with its full pending quantity. The
Quantityyou send is checked to be above0but is not used – see the known issue.Choosing items.
LstItemslimits the transfer to the lines of the items you list only when the stock-transfer series used has "Allow Item Selection in SO/Chal Reterival" switched on in its sale configuration in Logic ERP. Otherwise the items you list are only checked (they must exist, and so must anyLot_Noyou send) and all open lines are transferred.LstItemsmay be empty.Lots and stock come from the delivery order: the lots and godowns it set aside are issued.
Rates and discounts are worked out as on Logic ERP's sale screen when a delivery order is pulled in, according to the stock-transfer series' settings – not from the request.
Rate,Mrp,CD_P,TD_P,SPCD_P,Scheme_Rs,AdjustItem_RsandItemDescriptioninLstItemsare ignored. Transfer-levelCD_P,TD_P,SpCD_P,Freight,Handling,SpDiscountRsandAdjustment_Rsstill apply.
What happens to the delivery order
The transferred lines' pending quantity is reduced to nothing, so they cannot be transferred or billed again.
For a delivery order assigned against a sale order, the sale order's pending quantity is reduced by the transferred quantity as well. (A packing slip against a sale order already reduced it when the packing slip was saved.)
Request fields
The request has the same shape as Save a Stock Transfer Out. Fields not in this table – Bill_Number, Bill_Date, Ext_Bill_No, Tax_Region, GST_State_Code, Tax_Form_Name, PaymentMode, ActEntryPartyUserCode, AgentName, TransporterName, CostCenter, transport, delivery and remark fields, CurrencyName, ExchangeRate, CreditDays, Godown_Name, Ext_NetSale_Value, TenderDetails, DisplayError and the transfer-level discounts and charges – work exactly as described there.
Doc_Code
number
Yes, or OrderNo
0
Logic ERP's internal number of the delivery order (see above).
OrderNo
text
Yes, if Doc_Code is 0
empty
The sale order's party order number, used to find the delivery order when Doc_Code is 0. Also saved on the transfer as its order number.
BranchCode
number
Yes, with OrderNo
0
With OrderNo: the branch of the sale order. Otherwise replaced by the delivery order's branch.
BillSeries
text
Yes, in practice
see rules
A stock-transfer series of the delivery order's branch, for example "STO".
STBranchCode
number
No
the party's linked branch
As on Save a Stock Transfer Out.
LstItems
list
No
empty
Items to transfer – used only with the item-selection setting described above.
PartyUserCode, BranchShortName (when Doc_Code is sent), EntrySource, InvoiceType, Doc_Type, Request_ID, RCU_… fields, Billing_Address1, Billing_Address2, BillingAddress, ShippingAddress, Token_No
–
No
–
Ignored by this endpoint.
LstItems
LogicUserCode
text
Yes, or AddlItemCode
empty
The item code shown in Logic ERP (UserCode in Get Item Master). Must exist.
AddlItemCode
text
Yes, or LogicUserCode
empty
The item's additional code / barcode, used when LogicUserCode is empty.
Quantity
number
Yes
–
Must be above 0. Not used – the delivery order line's pending quantity is transferred.
Lot_No
text
No
empty
Must exist for the item if sent; does not choose the lot.
Rate, Mrp, CD_P, TD_P, SPCD_P, Scheme_Rs, AdjustItem_Rs, ItemDescription, SchemePerUnit, LabourPerUnit, AdjustmentPerUnit, AdjustmentRs, GodownName, Production_Unit, SaleOrSR
–
No
–
Ignored.
Rules Logic ERP applies
No settings of its own. Unlike Save a Stock Transfer Out, this endpoint has no settings in your API site: there is no default series, no order-number check, no background saving or request storing, and it cannot be switched off per branch.
Series.
BillSeriesis looked up among the stock-transfer series of the delivery order's branch. If it is empty or not found, the series linked to the party in Logic ERP is used; with none, the request fails with Default Bill Series Not Set for Branch Code :… (or Bill Series : … Not found …). Always sendBillSeries.Date and financial year. The transfer is dated
Bill_Date(today when left out), andBill_Datedecides the financial year.Duplicates. There is no duplicate check on the request. Transferred lines are no longer pending, so a repeat finds nothing to transfer and fails. Check
Statusbefore you resend.After saving. The automatic stock transfer in works as on Save a Stock Transfer Out. The transfer and the changes to the delivery order and sale order are saved together; if anything fails, nothing is saved.
Your Logic ERP licence must include this endpoint.
Known issue –
Quantityis not used. Each open line of the delivery order is transferred with its full pending quantity, whateverQuantityyou send. To transfer only part of a delivery order, change the delivery order in Logic ERP first, or transfer from the sale order with Save a Stock Transfer Out Against a Sale Order.
Known issue –
LstItemsdoes not limit the transfer unless the series allows item selection. Without "Allow Item Selection in SO/Chal Reterival" on the stock-transfer series, every open line of the delivery order is transferred, including items you did not list. With the setting on, a request whose items are not on the delivery order finds nothing to transfer and fails.
Known issue –
OrderNofinds only delivery orders assigned against a sale order. Packing slips are never found byOrderNo, and when several open delivery orders exist for the same sale order, any one of them may be taken.BranchShortNamecannot replaceBranchCodefor this search. SendDoc_Codewhenever you can.
Known issue – the document is marked as a transfer only through the party. This endpoint does not itself mark the document as a stock transfer: Logic ERP takes that mark from the party's "stock-transfer party" setting. If the delivery order is for a party that is not a stock-transfer party, the document is normally saved as an ordinary sale in the stock-transfer series – for example the receiving branch's stock limit is not checked. Use delivery orders made out to the receiving branch's stock-transfer party.
Known issue –
WayBillNo. A way bill is never linked to the transfer, and a way bill that is not finalised is refused with Way Bill No. :… is already Finalized..Please Check. LeaveWayBillNoout.
Known issue – an apostrophe in a code or name. Codes and names you send (order number, series, lot number, tax region, godown, agent, transporter, cost centre and so on) are looked up exactly as typed. An apostrophe (
') in any of them makes the request fail with a database error. Leave apostrophes out of codes and names you send.
Example request
Response
Status
true / false
true = the transfer was saved.
Message
text
Why it failed. On success it is empty, or holds the notes and the Saved Doc No. text described on Save a Stock Transfer Out.
LastSavedCode
number
Logic ERP's internal number of the transfer out.
request_ID
text
The ID of this request – quote it to support.
Invoice_No
text
The transfer's number, for example STO-62, or your Ext_Bill_No.
Order_No
text
The delivery order's number in Logic ERP (its prefix and number), for example PS-118. Empty when the request fails.
PartyOrderNo
text
The order number held on the transfer – normally the OrderNo you sent.
PrintFile
text
Always empty.
Example response
Messages you may see
All with Status: false. Text in … is replaced by the value concerned. Where the reason comes from an error inside Logic ERP it may be followed by technical detail – read the first line. The messages about the series, Bill_Number, item codes, lot numbers, names that are not found, currency, way bill, credit limit, Ext_NetSale_Value and card tenders are the same as on Save a Stock Transfer Out.
Unable to Retrieve Delivery Order...
Doc_Code is 0 and no open delivery order was found for OrderNo in BranchCode.
Send Doc_Code, or check OrderNo and BranchCode.
Doc_Code (Delivery Order Code) : … not exists..Please Check...
No delivery order has that internal number.
Check Doc_Code.
Delivery Order Is marked as Un Approved. Cannot allow Bill Creation :…
The delivery order is waiting for approval.
Have it approved in Logic ERP first.
No Items present....
Nothing was left to transfer – the delivery order is already fully dispatched, or (with item selection on) none of your items is on it.
Check the delivery order with Get Delivery Orders.
Unable to Retrieve Accounts...
The delivery order's party could not be read.
Check the delivery order in Logic ERP.