Save a Sale Challan
Creates a sale challan in Logic ERP. A sale challan (delivery challan) records goods sent to a customer without raising a sale invoice – for approval, on consignment, or ahead of billing. The goods leave your branch's stock and the challan carries rates, discounts and amounts, but it is not a sale invoice: the sale is billed later, when the challan is converted into a sale invoice in Logic ERP. Use this endpoint when your system dispatches goods first and bills them later; use Save a Sale Invoice when the goods are billed at once.
Endpoint
Address
https://your-server/api/SaveSaleChallanInvoice
Method
POST
Authorization
Basic Auth
Also accepted: https://your-server/api/SaveInvoice with "Doc_Type": "CH" in the request – it is handled exactly like this endpoint.
The response envelope, branches, dates and the common messages are explained in How Every API Call Works.
Send one challan per request. Field names are matched without regard to upper/lower case; fields not listed below are ignored. Leave out a list you do not use (TenderDetails) rather than sending it as null – a null TenderDetails makes the request fail. Do not send null for LogicUserCode or AddlItemCode either; send "" or leave the field out. Likewise, do not send "ShippingAddress": null – leave it out instead – unless BillingAddress is also null.
How it differs from Save a Sale Invoice
The request is the same shape as for Save a Sale Invoice. What changes:
The document is saved in a sale-challan series (
BillSeries), not a sale-invoice series, and is numbered in that series.No TCS is worked out on a challan.
Your API site's "order number must be filled and unique" setting is not applied to challans:
OrderNois stored but never checked.A challan is never exported automatically as a stock transfer.
There is no endpoint to bill a challan: it is converted into a sale invoice in Logic ERP. A challan saved by mistake can be cancelled with Cancel a Sale Challan, sending the
LastSavedCodereturned here asDocCode.
Request fields
BranchCode
number
No
0
The branch issuing the challan, by Logic ERP's branch number (Branch_Code in Get Branch Info).
BranchShortName
text
No
empty
The branch by its short name; used only when BranchCode is 0. With neither, Logic ERP falls back to a default branch – always send one.
BillSeries
text
No*
see rules
Name of a sale-challan series of that branch, for example "DCH". *If you leave it out (or it is not found), Logic ERP uses the challan series linked to the party, then the default series set for this endpoint in your API site; with none of these the request fails.
Bill_Number
number
No
0
A fixed challan number in BillSeries. 0 = Logic ERP gives the next number. Needs BillSeries. See the known issue on duplicate numbers.
Bill_Date
date
No
today
Challan date, yyyy-MM-dd. It also decides the financial year. A value that is not a date is ignored (today is used).
Ext_Bill_No
text
No
empty
Your own document number. When filled, it is saved as the challan's document number and returned in Invoice_No.
OrderNo
text
No
empty
The customer's order number. Stored on the challan and returned in PartyOrderNo; not checked.
OrderDate
date
No
empty
Date of the customer's order.
Order_Id
text
No
empty
A further order reference. If your API site is set to copy the order number, OrderNo is copied into it.
Sale_BillNo, Sale_Bill_Date
text, date
No
empty
A reference bill number and date stored on the challan.
Challan_No, Challan_Date
text, date
No
empty
A reference challan number and date stored on the challan (for example your dispatch note). They do not set the challan's own number.
PaymentMode
text
No
credit
CASH or CREDIT, in capitals. CASH saves the challan in cash mode, with the series' default customer as customer.
ActEntryPartyUserCode
text
No
the party
A different party code for the accounting entry. Must exist.
AgentName
text
No
default agent
Agent or broker, by name as in Logic ERP. Must exist.
TransporterName
text
No
the party's transporter
Transporter, by name. Must exist.
TransportMode
text
No
empty
Mode of transport.
GRNo, GRDate
text, date
No
empty
Goods-receipt (LR / GR) number and date.
WayBillNo
text
No
empty
A way bill of this branch. See the known issue – do not send it.
Tax_Region
text
No
party, else series default
Tax region by its name in Logic ERP, for example "GST (INCL.)". Must exist.
GST_State_Code
text
No
empty
GST state code for the place of supply. Used only when your API site is set to accept it; otherwise ignored.
Tax_Form_Name
text
No
empty
Tax form by name. Must exist.
CostCenter
text
No
empty
Cost centre by name. Must exist.
CurrencyName, ExchangeRate
text, number
No
empty, 0
Foreign currency by name, with its rate (more than 0).
Godown_Name
text
No
empty
Godown to issue the stock from, by name. Must exist.
CreditDays
number
No
Logic ERP's default
Credit days; used when more than 0.
DeliveryAt, DeliveryAdd1, DeliveryAdd2
text
No
empty
Delivery place and address lines.
Cases, Weight, PVTMark
text
No
empty
Number of cases, weight and private mark.
Remarks1, Remarks2, Remarks3
text
No
series default remarks
Remarks.
Insurance_Policy_No
text
No
empty
Insurance policy number.
Declaration_No, DeclarationNo
text
No
empty
Declaration number (two spellings; Declaration_No wins when both are sent).
CD_P, TD_P, SpCD_P
number
No
0
Challan-level CD %, TD % and special CD %. Used when more than 0; they also apply to every line that has none of its own.
Freight, Handling, SpDiscountRs, Adjustment_Rs
number
No
0
Freight, handling, special discount and adjustment in ₹. Used when more than 0.
Ext_NetSale_Value
number
No
0
If not 0, the challan's net amount worked out by Logic ERP must equal this value exactly, or nothing is saved.
RCU_Mem_Prefix, RCU_Mem_Number, RCU_Mobile_No, RCU_Email, RCU_First_Name, RCU_Last_Name, RCU_City, RCU_State, RCU_Country, RCU_PinCode, RCU_GST_No, Billing_Address1, Billing_Address2
text (RCU_Mem_Number number)
No
empty
A retail customer (member) for the challan – see the rules.
BillingAddress, ShippingAddress
object
No
empty
Billing and shipping address printed on the challan. See the table below.
LstItems
list
Yes
–
The items. See the table below.
TenderDetails
list
No
empty
How the challan is paid, if at all. See the table below.
DisplayError
text
No
"0"
"1" = put the full technical error text in Message when something fails.
Request_ID
text
No
empty
Only for API sites set to store requests for later processing (see the rules). Otherwise ignored.
Doc_Type, Doc_Code, STBranchCode, Token_No, InvoiceType, EntrySource
–
No
–
Ignored by this endpoint.
LstItems — one entry per line. Lines are kept as sent; the same item may appear on several lines.
LogicUserCode
text
Yes, or AddlItemCode
empty
The item code shown in Logic ERP (UserCode in Get Item Master). Upper/lower case does not matter.
AddlItemCode
text
Yes, or LogicUserCode
empty
The item's additional code / barcode (AddlItemCode in Get Item Master). Used when LogicUserCode is empty or not found. When LogicUserCode is empty, any other barcode stored for the item is also accepted.
Quantity
number
Yes
–
Quantity; must be more than 0.
Rate
number
No
rate from the series' price list
Rate per unit in ₹. Used when more than 0.
Mrp
number
No
the lot's MRP
MRP; used when more than 0.
Lot_No
text
No
empty
A lot (batch) number. It must exist for the item, but it does not choose the lot: Logic ERP picks the stock itself. See the known issue.
GodownName
text
No
Godown_Name
Godown to issue this line from, by name. Must exist.
CD_P, TD_P, SPCD_P
number
No
challan-level value
Line CD %, TD % and special CD %; used when more than 0.
Scheme_Rs, SchemePerUnit
number
No
0
Scheme discount in ₹ for the line / per unit.
AdjustItem_Rs, AdjustmentRs, AdjustmentPerUnit
number
No
0
Rate adjustments for the line / per unit.
LabourPerUnit
number
No
branch-party-item default
Labour per unit.
ItemDescription
text
No
empty
A description printed for the line.
Production_Unit, SaleOrSR
–
No
–
Ignored.
BillingAddress, ShippingAddress — each has Mobile_No, Contact_Person_Name, Company_Name, Address_1, Address_2, Location_Name, City_Name, State_Name, Country_Name, Pin_Code, Email_Id, Phone_Number (all text). An address is saved only if at least one of contact person, address lines, city, company, country, state, location or mobile is filled. When State_Name matches a state in Logic ERP, the country is taken from that state.
TenderDetails — optional payment lines:
TenderType
text
CASH, CREDIT, CARD or GV (gift voucher); upper/lower case does not matter. Other values are ignored.
Amount
number
Amount in ₹ for this tender.
CardName
text
For CARD: the card name as set up in Logic ERP. Must exist.
CardNo
text
For CARD: the card number; required. A new number is added to Logic ERP's card list.
GiftVoucherNo
text
For GV: the gift voucher number.
Rules Logic ERP applies
Party, branch and date
The party is found by its code exactly as sent. A party locked for billing is refused, and so is a customer over the credit limit (when credit-limit checking is on in Logic ERP).
The branch is
BranchCode, elseBranchShortName. The financial year comes fromBill_Date; without a validBill_Datethe challan is dated today.
Series and number
BillSeriesis looked up among the sale-challan series of the branch. If it is empty or not found, Logic ERP silently uses the challan series linked to the party in Logic ERP, then the default series set for this endpoint in your API site. Only when none exists does the request fail – so a misspelt series name can save into the default series. CheckInvoice_Noin the answer.With
Bill_Numberthe challan gets that number; without it, the next free number of the series.Ext_Bill_No, when sent, becomes the document number shown in Logic ERP and returned inInvoice_No.
Items and stock
Each item is found by
LogicUserCode, elseAddlItemCode. An unknown code stops the request.Logic ERP picks the lots to issue from at the branch (in
GodownName/Godown_Namewhen sent). When Logic ERP is set not to allow negative stock, only lots that have stock are used, and if the stock is short for any item nothing is saved and the message names the item, the quantity asked for and the quantity found. When negative stock is allowed, stock is not checked.Rate,Mrpand the line discounts are used when more than0; otherwise the series' price list and the item's defaults apply. Lines are kept as sent.Schemes set up in Logic ERP are applied to the challan, then totals and taxes are worked out from the tax region:
Tax_Regionwhen sent, otherwise the tax region set for the party (for this branch, else the party's own), otherwise the series default.
Retail customer
If
RCU_Mem_Number,RCU_Mobile_NoorRCU_Emailis filled, the challan is linked to a retail customer.RCU_Mem_Prefix,RCU_Mobile_NoandRCU_First_Nameare then required. The customer is found by membership series + number (whenRCU_Mem_Numberis filled) or by mobile number; if none is found, a new retail customer is created from theRCU_fields, withBilling_Address1/Billing_Address2as its address. Depending on your setup, the e-mail or the mobile number is that customer's ID and must then be filled.
Saving
The challan is saved in one step: if anything fails, no challan is saved. A retail customer or card number created on the way is kept.
Your API site can be set to save in the background. Then the answer comes back at once with
Status: false, an emptyMessageand arequest_ID; the challan is saved a moment later. Look the result up by thatrequest_IDwith theTokenStatusendpoint.Your API site can be set to only store requests for a separate processing program. Then the answer is
Status: falsewith Request is pending for processing... – the request was stored, not refused. The processing program sends it again withRequest_ID; a request already processed returns its stored answer.
Known issue –
WayBillNo. A way bill sent inWayBillNois never linked to the challan, and a way bill that is not finalised is refused with Way Bill No. :… is already Finalized..Please Check (the check is the wrong way round). LeaveWayBillNoout and attach the way bill in Logic ERP.
Known issue – unknown
Lot_Nogives an empty message. If a line'sLot_Nodoes not exist for the item, the request fails withStatus: falseand an emptyMessage. Check lot numbers against Logic ERP first, or leaveLot_Noout (it does not choose the lot anyway).
Known issue – duplicate challan numbers. When you send
Bill_Number, the "already exists" check looks at sale invoices, not challans, so a challan number already used in the series is not caught by it. LeaveBill_Numberat0and let Logic ERP number the challan.
Known issue – an apostrophe in a code or name. Codes and names you send (party code, series, lot number, order number, tax region, godown, agent, transporter, cost centre, currency and so on) are looked up exactly as typed. An apostrophe (
') in any of them, for exampleD'SOUZA, makes the request fail with a database error. Leave apostrophes out of codes and names you send.
Example request
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 sends one pair of the test item APITEST0001 on a challan; each send creates one more test challan.
Creates a sale challan in Logic ERP. A sale challan (delivery challan) records goods sent to a customer without raising a sale invoice – for approval, on consignment, or ahead of billing. The goods leave your branch's stock and the challan carries rates, discounts and amounts, but it is not a sale invoice: the sale is billed later, when the challan is converted into a sale invoice in Logic ERP. Use this endpoint when your system dispatches goods first and bills them later; use Save a Sale Invoice when the goods are billed at once.
The user name and password of your API site.
The branch issuing the challan, by Logic ERP's branch number (Branch_Code in Get Branch Info).
The customer's party code (User_Code in Get Party Master). Must already exist.
Name of a sale-challan series of that branch, for example "DCH". *If you leave it out (or it is not found), Logic ERP uses the challan series linked to the party, then the default series set for this endpoint in your API site; with none of these the request fails.
Challan date, yyyy-MM-dd. It also decides the financial year. A value that is not a date is ignored (today is used).
The customer's order number. Stored on the challan and returned in PartyOrderNo; not checked.
Remarks.
Always HTTP 200. Check Status and Message.
Always empty.
The challan number given, for example DCH-214, or your Ext_Bill_No.
Always empty for this endpoint.
The OrderNo you sent.
true = the challan was saved.
Why it failed. On success it is empty – or, if your API user's Logic ERP rights show the document number after saving, text such as Saved Doc No. - DCH-214 followed by Doc Date - 28/10/2026 on a new line.
Logic ERP's internal number of the challan. Use it to cancel the challan, or to find it in the sale challans you pull.
The ID of this request – quote it to support.
No login was sent.
POST /api/SaveSaleChallanInvoice HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 208
{
"BranchCode": 2,
"PartyUserCode": "APITESTC01",
"BillSeries": "ESH",
"Bill_Date": "2026-10-30",
"OrderNo": "APITEST-CH-001",
"Remarks1": "API TEST",
"LstItems": [
{
"LogicUserCode": "APITEST0001",
"Quantity": 1,
"Rate": 3099
}
]
}{
"PrintFile": "text",
"Invoice_No": "text",
"Order_No": "text",
"PartyOrderNo": "text",
"Status": true,
"Message": "text",
"LastSavedCode": 1,
"request_ID": "text"
}Response
Status
true / false
true = the challan was saved.
Message
text
Why it failed. On success it is empty – or, if your API user's Logic ERP rights show the document number after saving, text such as Saved Doc No. - DCH-214 followed by Doc Date - 28/10/2026 on a new line.
LastSavedCode
number
Logic ERP's internal number of the challan. Use it to cancel the challan, or to find it in the sale challans you pull.
request_ID
text
The ID of this request – quote it to support.
Invoice_No
text
The challan number given, for example DCH-214, or your Ext_Bill_No.
PartyOrderNo
text
The OrderNo you sent.
Order_No
text
Always empty for this endpoint.
PrintFile
text
Always empty.
Example response
Messages you may see
All with Status: false. Text in … is replaced by the value concerned. When the reason comes from an error inside Logic ERP it may be followed by technical detail – read the first line.
Unable to Retrieve Accounts...
PartyUserCode is empty or no account has that code.
Send an existing party code.
Bill Series : … Not found for Branch Code :… in API Parameter..
The series was not found and there is no party-linked or default series.
Send a sale-challan series of that branch.
Default Bill Series Not Set for Branch Code :…
No BillSeries, and no party-linked or default series.
Send BillSeries, or ask your Logic ERP team to set a default.
Cannot allow Bill Saving If Bill Number defined without Bill Series....
Bill_Number without BillSeries.
Send both, or neither.
Bill No. [….] against Branch Code : … already exists...Please Check..
Rarely seen on a challan – the check looks at sale invoices (see the known issue).
Leave Bill_Number at 0.
No Item Present..
LstItems is empty or missing.
Send at least one line.
Invalid Item Qty : … for Item Code : … EAN Code : …
A quantity of 0 or less.
Send a positive quantity.
Invalid LogicUserCode / EANCode : …
The item code / barcode is not in Logic ERP.
Check the code with Get Item Master.
LogicUserCode Or EAN Code Cannot Blank!!
A line has neither code.
Fill one of them.
Stock not available for Item Code : … Quantity : … and Billing Qty : …
Not enough stock at the branch (or godown) for that item.
Reduce the quantity or move stock first.
Invalid Godown Name [….]. Please Check..., Invalid Godown Name : …
Godown_Name / GodownName not found.
Use a godown name from Logic ERP.
Unable to found Tax Region : …
Tax_Region not found.
Use the exact tax region name.
Invalid Agent [….] .Please Check, Invalid Tax Form [….] .Please Check, Unable to found Cost Center [….] .Please Check, Transporter Name [ … ] not found. Please Check...
A name sent does not exist in Logic ERP.
Use the name exactly as in Logic ERP.
Unable to found A/E Party : …
ActEntryPartyUserCode not found.
Send an existing party code.
Currency Name : … not found...Please Check..., Exchange Rate not Defined for Currency Name :…...Please Check...
Unknown currency, or no rate.
Send an existing currency with ExchangeRate above 0.
Way Bill No. :… not found In Branch Code : …, Way Bill No. :… is already Finalized..Please Check
See the known issue.
Leave WayBillNo out.
Sale Bill Locked against Party(Setup New Accounts)
Billing is blocked for this party in Logic ERP.
Ask the Logic ERP user to unblock the party.
The Above Customer has crossed the Credit Limit....Cannot Continue
The party is over its credit limit.
Settle dues or raise the limit in Logic ERP.
Net Value cannot match with External Net Value...
Ext_NetSale_Value differs from Logic ERP's net amount.
Check rates, discounts and taxes, or leave the field at 0.
Card Name [ … ] not found. Please Check..., Credit Card Number Cannot be Blank..
A CARD tender with an unknown card name or no number. The second reason comes after a line of technical text – look for it in the message rather than at its start.
Fix the tender line.
Please Define Customer Membership Series to Continue..., Please Define Mobile No. to Continue..., Customer First Name not defined...Please Check.., Mobile Number cannot be blank..., EMail id cannot be blank...
Retail-customer details are incomplete.
Fill RCU_Mem_Prefix, RCU_Mobile_No, RCU_First_Name (and the e-mail if that is your customer ID), or leave all RCU_ fields empty.
Request is pending for processing...
Your API site stores requests for later processing.
Not an error: keep the request_ID.
(empty, Status: false)
Either your API site saves in the background (see the rules), or a Lot_No was not found (see the known issue).
Look the request up by request_ID, or check Lot_No.
If your API site uses the newer save routine
Your Logic ERP team can switch this endpoint to a newer save routine. It takes the same request, with these differences:
The financial year is taken from
Sale_Bill_Date(today when empty), while the challan date is stillBill_Date. Send both with the same date.Bill_NumberandRequest_IDare ignored, and the request is never saved in the background.Lot_Nois honoured: stock is taken from that lot only. Otherwise the newest lot with stock is used first.The party-linked series is not used: without
BillSeriesthe default series of your API site is taken.No retail customer is linked to a challan, and the order number setting is applied to challans.
GST_State_Codeis always stored when sent.A line with
"SaleOrSR": "SR"is taken back into stock instead of being issued.Different messages:
Unable to found PartyUserCode : …,Party_User_Code cannot be blank...,Default Bill Series Not Set for Branch Code : …,No Item Found!!,Unable to find Item. Logic User Code : …,Quantity cannot be blank. Logic User Code : …,Unable to find available stock/lot for Item Code : …,Entry/Modification is locked for this period....,Unable to Save Sale Bill....
Last updated