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

Get Sale Challans

Returns your sale challans (delivery challans: goods sent to a party before or without an invoice) from Logic ERP, each with its header and item lines. Use it to copy new and changed challans into your own system — normally by asking only for challans added or changed since your last call — or to fetch particular challans by their internal number.

Challan returns (goods coming back against a challan) have their own endpoint, Get Sale Challan Returns, with the same response layout.

Endpoint

Name
Detail

Address

https://your-server/api/GetSaleChallan

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 date a challan was saved or edited, not the challan date). Send both as null when you are not asking for a period. Write them as yyyy-MM-dd.

Doc_Codes

text

No

empty

Logic ERP's internal challan numbers (Vouch_Code in the response), separated by commas, for example "5210,5214". Returns exactly these challans; 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 challans of these branches are returned, in every kind of request. Numbers and commas only.

Doc_Num_Like

text

No

empty

Only challans whose internal voucher number starts with this text: CH followed by the challan prefix, for example "CHGCH". Used with the bookmark or a period.

Field names are matched without regard to upper or lower case. Other fields in the request (such as the lookup fields of Get Sale Invoices) are ignored.

Rules Logic ERP applies

  • Only the sale lines. A challan line is either a sale line or a return line. This endpoint returns every challan that has sale lines, with only its sale lines in LstItems. A challan that has both kinds of lines is returned by both challan endpoints, each with its own lines; its header totals are always those of the whole challan.

  • One change log for both challan endpoints. Sale challans and challan returns share one change log. With a bookmark, each call reads up to 150 change-log lines and returns the challans among them that have sale lines, so a batch can hold none: you then 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 Pending Sale Challan found..." and LastGlobalModifyCode is the value you sent. Keep a separate bookmark for each challan endpoint.

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

  • Challans are not split by financial year: Vouch_Code is unique across all years, Doc_Codes finds a challan of any year, and DateFrom/DateTo never filter on the challan date.

  • With Doc_Codes or a period, LastGlobalModifyCode comes back as 0 – do not store it as your bookmark.

  • Your Logic ERP team can limit this endpoint to certain branches in the API site setup; challans of other branches are never returned. It can also choose which fields are returned: a field that is not chosen is left out of the response altogether. When no choice has been made – the usual case – every field below is returned.

  • A line whose item is missing in Logic ERP is left out. Other links that cannot be found give empty values.

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

  • Challans are not returned in any guaranteed order.

  • Dates in the response are text dd/MM/yyyy, and times dd/MM/yyyy hh:mm AM/PM; a date that is not filled is "".

  • A link that is not set is shown as (NIL) or NIL. A challan without a retail customer has Retail_Cust_Name "NIL NIL NIL" and Retail_Cust_Mobile_No "0".

Known issue – Action_Code is always N. It does not show whether a challan was added or modified. Look the challan up by Vouch_Code in your system to decide between insert and update.

Example request

Next batch after your stored bookmark:

Every challan saved or changed on two days, for branch 2:

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. Do not send "GlobalModifyCode": -1 here – it changes what the sandbox has marked as already sent.

Get Sale Challans

post

Returns your sale challans (delivery challans: goods sent to a party before or without an invoice) from Logic ERP, each with its header and item lines. Use it to copy new and changed challans into your own system — normally by asking only for challans added or changed since your last call — or to fetch particular challans by their 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 date a challan was saved or edited, not the challan date). Send both as null when you are not asking for a period. Write them as yyyy-MM-dd.

DateTostring · nullableOptional

With GlobalModifyCode 0: a period of changes (the date a challan was saved or edited, not the challan date). Send both as null when you are not asking for a period. Write them as yyyy-MM-dd.

Doc_CodesstringOptional

Logic ERP's internal challan numbers (Vouch_Code in the response), separated by commas, for example "5210,5214". Returns exactly these challans; the bookmark and period are ignored. Numbers and commas only.

Branch_Codes_FromstringOptional

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

Doc_Num_LikestringOptional

