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

Get Sale Orders

Returns your sale orders from Logic ERP, each with its header (party, branch, agent, amounts, the party's own order number, delivery and billing address) and its item lines (item, lot, ordered quantity, rate and discount percentages). Use it to copy new and changed sale orders into your own system – normally by asking only for orders added or changed since your last call – or to fetch particular orders by Logic ERP's internal number.

Endpoint

Name
Detail

Address

https://your-server/api/GetSaleOrder

Method

POST

Authorization

Basic Auth

The response and the common request fields are explained in How Every API Call Works.

Request fields

Field
Type
Required
Default
Meaning

GlobalModifyCode

number

No

0

Your bookmark in the change log, as described in How Every API Call Works: 0 = from the start (or a period, with DateFrom/DateTo), a number = only changes after it, -1 = Logic ERP keeps the bookmark for you.

DateFrom, DateTo

date

No

empty

With GlobalModifyCode 0: a period of changes (the day an order was saved or edited, not the order date). Send both as null when you are not asking for a period – with GlobalModifyCode 0 and no Doc_Codes, leaving them out gives Invalid Date From.. (with a bookmark they are not checked). Write them as yyyy-MM-dd.

Doc_Codes

text

No

empty

Logic ERP's internal order numbers (Vouch_Code in the response), separated by commas, for example "486988,486989". Returns exactly these orders; the bookmark and period are ignored. Numbers and commas only.

Branch_Codes_From

text

No

empty

Branch codes separated by commas, for example "2,5". Only orders of these branches are returned, in every kind of request. Numbers and commas only.

Doc_Num_Like

text

No

empty

Only orders whose number starts with this text. Used with the bookmark or a period. Send the prefix, for example "GSO": sale order numbers are kept in the change log as prefix and number joined by a space or a - depending on how the order was saved, so "GSO-" can find nothing. A short text also matches longer prefixes that start the same way.

Field names are matched without regard to upper or lower case. Other fields in the request (for example ApprovalFilter or PartyUserCode) are ignored.

Rules Logic ERP applies

  • One change log for sale orders. With a bookmark, each call reads up to 150 change-log lines and returns the orders they belong to. When none of them can be returned (for example because of Branch_Codes_From), you get "No Record Found." with Status: true and a higher LastGlobalModifyCode – store it and call again. You have caught up when the message is "No Sale Order found..." and LastGlobalModifyCode is the value you sent.

  • An order can come back in a later batch. Every save of an order adds a line to the change log, so an order edited after your bookmark is returned again with its current details. Update it in your system; do not add it a second time.

  • Not split by financial year. Sale orders are not kept per financial year, so Vouch_Code identifies an order without a year, and orders of every year are returned. The change-log problem with earlier financial years that affects some other endpoints does not apply here.

  • What is returned. Every order in the batch is returned whether it is approved or still waiting for approval, and whether or not it has been delivered or billed. Nothing in the response says whether an order is approved, and approving an order does not send it to you again. Quantity on a line is the quantity ordered; the quantity still pending is not returned. See the known issue on cancelled orders.

  • Orders deleted in Logic ERP are not returned, so a deletion does not reach you through this endpoint.

  • With Doc_Codes and with a period request, LastGlobalModifyCode comes back as 0 – do not store it.

  • DateFrom and DateTo only select changes for a period request; they never filter on the order date, and they are ignored when Doc_Codes is filled.

  • Every line must find its item in Logic ERP, and the order its party, agent, branch and currency. A line that cannot is left out. In normal use these records always exist.

  • Orders and their lines are not returned in any guaranteed order.

  • Dates in the response are text dd/MM/yyyy, for example 03/10/2026.

Known issue – cancelled orders look like open orders. A cancelled sale order, or a cancelled line, is returned like any other, and nothing in the response says that it is cancelled. Do not treat every returned order as open; check cancellations in Logic ERP.

Known issue – Action_Code is always empty. It never says whether an order was added or modified. Look the order up by Vouch_Code in your system to decide between insert and update.

Known issue – your Logic ERP team's branch, account-group and prefix limits are not applied. The API site setup offers these limits for sale orders, but this endpoint ignores them: orders of every branch, party and prefix are returned. Use Branch_Codes_From and Doc_Num_Like to narrow the request yourself.

Example request

Next batch after your stored bookmark:

Two orders by their internal numbers:

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. The example asks for the first batch of the change log; send the LastGlobalModifyCode you get back to see the next batch. Do not send "GlobalModifyCode": -1 here – it changes what the sandbox has marked as already sent.

Get Sale Orders

post

Returns your sale orders from Logic ERP, each with its header (party, branch, agent, amounts, the party's own order number, delivery and billing address) and its item lines (item, lot, ordered quantity, rate and discount percentages). Use it to copy new and changed sale orders into your own system – normally by asking only for orders added or changed since your last call – or to fetch particular orders by Logic ERP's internal number.

Authorizations
AuthorizationstringRequired

The user name and password of your API site.

Body
GlobalModifyCodeintegerOptional

Your bookmark in the change log, as described in How Every API Call Works: 0 = from the start (or a period, with DateFrom/DateTo), a number = only changes after it, -1 = Logic ERP keeps the bookmark for you.

DateFromstring · nullableOptional

With GlobalModifyCode 0: a period of changes (the day an order was saved or edited, not the order date). Send both as null when you are not asking for a period – with GlobalModifyCode 0 and no Doc_Codes, leaving them out gives Invalid Date From.. (with a bookmark they are not checked). Write them as yyyy-MM-dd.

DateTostring · nullableOptional

With GlobalModifyCode 0: a period of changes (the day an order was saved or edited, not the order date). Send both as null when you are not asking for a period – with GlobalModifyCode 0 and no Doc_Codes, leaving them out gives Invalid Date From.. (with a bookmark they are not checked). Write them as yyyy-MM-dd.

Doc_CodesstringOptional

Logic ERP's internal order numbers (Vouch_Code in the response), separated by commas, for example "486988,486989". Returns exactly these orders; the bookmark and period are ignored. Numbers and commas only.

Branch_Codes_FromstringOptional

Branch codes separated by commas, for example "2,5". Only orders of these branches are returned, in every kind of request. Numbers and commas only.

Doc_Num_LikestringOptional

Only orders whose number starts with this text. Used with the bookmark or a period. Send the prefix, for example "GSO": sale order numbers are kept in the change log as prefix and number joined by a space or a - depending on how the order was saved, so "GSO-" can find nothing. A short text also matches longer prefixes that start the same way.

Responses
200

Always HTTP 200. Check Status, Message and GetData.

application/json
StatusbooleanOptional

See the Status rules on this page and on How Every API Call Works.

MessagestringOptional

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

LastGlobalModifyCodeintegerOptional

The change-log bookmark (see How Every API Call Works).

resultSizestringOptional

Size of the answer, for example "2 KB".

post/GetSaleOrder
POST /api/GetSaleOrder HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 52

{
  "GlobalModifyCode": 0,
  "DateFrom": null,
  "DateTo": null
}
{
  "GetData": [
    {
      "Vouch_Code": 1,
      "Order_Prefix": "text",
      "Order_Number": 1,
      "Order_No": "text",
      "Order_Date": "text",
      "Valid_Date": "text",
      "Party_Name": "text",
      "Party_User_Code": "text",
      "Agent_Name": "text",
      "Branch_Code": 1,
      "Branch_Name": "text",
      "Branch_Short_Name": "text",
      "Exchange_Rate": 1,
      "Currency_Name": "text",
      "Order_Amount": 1,
      "Net_Order_Amount": 1,
      "Party_Order_No": "text",
      "Action_Code": "text",
      "ClassSaveRetvDeliveryAddress": "text",
      "Shipping_Addres": {
        "Code": 1,
        "Cust_Code": 1,
        "Contact_Person_Name": "text",
        "Phone_Number": "text",
        "Address_1": "text",
        "Address_2": "text",
        "Driving_Directions": "text",
        "City_Name": "text",
        "Code_Type": "text",
        "Country_Name": "text",
        "Email_Id": "text",
        "Location_Code": 1,
        "Mobile_No": "text",
        "Pin_Code": "text",
        "State_Name": "text",
        "Company_Name": "text",
        "Latitude": "text",
        "Longitude": "text",
        "Address_ID": "text",
        "Complete_Address": "text",
        "External_Address_Id": "text",
        "Location_Name": "text",
        "State_Code": 1,
        "Country_Code": 1,
        "DisplayAddress": "text",
        "DeleteAddress": true,
        "SameAsShippingAddress": true,
        "Gst_No": "text"
      },
      "Billing_Address": {
        "Code": 1,
        "Cust_Code": 1,
        "Contact_Person_Name": "text",
        "Phone_Number": "text",
        "Address_1": "text",
        "Address_2": "text",
        "Driving_Directions": "text",
        "City_Name": "text",
        "Code_Type": "text",
        "Country_Name": "text",
        "Email_Id": "text",
        "Location_Code": 1,
        "Mobile_No": "text",
        "Pin_Code": "text",
        "State_Name": "text",
        "Company_Name": "text",
        "Latitude": "text",
        "Longitude": "text",
        "Address_ID": "text",
        "Complete_Address": "text",
        "External_Address_Id": "text",
        "Location_Name": "text",
        "State_Code": 1,
        "Country_Code": 1,
        "DisplayAddress": "text",
        "DeleteAddress": true,
        "SameAsShippingAddress": true,
        "Gst_No": "text"
      },
      "ListItems": [
        {
          "SoTxnCode": 1,
          "ItemCode": "text",
          "EAN_Code": "text",
          "Lot_Number": "text",
          "Quantity": 1,
          "Rate": 1,
          "CD_P": 1,
          "TD_P": 1
        }
      ]
    }
  ],
  "Status": true,
  "Message": "text",
  "LastGlobalModifyCode": 1,
  "resultSize": "text"
}

Response fields

Each item in GetData is one sale order:

Field
Type
Meaning

Vouch_Code

number

Logic ERP's internal order number. Use it in Doc_Codes.

Order_Prefix

text

Order prefix, for example GSO.

Order_Number

number

Order number within the prefix.

Order_No

text

Prefix and number joined by the separator your Logic ERP team set in the API site setup, for example GSO-8; with no separator set, GSO8. The separator can be any text, even a letter – do not split Order_No; use Order_Prefix and Order_Number.

Order_Date

date

Order date, dd/MM/yyyy.

Valid_Date

date

Date the order is valid until, dd/MM/yyyy.

Party_Name

text

Name of the party (customer) as kept in Logic ERP, usually with its city, for example SHREE GANESH TEXTILES -LUDHIANA. There may be several spaces before the -.

Party_User_Code

text

Code of the party as shown in Logic ERP.

Agent_Name

text

The order's agent or salesman, or NIL.

Branch_Code

number

Code of the order's branch.

Branch_Name, Branch_Short_Name

text

Name and short name of that branch.

Exchange_Rate

number

Exchange rate of the order's currency; 1 for rupees.

Currency_Name

text

Currency, for example INR.

Order_Amount

number

Order value before taxes, in the order's currency.

Net_Order_Amount

number

Order total.

Party_Order_No

text

The party's own order number, as typed on the order.

Action_Code

text

Always empty – see the known issue.

ClassSaveRetvDeliveryAddress

–

Always null. Ignore it.

Shipping_Addres

object

The delivery address on the order (the name is spelt this way); null when the order has no address details. See below.

Billing_Address

object

The billing address on the order; null when the order has no address details. See below.

ListItems

list

The item lines. See below.

Shipping_Addres and Billing_Address — when the order has address details but not this address, the object is present with empty texts, 0 numbers and null for Address_ID, Location_Name and Gst_No:

Field
Type
Meaning

Code

number

Logic ERP's internal address number; 0 when there is no such address.

Cust_Code

number

Internal number of the customer the address belongs to; 0 when not linked.

Contact_Person_Name

text

Contact person.

Phone_Number, Mobile_No, Email_Id

text

Phone, mobile and e-mail at the address.

Company_Name

text

Company name at the address.

Address_1, Address_2

text

Address lines.

Complete_Address

text

The full address in one text, when kept.

Driving_Directions

text

Directions.

City_Name, State_Name, Country_Name, Pin_Code

text

City, state, country and PIN code.

State_Code

number

Internal number of the state.

Country_Code

number

Always 0.

Location_Code, Location_Name

number, text

Location, when used.

Latitude, Longitude

text

Map position, when kept.

Address_ID, External_Address_Id

text

Logic ERP's address ID and the ID your system gave the address, if any.

Gst_No

text

GSTIN at the address.

Code_Type

text

Kind of address, as stored.

DisplayAddress

text

Mobile number and contact person joined with -.

DeleteAddress, SameAsShippingAddress

true / false

Always false here – ignore.

ListItems — one entry per order line:

Field
Type
Meaning

SoTxnCode

number

Logic ERP's internal line number.

ItemCode

text

Item code as shown in Logic ERP (UserCode in Get Item Master).

EAN_Code

text

The item's additional code, for example a barcode.

Lot_Number

text

Lot number named on the line; empty when none.

Quantity

number

Quantity ordered.

Rate

number

Rate on the line.

CD_P, TD_P

number

Cash discount and trade discount percentages on the line.

Example response

Messages you may see

Message
Meaning
What to do

No Sale Order found... (with Status: true)

Nothing has been added to the change log after your bookmark.

You are up to date. Call again later with the same bookmark.

No Record Found. (with Status: true)

Change-log lines were found but no order could be returned – for example all were of other branches or deleted orders – or no order was saved or changed in the period, or the Doc_Codes you sent found nothing.

With a bookmark: store the new LastGlobalModifyCode and call again. Otherwise: check what you sent.

Request cannot be processed. API Template is marked as In-Active in the configuration. (with Status: false)

Your Logic ERP team has switched this endpoint off for your API site.

Ask your Logic ERP support team.

A database error (with Status: false), for example Invalid column name 'abc'.

Doc_Codes or Branch_Codes_From contains something other than numbers and commas. The reason may be followed by technical detail – read the first line.

Send codes as numbers separated by commas.

Last updated