Get Purchase Challan Returns
Returns your purchase challan returns (goods received on a purchase challan and sent back to the supplier) 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 the same layout as Get Purchase Vouchers, and the request works like Get Purchase Challans; this page lists only what is different for challan returns.
Endpoint
Address
https://your-server/api/GetPUChallanReturn
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.
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 challan return numbers (Vouch_Code), separated by commas, for example "19,70". Returns exactly these; 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". Numbers and commas only.
Doc_Num_Like
text
No
empty
Only documents whose internal number starts with this text. Challan returns start with CH and the date as yyyyMMdd, the same as challans, for example "CH202601". Used with the bookmark or a period.
Field names are matched without regard to upper or lower case. Other fields in the request (for example PartyUserCode, Branch_Codes_To) are ignored.
Rules Logic ERP applies
The rules of Get Purchase Challans apply – challan returns of every year are kept together, so Vouch_Code alone is your key and DateFrom does not choose a year – with these differences:
Only purchase challan returns are returned.
Shared change log. Purchase challans and challan returns share one change log, read in batches of the size set for your API site (150 lines when none is set). A batch can hold no challan 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 Purchase Challan Return found..."andLastGlobalModifyCodeis the value you sent. Keep this endpoint's bookmark separate from the one for Get Purchase Challans.Deleted challan returns come back as short records, as on Get Purchase Challans:
Action_Code"2", an emptyListItems, andVouch_Code,Vouch_No,Vouch_DateandBranch_Codefilled (GRN_PrefixandGRN_Numbertoo when the challan return was sent to you before with"GlobalModifyCode": -1). With"GlobalModifyCode": -1, only a deleted document that this endpoint sent you before is reported. Other challan returns haveAction_Code"0"(added) or"1"(changed).Signs. The header
Quantity,Gross_Amount,Net_AmountandTotal_Taxare negative. On the lines,Quantity,Rateand the tax amounts are zero or positive whilePur_Gross_AmtandPur_Net_Amtare negative, so a line'sPur_Net_Amtis not its real total – use the headerNet_Amountfor the value of the return.Challan returns use their own API site settings: the branches, series (GRN prefixes) and field choice your Logic ERP team set for purchase challan returns.
Known issue – a deleted challan can appear as a deleted challan return. With a bookmark, a period or
Doc_Codes, the short records for deleted documents are taken from the change log shared with challans, without checking which kind of document was deleted. A short record withAction_Code"2"can therefore be a deleted challan. If you also store challans, look theVouch_Codeup among both before you remove it. With"GlobalModifyCode": -1this does not happen.
Example request
Next batch after your stored bookmark:
One challan return by its internal number:
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 purchase challan returns (goods received on a purchase challan and sent back to the supplier) 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.
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 challan return numbers (Vouch_Code), separated by commas, for example "19,70". Returns exactly these; the bookmark and period are ignored. Numbers and commas only.
Branch codes separated by commas, for example "2,5". Numbers and commas only.
Only documents whose internal number starts with this text. Challan returns start with CH and the date as yyyyMMdd, the same as challans, for example "CH202601". 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/GetPUChallanReturn 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,
"Vouch_No": "text",
"Vouch_Date": "text",
"Account_Code": "text",
"Account_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",
"Bill_No": "text",
"Bill_Date": "text",
"GRN_Prefix": "text",
"GRN_Number": 1,
"Tax_Region_Name": "text",
"Goods_In_Transit": 1,
"Action_Code": "text",
"Doc_Type_Desc": "text",
"Doc_Type": "text",
"Gr_Number": "text",
"Gr_Date": "text",
"Order_No": "text",
"Order_Date": "text",
"Header_Remarks_1": "text",
"Header_Remarks_2": "text",
"Header_Remarks_3": "text",
"Transport_Mode": "text",
"Transport_Name": "text",
"Trans_ID": "text",
"Trans_Services": "text",
"Weight": "text",
"Cases": "text",
"GPN_Number": "text",
"GPN_Date": "text",
"ListItems": [
{
"Pur_Txn_Code": 1,
"Lot_Code": 1,
"Lot_Number": "text",
"AddlItemCode": "text",
"ItemCode": "text",
"PackName": "text",
"CF_1": 1,
"CF_2": 1,
"CF_3": 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,
"Pur_MRP": 1,
"Pur_Gross_Amt": 1,
"Pur_Net_Amt": 1,
"Pur_Round_Amt": 1,
"Pur_Net_Rate": 1,
"Gross_Pur_Amt": 1,
"CD": 1,
"TD": 1,
"SP_CD": 1,
"Scheme_Unit": 1,
"Scheme_Rs": 1,
"Freight": 1,
"Adjust_Item": 1,
"Handling": 1,
"Postage": 1,
"ExciseUnit": 1,
"ExcisePercentage": 1,
"CD_Per": 1,
"TD_Per": 1,
"SP_CD_Per": 1,
"Tax_P_1": 1,
"Tax_P_2": 1,
"Tax_P_3": 1,
"Qty_Scanned": 1,
"Qty_Rejected": 1,
"Qty_Excess": 1,
"ItemName": "text",
"ItemHDName": "text",
"ColorName": "text",
"ItemDesc_1": "text",
"CompanyName": "text",
"HSN_Serial_No": "text",
"HSN_Description": "text",
"HSN_UOM": "text",
"Packing": "text",
"Item_Group_Name_1": "text",
"LotPcsInfo": [
{}
]
}
]
}
],
"Status": true,
"Message": "text",
"LastGlobalModifyCode": 1,
"resultSize": "text"
}Response fields
Every field is the same as in the response of Get Purchase Vouchers (GetData items and ListItems). For a challan return:
Vouch_Code
Internal challan return number, unique across all years.
Doc_Type
CR.
Doc_Type_Desc
Purchase Challan Return.
GRN_Prefix, GRN_Number
The challan return's series prefix and number, for example TCHR and 1.
Quantity, Gross_Amount, Net_Amount, Total_Tax
Negative – see the rules.
ListItems[].Pur_Gross_Amt, Pur_Net_Amt
Negative; Quantity, Rate and the tax amounts on the line are zero or positive.
Action_Code
"0" = added, "1" = changed, "2" = deleted (short record).
GPN_Number, GPN_Date
Always empty.
ListItems[].Qty_Scanned, Qty_Rejected, Qty_Excess
Always 0.
Example response
Messages you may see
No Pending Purchase 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 return matched: the batch held only challans or documents outside your filters, nothing in the period was a challan return, or the numbers you sent are not challan returns.
With a bookmark: store the new LastGlobalModifyCode and call again. Otherwise: check what you sent.
Invalid code in list: '…'. Only numeric codes are allowed. (with Status: false)
Doc_Codes or Branch_Codes_From contained something other than numbers and commas.
Send numbers separated by commas.
No code or sub-query supplied. (with Status: false)
Doc_Codes holds only spaces.
Send numbers separated by commas, or leave the field out.
The date messages listed in How Every API Call Works (with Status: true)
A period request with a missing or invalid date.
Send both dates as yyyy-MM-dd, or both as null.
Last updated