Save a Sale Document by Type
One address for four kinds of sale document: you say in Doc_Type whether the request is a sale invoice, a sale return, a sale challan or a sale challan return, and Logic ERP passes it on to the matching endpoint. Use it if your system sends all sale documents to one place; otherwise call the specific endpoints directly. The request, the rules and the answer are exactly those of the endpoint chosen.
Endpoint
Address
https://your-server/api/SaveInvoice
Method
POST
Authorization
Basic Auth
The response and the common messages are explained in How Every API Call Works.
Request fields
Doc_Type
text
Yes
–
Which document to save – see the table below. Must be written exactly as shown, in capitals.
all other fields
As described on the page of the document chosen.
Doc_Type
Saves
Same as
Rules Logic ERP applies
The request is handled exactly as if you had sent it to the endpoint in the table: the same fields, checks, defaults, messages and response. Read that page for the details.
Doc_Typeis compared exactly:"sl"," SL"or"SALE"are not recognised and nothing is saved.Sale invoices against a sale order or delivery order, and other sale documents, cannot be sent through this address; use their own endpoints.
A request with no body (or JSON that cannot be read) is answered with a server error, not with the usual answer.
Example request
A sale invoice, trimmed to the essentials (see Save a Sale Invoice for all fields):
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 uses Doc_Type SL and creates one more test sale invoice of the item APITEST0001 on each send.
One address for four kinds of sale document: you say in Doc_Type whether the request is a sale invoice, a sale return, a sale challan or a sale challan return, and Logic ERP passes it on to the matching endpoint. Use it if your system sends all sale documents to one place; otherwise call the specific endpoints directly. The request, the rules and the answer are exactly those of the endpoint chosen.
The user name and password of your API site.
Which document to save – see the table below. Must be written exactly as shown, in capitals.
Logic ERP branch codes, separated by commas, for example "2" or "2,5,7". Numbers only — there is no "all branches" value. Code 0 returns Logic ERP's placeholder branch named (NIL); do not ask for it.
One party code as shown in Logic ERP (User_Code in the response), for example "C1045". Returns that party whether or not it changed recently; the bookmark and period are ignored.
Date of the return, yyyy-MM-dd; it also decides the financial year. A value that is not a date is ignored (today is used).
The series of the return as shown in Logic ERP. It must be a challan return series of the branch – a normal challan series is not accepted here. Use it with Bill_No.
Your order or bill number for this discount, for example "WEB-10452".
Remarks.
Always HTTP 200. Check Status and Message.
See the Status rules on this page.
Why the call failed, or a note. The reason may be followed by technical detail - read the first line.
See this page.
Logic ERP request number of this call.
No login was sent.
POST /api/SaveInvoice HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 243
{
"Doc_Type": "SL",
"BranchCode": 2,
"PartyUserCode": "APITESTC01",
"Bill_Date": "2026-10-30",
"BillSeries": "WSL",
"OrderNo": "APITEST-SL-002",
"Remarks1": "API TEST",
"LstItems": [
{
"LogicUserCode": "APITEST0001",
"Quantity": 1,
"Rate": 3099
}
],
"TenderDetails": []
}{
"Status": true,
"Message": "text",
"LastSavedCode": 1,
"request_ID": "text"
}Response
The answer of the endpoint chosen, with the same fields – for a sale invoice: Status, Message, LastSavedCode, Invoice_No, PartyOrderNo, Order_No, PrintFile and request_ID, as described on Save a Sale Invoice.
When Doc_Type is not one of the four values, the answer is "Status": false with the message below; LastSavedCode is 0 and request_ID is empty.
Example response
Messages you may see
Document Type not set in SaveInvoice Request....Please Check..
Doc_Type is missing, empty or not exactly SL, SR, CH or CHR.
Send one of the four values, in capitals.
Any other message
It comes from the endpoint chosen.
See the messages on that endpoint's page.