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

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

Name
Detail

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

Field
Type
Required
Default
Meaning

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 of up to 150 lines per batch. A batch can hold no challan returns: 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 Purchase Challan Return found..." and LastGlobalModifyCode is the value you sent. Keep this endpoint's bookmark separate from the one for Get Purchase Challans.

  • Signs. The header Quantity, Gross_Amount, Net_Amount and Total_Tax are negative. On the lines, Quantity, Rate and the tax amounts are zero or positive while Pur_Gross_Amt and Pur_Net_Amt are negative, so a line's Pur_Net_Amt is not its real total – use the header Net_Amount for 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 – deleted challan returns are not reported. Unlike Get Purchase Challans, this endpoint sends no short record for a deleted challan return: a challan return deleted in Logic ERP is simply no longer returned. A deleted challan return may instead show up on Get Purchase Challans as a deleted record. To find deletions, fetch the challan returns you hold by Doc_Codes from time to time and remove those that no longer come back.

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.

Get Purchase Challan Returns

post

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.

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.

DateFromstring · nullableOptional

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.

DateTostring · nullableOptional

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_CodesstringOptional

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_FromstringOptional

Branch codes separated by commas, for example "2,5". Numbers and commas only.

Doc_Num_LikestringOptional

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.

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/GetPUChallanReturn
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:

Field
Value 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

Always empty.

GPN_Number, GPN_Date

Always empty.

ListItems[].Qty_Scanned, Qty_Rejected, Qty_Excess

Always 0.

Example response

Messages you may see

Message
Meaning
What to do

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.

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

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

Send numbers separated by commas.

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