Only challans whose internal voucher number starts with this text: CH followed by the challan prefix, for example "CHGCH". Used with the bookmark or a period.

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/GetSaleChallan
POST /api/GetSaleChallan 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,
      "Bill_No": "text",
      "Bill_Date": "text",
      "Bill_Time": "text",
      "Account_Code": "text",
      "Account_Name": "text",
      "Customer_Code": "text",
      "Customer_Name": "text",
      "Agent_Name": "text",
      "Quantity": 1,
      "Gross_Amount": 1,
      "Net_Amount": 1,
      "Total_Tax": "text",
      "Branch_Name": "text",
      "Branch_Code": 1,
      "Currency_Name": "text",
      "Tax_Region_Name": "text",
      "Action_Code": "text",
      "Type": "text",
      "Branch_Short_Name": "text",
      "Doc_Prefix": "text",
      "Doc_Number": 1,
      "Retail_Cust_Name": "text",
      "Retail_Cust_Mobile_No": "text",
      "Retail_Cust_Email_ID": "text",
      "SO_Party_Order_No": "text",
      "Gr_Number": "text",
      "Gr_Date": "text",
      "Order_No": "text",
      "Order_Date": "text",
      "Remarks1": "text",
      "Cases": "text",
      "Transport_Mode": "text",
      "DNParty_Name": "text",
      "CNParty_Name": "text",
      "DISPParty_Name": "text",
      "HANDParty_Name": "text",
      "POSTParty_Name": "text",
      "DN_Desc": "text",
      "CN_Desc": "text",
      "Display_Desc": "text",
      "Challan_Date": "text",
      "Challan_no": "text",
      "DD_Chq": "text",
      "DD_Chq_No": "text",
      "DD_Chq_Amt": 1,
      "GR_Number_2": "text",
      "GR_Date_2": "text",
      "Issue_Time": "text",
      "Removal_Time": "text",
      "Trans_Name": "text",
      "Remarks2": "text",
      "Remarks3": "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"
      },
      "LstItems": [
        {
          "SL_Txn_Code": 1,
          "Lot_Code": 1,
          "Lot_Number": "text",
          "AddlItemCode": "text",
          "LogicUser_Code": "text",
          "PackName": "text",
          "CF_1": 1,
          "CF_2": 1,
          "CF_3": 1,
          "Weight": 1,
          "Item_Sale_Rate": 1,
          "Item_Sp_Rate_1": 1,
          "Item_Sp_Rate_2": 1,
          "Item_Sp_Rate_3": 1,
          "Item_Sp_Rate_4": 1,
          "Item_Sp_Rate_5": 1,
          "Item_Pur_Rate": 1,
          "Item_MRP": 1,
          "HSN_Code": "text",
          "Quantity": 1,
          "Lot_MRP": 1,
          "Rate": 1,
          "Tax_Amt_1": 1,
          "Tax_Amt_3": 1,
          "Gross_Amt": 1,
          "Net_Amt": 1,
          "Round_Amt": 1,
          "Net_Rate": 1,
          "CD": 1,
          "TD": 1,
          "SP_CD": 1,
          "Scheme_Unit": 1,
          "Scheme_Rs": 1,
          "CD_Per": 1,
          "TD_Per": 1,
          "SP_CD_Per": 1,
          "Sale_Or_SR": "text",
          "Lot_Sale_Rate": 1,
          "Lot_Pur_Rate": 1,
          "Lot_Basic_Rate": 1,
          "Lot_SP_Rate1": 1,
          "Lot_SP_Rate2": 1,
          "Lot_SP_Rate3": 1,
          "Lot_SP_Rate4": 1,
          "Lot_SP_Rate5": 1,
          "SO_Item_Order_ID": "text",
          "Tax_Amt_2": 1,
          "Tax3WithoutSur": 1,
          "Surcharge": 1,
          "ExciseUnit": 1,
          "AdjustPerUnit": 1,
          "AdjustItem": 1,
          "Freight": 1,
          "AdjustmentRupees": 1,
          "SPDiscount": 1,
          "DebitNote": 1,
          "CreditNote": 1,
          "Display": 1,
          "Handling": 1,
          "Postage": 1,
          "ExcisePercentage": 1,
          "Labour": 1
        }
      ]
    }
  ],
  "Status": true,
  "Message": "text",
  "LastGlobalModifyCode": 1,
  "resultSize": "text"
}

Response fields

Each item in GetData is one challan:

Field
Type
Meaning

Vouch_Code

number

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

Bill_No

text

Challan prefix and number, for example GCH-154. Use it as Challan_No in Get Sale Invoices to find the invoices made from this challan.

Doc_Prefix

text

Challan prefix.

Doc_Number

number

Challan number within the prefix.

Bill_Date

date

Challan date, dd/MM/yyyy.

Bill_Time

text

Date and time the challan was saved, dd/MM/yyyy hh:mm AM/PM.

Account_Code, Account_Name

text

Code and name of the account the challan is made to (for a cash challan, the cash account).

Customer_Code, Customer_Name

text

Code and name of the challan's customer party.

Agent_Name

text

The challan's agent, or NIL.

Quantity

number

Total quantity of the whole challan.

Gross_Amount

number

Gross amount of the whole challan in ₹.

Net_Amount

number

Total of the whole challan in ₹.

Total_Tax

text

Total of the three tax amounts in ₹, written as text, for example "3600".

Branch_Code, Branch_Name, Branch_Short_Name

number, text, text

The challan's branch.

Currency_Name

text

Currency, for example INR.

Tax_Region_Name

text

The challan's tax region, for example IGST.

Action_Code

text

Always N – see the known issue.

Type

text

CH (sale challan).

Retail_Cust_Name

text

Retail customer's first, middle and last name, separated by spaces.

Retail_Cust_Mobile_No, Retail_Cust_Email_ID

text

