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

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

Name
Detail

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

Field
Type
Required
Default
Meaning

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

"SL"

a sale invoice

"SR"

a sale return

"CH"

a sale challan

"CHR"

a sale challan return

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_Type is 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.

Save a Sale Document by Type

post

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.

Authorizations
AuthorizationstringRequired

The user name and password of your API site.

Body
Doc_TypestringOptional

Which document to save – see the table below. Must be written exactly as shown, in capitals.

BranchCodeintegerOptional

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.

PartyUserCodestringOptional

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.

Bill_DatestringOptional

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).

BillSeriesstringOptional

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.

OrderNostringOptional

Your order or bill number for this discount, for example "WEB-10452".

Remarks1stringOptional

Remarks.

TenderDetailsobject[]Optional
Responses
200

Always HTTP 200. Check Status and Message.

application/json
StatusbooleanOptional

See the Status rules on this page.

MessagestringOptional

Why the call failed, or a note. The reason may be followed by technical detail - read the first line.

LastSavedCodeintegerOptional

See this page.

request_IDstringOptional

Logic ERP request number of this call.

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

Message
Meaning
What to do

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.