Get Sale Challan Returns
Returns your sale challan returns (goods a party sends back against a delivery challan) from Logic ERP, each with its header and item lines. Use it to copy new and changed challan returns into your own system — normally by asking only for those added or changed since your last call — or to fetch particular ones by their internal number.
The response has exactly the same layout as Get Sale Challans; this page lists only what is different for returns.
Endpoint
Address
https://your-server/api/GetSaleChallanReturn
Method
POST
Authorization
Basic Auth
The response and the common request fields are explained in How Every API Call Works.
Request fields
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 return was saved or edited). 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 numbers (Vouch_Code), separated by commas, for example "5230". Returns exactly these challan returns; 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 challan returns of these branches are returned. Numbers and commas only.
Doc_Num_Like
text
No
empty
Only documents whose internal voucher number starts with this text. Challan returns are numbered like challans: CH followed by the prefix, for example "CHGCR". Used with the bookmark or a period.
Field names are matched without regard to upper or lower case. Other fields in the request are ignored.
Rules Logic ERP applies
The rules of Get Sale Challans apply, with these differences:
Only the return lines. This endpoint returns every challan document that has return lines, with only its return lines in
LstItems. A challan that has both sale and return lines is returned here (with its return lines) and on Get Sale Challans (with its sale lines); its header totals are those of the whole document.Shared change log. Sale challans and challan returns share one change log of up to 150 lines per batch, so a batch can hold no returns: you then get
"No Record Found."withStatus: trueand a higherLastGlobalModifyCode– store it and call again. You have caught up when the message is"No Pending Sale Challan Return found..."andLastGlobalModifyCodeis the value you sent. Keep this endpoint's bookmark separate from the one you use for Get Sale Challans.This endpoint has its own API site settings: your Logic ERP team can limit it to certain branches and choose its fields, separately from Get Sale Challans.
Known issue –
Action_Codeis alwaysN. It does not show whether a challan return was added or modified. Look the document up byVouch_Codein your system to decide between insert and update.
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. 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.
Returns your sale challan returns (goods a party sends back against a delivery challan) from Logic ERP, each with its header and item lines. Use it to copy new and changed challan returns into your own system — normally by asking only for those added or changed since your last call — or to fetch particular ones by their internal number.
The user name and password of your API site.
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.
With GlobalModifyCode 0: a period of changes (the date a challan return was saved or edited). Send both as null when you are not asking for a period. Write them as yyyy-MM-dd.
With GlobalModifyCode 0: a period of changes (the date a challan return was saved or edited). Send both as null when you are not asking for a period. Write them as yyyy-MM-dd.
Logic ERP's internal numbers (Vouch_Code), separated by commas, for example "5230". Returns exactly these challan returns; the bookmark and period are ignored. Numbers and commas only.
Branch codes separated by commas, for example "2,5". Only challan returns of these branches are returned. Numbers and commas only.
Only documents whose internal voucher number starts with this text. Challan returns are numbered like challans: CH followed by the prefix, for example "CHGCR". Used with the bookmark or a period.
Always HTTP 200. Check Status, Message and GetData.
See the Status rules on this page and on How Every API Call Works.
Why the call failed, or a note. The reason may be followed by technical detail - read the first line.
The change-log bookmark (see How Every API Call Works).
Size of the answer, for example "2 KB".
No login was sent.
POST /api/GetSaleChallanReturn 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
Every field is the same as in the response of Get Sale Challans. For a challan return:
Type
CR.
Bill_No, Doc_Prefix, Doc_Number
The return's prefix and number, for example GCR-12.
Account_Code, Account_Name, Customer_Code, Customer_Name
The party the goods came back from.
Quantity, Gross_Amount, Net_Amount, Total_Tax
Totals of the whole document, normally as negative amounts (for example -1.0 and -2123.0).
LstItems[].Sale_Or_SR
SR.
LstItems[].Quantity and amounts
Normally positive – the opposite sign to the header. A line's Quantity can be 0 on some returns while the header Quantity still holds the total.
Example response
Messages you may see
No Pending Sale Challan Return 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 return lines matched: the batch held only sale challans or documents of other branches, nothing changed in the period, or the numbers you sent have no return lines.
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