Get Sale Returns
Returns your sale returns (credit notes for goods your customers sent back) from Logic ERP, each with its header and item lines. Use it to copy new and changed returns into your own system — normally by asking only for returns added or changed since your last call — or to fetch particular returns by their internal number.
The response has exactly the same layout as Get Sale Invoices; this page lists only what is different for returns.
Endpoint
Address
https://your-server/api/GetSaleReturnInvoice
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 return was saved or edited). Send both as null when you are not asking for a period. Also decides the financial year searched, as on Get Sale Invoices. Write them as yyyy-MM-dd.
Doc_Codes
text
No
empty
Logic ERP's internal return numbers (Vouch_Code), separated by commas, for example "2210,2214". Returns exactly these 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 returns of these branches are returned. Numbers and commas only.
Doc_Num_Like
text
No
empty
Only returns whose internal voucher number starts with this text: SR followed by the return prefix, for example "SRESR". Used with the bookmark or a period.
PartyUserCode, ApprovalFilter
text
No
empty, "0"
Narrow the result as on Get Sale Invoices.
SaleBillNo, SaleOrderNo, PartyOrderNo, Mobile_No, Challan_No
text
No
empty
Accepted, but they are not lookups here. See the rules; leave them out.
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 Invoices apply, with these differences:
Only sale returns are returned – every document saved as a sale return, whether or not it is marked as a stock transfer.
Shared change log. Sale invoices, sale returns and stock transfers out share one change log of up to 150 lines per batch. 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 Return found..."andLastGlobalModifyCodeis the value you sent. Keep this endpoint's bookmark separate from the bookmark you use for Get Sale Invoices.No lookups.
SaleBillNo,Mobile_NoandChallan_Nodo not search the whole year here: they only filter the batch (or period, orDoc_Codes) the request selects. With"GlobalModifyCode": 0and no period that is the first batch of the change log, so a return outside it is not found.SaleOrderNoandPartyOrderNoreplace the selection with the returns linked to that sale order, but only when the change log has something after your bookmark. Do not rely on these fields here; to fetch a known return, useDoc_Codes.DateFromandDateTonever filter on the return date here; they are only a period of changes, or – withDoc_Codes– choose the financial year.Returns use the same API site settings as Get Sale Invoices: the branches, invoice series and field choice your Logic ERP team set for sale invoices also limit this endpoint.
Combined item lines (setting). Your Logic ERP team can set sale returns to be sent combined: lines with the same item code and lot MRP are merged into one line whose
Quantityis the total. A combined line carries onlyLogicUser_Code,AddlItemCode,Quantity,Rate,Lot_MRP,PackName,HSN_Code, theItem_…rates and theLot_…rates (sale, purchase, basic, special); every other line field is0, empty or an empty list. When this setting is off – the usual case – every line is returned as saved.
Known issue – change-log lines of an earlier financial year. As on Get Sale Invoices, a change-log line of a return (or invoice, or stock transfer) of an earlier financial year is read against the current year (with a bookmark, and also in a first sync from
0and in a period request). The return of the earlier year is not returned, and an unrelated current-year return with the sameVouch_Codemay be returned instead. Check thatBill_Dateis in the financial year you expect before you store a record byVouch_Code.
Known issue –
Action_Codeis almost alwaysN. Do not use it to decide between insert and update.
The other known issues on Get Sale Invoices (earlier-year returns fetched with Doc_Codes, Customer_Name, Discount_Coupon_Amt) apply here too.
Example request
Next batch after your stored bookmark:
Two returns 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. Do not send "GlobalModifyCode": -1 here – it changes what the sandbox has marked as already sent.
Returns your sale returns (credit notes for goods your customers sent back) from Logic ERP, each with its header and item lines. Use it to copy new and changed returns into your own system — normally by asking only for returns added or changed since your last call — or to fetch particular returns 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 return was saved or edited). Send both as null when you are not asking for a period. Also decides the financial year searched, as on Get Sale Invoices. Write them as yyyy-MM-dd.
With GlobalModifyCode 0: a period of changes (the date a return was saved or edited). Send both as null when you are not asking for a period. Also decides the financial year searched, as on Get Sale Invoices. Write them as yyyy-MM-dd.
Logic ERP's internal return numbers (Vouch_Code), separated by commas, for example "2210,2214". Returns exactly these returns; the bookmark and period are ignored. Numbers and commas only.
Branch codes separated by commas, for example "2,5". Only returns of these branches are returned. Numbers and commas only.
Only returns whose internal voucher number starts with this text: SR followed by the return prefix, for example "SRESR". Used with the bookmark or a period.
Narrow the result as on Get Sale Invoices.
Narrow the result as on Get Sale Invoices.
Accepted, but they are not lookups here. See the rules; leave them out.
Accepted, but they are not lookups here. See the rules; leave them out.
Accepted, but they are not lookups here. See the rules; leave them out.
Accepted, but they are not lookups here. See the rules; leave them out.
Accepted, but they are not lookups here. See the rules; leave them out.
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/GetSaleReturnInvoice 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",
"New_Bill_No": "text",
"Bill_Date": "text",
"Bill_Time": "text",
"Account_Code": "text",
"Account_Entry_Customer": "text",
"Account_Entry_User_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,
"RCU_Membership_Series": "text",
"RCU_Membership_Number": 1,
"Retail_Cust_Name": "text",
"Retail_Cust_Mobile_No": "text",
"Retail_Cust_Email_ID": "text",
"SO_Order_No": "text",
"SO_Order_Date": "text",
"SO_Party_Order_No": "text",
"SO_Party_Order_Date": "text",
"Credit_Note_Bill_Amount": 1,
"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",
"Credit_Note_Amount": 1,
"ST_Branch_Code": 1,
"RCU_Create_Date": "text",
"RCU_State": "text",
"RCU_Country": "text",
"RCU_CountryCode": "text",
"Credit_Amount": 1,
"Cash_Amount": 1,
"Gift_Voucher_Amount": 1,
"Discount_Coupon_No": "text",
"Discount_Coupon_Amt": 1,
"Bill_Cancelled": true,
"GST_EInvoice_IRN_No": "text",
"GST_EInvoice_QR_Image": "text",
"GST_EInvoice_Acknowledgement_No": "text",
"GST_EInvoice_Acknowledgement_Date": "text",
"GST_EWay_Bill_No": "text",
"GST_EWay_Bill_Date": "text",
"InvoicePDFLink": "text",
"TCS_Act_Name": "text",
"TCS_Percent": 1,
"TCS_Amount": 1,
"CC_Plus_CE_Name": "text",
"Cost_Center_Name": "text",
"Cost_Element_Name": "text",
"Credit_Card_Amount": 1,
"Discount_Amount": 1,
"ItemCount": 1,
"Patient_Name": "text",
"Patient_Mobile_No": "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"
},
"ListCreditCard": [
{}
],
"LstItems": [
{
"SL_Txn_Code": 1,
"Lot_Code": 1,
"Lot_Number": "text",
"AddlItemCode": "text",
"LogicUser_Code": "text",
"PackName": "text",
"ItemName": "text",
"ItemHDName": "text",
"ItemDescription_1": "text",
"ColorName": "text",
"CompanyName": "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,
"MRP_SaleBill": 1,
"Gross_Amt": 1,
"Net_Amt": 1,
"Round_Amt": 1,
"Net_Rate": 1,
"Sale_Amt": 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,
"RRate": 1,
"Tax_1": 1,
"Tax_2": 1,
"Tax_3": 1,
"Agent_Name": "text",
"Agent_ShortName": "text",
"Item_Group_Name_1": "text",
"Lot_Sup_Code": "text",
"Lot_Sup_Name": "text",
"Lot_Bill_No": "text",
"Lot_Purchase_Date": "text",
"Lot_Expiry_Date": "text",
"Lot_Mfg_Date": "text",
"Scheme_Campaign_Group_Name": "text",
"Scheme_Campaign_Name": "text",
"Godown_Name": "text",
"HSN_Serial_No": "text",
"HSN_Description": "text",
"HSN_UOM": "text",
"Packing": "text",
"Invoice_Prescription_Days": "text",
"ListOtherAgents": [
{}
]
}
]
}
],
"Status": true,
"Message": "text",
"LastGlobalModifyCode": 1,
"resultSize": "text"
}Response fields
Every field is the same as in the response of Get Sale Invoices (GetData items, Shipping_Addres, Billing_Address, ListCreditCard, LstItems, ListOtherAgents). For a return:
Type
SR.
Bill_No, Doc_Prefix, Doc_Number, New_Bill_No
The return's prefix and number, for example ESR-2 and 2627/2/ESR-2.
Account_Code, Account_Name, Customer_Code
The party (or cash account) the goods came back from.
Quantity, Gross_Amount, Net_Amount, Total_Tax
Totals of the return, as positive amounts.
Credit_Note_Bill_Amount
The return's total (the same as Net_Amount): the credit note it creates.
Credit_Note_Amount
Normally 0 (it is the credit notes adjusted against an invoice).
Cash_Amount, Credit_Amount, Credit_Card_Amount, Gift_Voucher_Amount
How the return was settled; without a payment split the whole Net_Amount is shown as Cash_Amount (cash return) or Credit_Amount (credit return).
LstItems[].Sale_Or_SR
SR.
LstItems[].Quantity and amounts
Positive.
Example response
Messages you may see
No Pending Sale 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 sale return matched: the batch held only invoices, stock transfers or returns outside your filters, nothing in the period was a return, or the numbers you sent are not returns of that financial year.
With a bookmark: store the new LastGlobalModifyCode and call again. Otherwise: check what you sent.
Invalid code list: '…' (with Status: false; the text you sent in place of …)
Branch_Codes_From contains something other than numbers and commas.
Send branch codes as numbers separated by commas.
Index was outside the bounds of the array., Conversion from string "…" to type 'Integer' is not valid. or Object reference not set to an instance of an object. (with Status: false)
Challan_No without -, SaleOrderNo with a non-number after -, or PartyOrderNo with "SaleOrderNo": null.
Leave these fields out on this endpoint.
A database error (with Status: false), for example Invalid column name 'abc'.
Doc_Codes contained something other than numbers and commas, or a filter value contained a '. The reason may be followed by technical detail – read the first line.
Send Doc_Codes as numbers separated by commas.
Last updated