Retail customer's mobile number and e-mail address.

SO_Party_Order_No

text

The party's own order number on the sale order the challan lines were made against (when lines come from different orders, the last line's order); empty when none.

Order_No, Order_Date

text, date

Order number and date typed in the challan's other details.

Challan_no, Challan_Date

text, date

Challan reference typed in the other details.

Gr_Number, Gr_Date

text, date

Transport GR / LR number and date.

GR_Number_2, GR_Date_2

text, date

A second GR / LR number and date.

Cases

text

Number of cases or packages.

Transport_Mode

text

Mode of transport, as typed.

Trans_Name

text

Transporter, or (NIL).

Issue_Time, Removal_Time

text

Time of issue and time of removal of goods, dd/MM/yyyy hh:mm AM/PM; empty when not filled.

Remarks1, Remarks2, Remarks3

text

Remarks typed on the challan.

DNParty_Name, CNParty_Name, DISPParty_Name, HANDParty_Name, POSTParty_Name

text

Accounts used for the debit note, credit note, display, handling and postage amounts, or (NIL).

DN_Desc, CN_Desc, Display_Desc

text

Descriptions typed for those amounts.

DD_Chq

text

Demand draft / cheque indicator as stored, usually "0".

DD_Chq_No, DD_Chq_Amt

text, number

Demand draft or cheque number and amount.

Shipping_Addres

object

The delivery address on the challan (the name is spelt this way). Same fields as on Get Sale Invoices; an empty object with Code 0 when there is none.

Billing_Address

object

The billing address on the challan; same fields.

LstItems

list

The sale lines. See below.

LstItems — one entry per sale line of the challan:

Field
Type
Meaning

SL_Txn_Code

number

Logic ERP's internal number of the challan line.

Lot_Code, Lot_Number

number, text

Internal number and lot number of the lot (batch).

LogicUser_Code

text

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

AddlItemCode

text

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

PackName

text

Pack (size) of the item.

CF_1, CF_2, CF_3

number

The item's conversion factors.

Weight

number

Always 0.

HSN_Code

text

HSN code of the item, or (NIL).

Quantity

number

Quantity on the line.

Rate, Net_Rate

number

Rate and net rate per unit.

Gross_Amt

number

Quantity × rate, in ₹.

Net_Amt

number

Line total, in ₹.

Round_Amt

number

Rounding on the line.

Tax_Amt_1, Tax_Amt_2, Tax_Amt_3

number

Tax amounts of the three tax slots, in ₹, as on Get Sale Invoices (Tax_Amt_3 includes Surcharge). The tax rates are not returned for challans.

Tax3WithoutSur, Surcharge

number

Tax of slot 3 without surcharge, and the surcharge.

CD, TD, SP_CD

number

Cash, trade and special cash discount amounts in ₹ (a discount is negative).

CD_Per, TD_Per, SP_CD_Per

number

The percentages of those discounts.

Scheme_Unit, Scheme_Rs

number

Scheme discount per unit and in rupees.

AdjustPerUnit, AdjustItem, AdjustmentRupees, SPDiscount

number

Other adjustments and special discount on the line.

Freight, DebitNote, CreditNote, Display, Handling, Postage, Labour, ExciseUnit

number

Charges added on the line, in ₹.

ExcisePercentage

number

Despite its name, an amount: the market-fee charge on the line.

Sale_Or_SR

text

SL.

SO_Item_Order_ID

text

The order-line ID of the sale order line this line was made from; empty when none.

Item_MRP, Item_Sale_Rate, Item_Pur_Rate

number

MRP, sale rate and purchase rate in the item master today.

Item_Sp_Rate_1 … Item_Sp_Rate_5

number

Special rates 1–5 in the item master today.

Lot_MRP, Lot_Sale_Rate, Lot_Pur_Rate, Lot_Basic_Rate

number

MRP, sale, purchase and basic rate of the lot.

Lot_SP_Rate1 … Lot_SP_Rate5

number

Special rates 1–5 of the lot.

Compared with Get Sale Invoices, a challan has no New_Bill_No, Bill_Cancelled, sale order number and date (SO_Order_No, SO_Order_Date, SO_Party_Order_Date), payment, credit note, retail-customer membership, e-invoice, TCS, cost centre or discount-total fields, and its lines have no item names, lot supplier, godown, agent or tax-rate fields.

Example response

Messages you may see

Message
Meaning
What to do

No Pending Sale Challan 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)

No challan with sale lines matched: the batch held only challan returns or challans of other branches, nothing changed in the period, or the numbers you sent do not exist.

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

Invalid code in list: … (with Status: false; the part you sent in place of …)

Branch_Codes_From contains something other than numbers and commas.

Send branch codes as numbers separated by commas.

Please Save Configuration from API Template first to Continue... (with Status: false)

This endpoint has not been set up for your API site.

Ask your Logic ERP support team.

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

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

Send Doc_Codes as numbers separated by commas.

Last updated