> For the complete documentation index, see [llms.txt](https://kb.logicerp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/purchase/pull/get-purchase-challans.md).

# Get Purchase Challans

Returns your **purchase challans** (goods received from suppliers on a delivery challan, before the purchase bill) 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. Deleted challans are reported too.

The response has **the same layout as** [**Get Purchase Vouchers**](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/purchase/pull/get-purchase-vouchers.md); this page lists only what is different for challans. Challan returns have their own endpoint, [Get Purchase Challan Returns](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/purchase/pull/get-purchase-challan-returns.md).

### **Endpoint**

| Name          | Detail                                       |
| ------------- | -------------------------------------------- |
| Address       | `https://your-server/api/GetPurchaseChallan` |
| Method        | `POST`                                       |
| Authorization | Basic Auth                                   |

The response and the common request fields are explained in [How Every API Call Works](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/how-every-api-call-works.md).

### **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, edited or deleted). 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`), separated by commas, for example `"140,143"`. Returns exactly these challans (and a short record for each one that was deleted); 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. Numbers and commas only.                                                                                                                       |
| `Doc_Num_Like`       | text   | No       | empty   | Only challans whose internal number starts with this text: `CH` followed by the challan date as `yyyyMMdd`, for example `"CH202604"`. Challan returns use the same `CH` start. 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 Vouchers](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/purchase/pull/get-purchase-vouchers.md) apply, with these differences:

* **Only purchase challans** are returned; challan returns never are (but see the known issue on deleted records).
* **Challans are not split by financial year.** Challans of every year are kept together, so `Vouch_Code` is unique on its own and is your key. `DateFrom` does not choose a year: `Doc_Codes` finds a challan of any year, and `"GlobalModifyCode": -1` considers changes of every year. The known issue about earlier-year change-log lines on Get Purchase Vouchers does **not** apply here.
* **Shared change log.** Purchase challans and purchase 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 challans: 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 found..."` and `LastGlobalModifyCode` is the value you sent. Keep this endpoint's bookmark separate from the one for Get Purchase Challan Returns.
* **Deleted challans.** When a challan in your batch, period or `Doc_Codes` has been deleted, it is returned as a short record: `Action_Code` is `"2"`, `ListItems` is an empty list, and only `Vouch_Code`, `Vouch_No`, `Vouch_Date` and `Branch_Code` are filled (`GRN_Prefix` and `GRN_Number` are filled when the challan was sent to you before with `"GlobalModifyCode": -1`, otherwise empty and `0`; every other field is empty or `0`). Remove the challan from your system. With `"GlobalModifyCode": -1`, only a deleted document that this endpoint sent you before is reported. All other challans have `Action_Code` `"0"` (added) or `"1"` (changed).
* Challans have no gate pass: `GPN_Number` and `GPN_Date` are always empty, and the lines are never repeated.
* `Qty_Scanned`, `Qty_Rejected` and `Qty_Excess` are always `0`.
* Challans use their **own API site settings**: the branches, series (GRN prefixes) and field choice your Logic ERP team set for purchase challans.

> **Known issue – a deleted challan return can appear as a deleted challan.** With a bookmark, a period or `Doc_Codes`, the short records for deleted documents are taken from the change log shared with challan returns, without checking which kind of document was deleted. A short record with `Action_Code` `"2"` can therefore be a deleted **challan return**. If you also store challan returns, look the `Vouch_Code` up among both before you remove it. With `"GlobalModifyCode": -1` this does not happen.

### **Example request**

Next batch after your stored bookmark:

```json
{
  "GlobalModifyCode": 1017516,
  "DateFrom": null,
  "DateTo": null,
  "Doc_Codes": "",
  "Branch_Codes_From": ""
}
```

Two challans by their internal numbers (a deleted one comes back as a short record):

```json
{
  "GlobalModifyCode": 0,
  "DateFrom": null,
  "DateTo": null,
  "Doc_Codes": "140,138"
}
```

### **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 Challans

> Returns your purchase challans (goods received from suppliers on a delivery challan, before the purchase bill) 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. Deleted challans are reported too.

```json
{"openapi":"3.0.3","info":{"title":"Logic ERP API","version":"1.0"},"tags":[{"name":"Purchase - Pull"}],"servers":[{"url":"https://demo.logicerp.com/api","description":"Logic ERP sandbox (test company)"}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"The user name and password of your API site."}}},"paths":{"/GetPurchaseChallan":{"post":{"tags":["Purchase - Pull"],"operationId":"GetPurchaseChallan","summary":"Get Purchase Challans","description":"Returns your purchase challans (goods received from suppliers on a delivery challan, before the purchase bill) 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. Deleted challans are reported too.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"GlobalModifyCode":{"type":"integer","description":"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":{"type":"string","nullable":true,"description":"With `GlobalModifyCode` `0`: a period of changes (the date a challan was saved, edited or deleted). Send both as `null` when you are not asking for a period. Write them as `yyyy-MM-dd`."},"DateTo":{"type":"string","nullable":true,"description":"With `GlobalModifyCode` `0`: a period of changes (the date a challan was saved, edited or deleted). Send both as `null` when you are not asking for a period. Write them as `yyyy-MM-dd`."},"Doc_Codes":{"type":"string","description":"Logic ERP's internal challan numbers (`Vouch_Code`), separated by commas, for example `\"140,143\"`. Returns exactly these challans (and a short record for each one that was deleted); the bookmark and period are ignored. Numbers and commas only."},"Branch_Codes_From":{"type":"string","description":"Branch codes separated by commas, for example `\"2,5\"`. Only challans of these branches are returned. Numbers and commas only."},"Doc_Num_Like":{"type":"string","description":"Only challans whose internal number starts with this text: `CH` followed by the challan date as `yyyyMMdd`, for example `\"CH202604\"`. Challan returns use the same `CH` start. Used with the bookmark or a period."}}}}}},"responses":{"200":{"description":"Always HTTP 200. Check Status, Message and GetData.","content":{"application/json":{"schema":{"type":"object","properties":{"GetData":{"type":"array","items":{"type":"object","properties":{"Vouch_Code":{"type":"integer","description":"Internal challan number, unique across all years."},"Vouch_No":{"type":"string","description":"The internal challan number shortened to year, `-`, month, day and serial, for example `2024-04262`."},"Vouch_Date":{"type":"string","description":"Voucher date, `dd/MM/yyyy`."},"Account_Code":{"type":"string","description":"Code of the supplier as shown in Logic ERP (`User_Code` in Get Party Master)."},"Account_Name":{"type":"string","description":"Supplier's name as kept in Logic ERP; it can include the city after padding spaces."},"Agent_Name":{"type":"string","description":"The voucher's agent, or `NIL`."},"Quantity":{"type":"number","description":"Total quantity of the voucher."},"Gross_Amount":{"type":"number","description":"Gross amount in ₹ (quantity × rate, before discounts, charges and taxes)."},"Net_Amount":{"type":"number","description":"Voucher total in ₹."},"Total_Tax":{"type":"string","description":"Total of the three tax amounts in ₹, written as text, for example `\"450\"`."},"Branch_Name":{"type":"string","description":"Name of the voucher's branch; `(NIL)` for branch `0`."},"Branch_Code":{"type":"integer","description":"Code of the voucher's branch."},"Currency_Name":{"type":"string","description":"Currency, for example `INR`."},"Bill_No":{"type":"string","description":"The supplier's challan or bill number and date."},"Bill_Date":{"type":"string","description":"The supplier's challan or bill number and date."},"GRN_Prefix":{"type":"string","description":"The challan's series prefix and number, for example `TGRN` and `79`."},"GRN_Number":{"type":"integer","description":"The challan's series prefix and number, for example `TGRN` and `79`."},"Tax_Region_Name":{"type":"string","description":"The voucher's tax region, for example `CGST/SGST` or `IGST`."},"Goods_In_Transit":{"type":"integer","description":"`1` when the voucher is marked as goods in transit, otherwise `0`."},"Action_Code":{"type":"string","description":"`\"0\"` = added, `\"1\"` = changed, `\"2\"` = deleted challan."},"Doc_Type_Desc":{"type":"string","description":"`Purchase Challan` (empty on a short record)."},"Doc_Type":{"type":"string","description":"`CH` (empty on a deleted challan's short record)."},"Gr_Number":{"type":"string","description":"Transport GR / LR number and date."},"Gr_Date":{"type":"string","description":"Transport GR / LR number and date."},"Order_No":{"type":"string","description":"Order number and date typed in the voucher's other details."},"Order_Date":{"type":"string","description":"Order number and date typed in the voucher's other details."},"Header_Remarks_1":{"type":"string","description":"Remarks typed on the voucher."},"Header_Remarks_2":{"type":"string","description":"Remarks typed on the voucher."},"Header_Remarks_3":{"type":"string","description":"Remarks typed on the voucher."},"Transport_Mode":{"type":"string","description":"Mode of transport, as typed."},"Transport_Name":{"type":"string","description":"Transporter's name as kept in the transporter master; empty when the voucher has no other details."},"Trans_ID":{"type":"string","description":"Transporter ID and services as kept in the transporter master."},"Trans_Services":{"type":"string","description":"Transporter ID and services as kept in the transporter master."},"Weight":{"type":"string","description":"Weight and number of cases, as typed."},"Cases":{"type":"string","description":"Weight and number of cases, as typed."},"GPN_Number":{"type":"string","description":"Always empty."},"GPN_Date":{"type":"string","description":"Always empty."},"ListItems":{"type":"array","items":{"type":"object","properties":{"Pur_Txn_Code":{"type":"integer","description":"Logic ERP's internal line number."},"Lot_Code":{"type":"integer","description":"Internal number of the lot (batch) received."},"Lot_Number":{"type":"string","description":"Lot number."},"AddlItemCode":{"type":"string","description":"The item's additional code, for example a barcode."},"ItemCode":{"type":"string","description":"Item code as shown in Logic ERP (`UserCode` in Get Item Master)."},"PackName":{"type":"string","description":"Pack (size) of the item."},"CF_1":{"type":"number","description":"The item's conversion factors."},"CF_2":{"type":"number","description":"The item's conversion factors."},"CF_3":{"type":"number","description":"The item's conversion factors."},"Item_Sale_Rate":{"type":"number","description":"Sale rate, purchase rate and MRP in the item master today."},"Item_Sp_Rate_1":{"type":"number","description":"Special rates 1–5 in the item master today."},"Item_Sp_Rate_2":{"type":"number","description":"Special rates 1–5 in the item master today."},"Item_Sp_Rate_3":{"type":"number","description":"Special rates 1–5 in the item master today."},"Item_Sp_Rate_4":{"type":"number","description":"Special rates 1–5 in the item master today."},"Item_Sp_Rate_5":{"type":"number","description":"Special rates 1–5 in the item master today."},"Item_Pur_Rate":{"type":"number","description":"Sale rate, purchase rate and MRP in the item master today."},"Item_MRP":{"type":"number","description":"Sale rate, purchase rate and MRP in the item master today."},"HSN_Code":{"type":"string","description":"HSN code, serial number, description and unit of the item (`(NIL)` / empty when none)."},"Quantity":{"type":"number","description":"Total quantity of the voucher."},"Lot_MRP":{"type":"number","description":"MRP of the lot."},"Rate":{"type":"number","description":"Purchase rate on the line."},"Tax_Amt_1":{"type":"number","description":"Tax amounts of slots 1 and 3, in ₹. There is no amount for slot 2. With the usual GST setup slot 1 holds CGST and slot 3 SGST or IGST."},"Tax_Amt_3":{"type":"number","description":"Tax amounts of slots 1 and 3, in ₹. There is no amount for slot 2. With the usual GST setup slot 1 holds CGST and slot 3 SGST or IGST."},"Pur_MRP":{"type":"number","description":"MRP used on the line; normally the same as `Lot_MRP`."},"Pur_Gross_Amt":{"type":"number","description":"Quantity × rate, in ₹."},"Pur_Net_Amt":{"type":"number","description":"Line total, in ₹."},"Pur_Round_Amt":{"type":"number","description":"Rounding on the line."},"Pur_Net_Rate":{"type":"number","description":"Net rate per unit."},"Gross_Pur_Amt":{"type":"number","description":"A second gross amount kept on the line; `0` on many lines. Use `Pur_Gross_Amt`."},"CD":{"type":"number","description":"Cash discount, trade discount and special cash discount amounts in ₹; a cash discount comes back as a negative amount."},"TD":{"type":"number","description":"Cash discount, trade discount and special cash discount amounts in ₹; a cash discount comes back as a negative amount."},"SP_CD":{"type":"number","description":"Cash discount, trade discount and special cash discount amounts in ₹; a cash discount comes back as a negative amount."},"Scheme_Unit":{"type":"number","description":"Scheme discount per unit and in rupees."},"Scheme_Rs":{"type":"number","description":"Scheme discount per unit and in rupees."},"Freight":{"type":"number","description":"Freight, adjustment, handling, postage and excise-per-unit amounts on the line, in ₹."},"Adjust_Item":{"type":"number","description":"Freight, adjustment, handling, postage and excise-per-unit amounts on the line, in ₹."},"Handling":{"type":"number","description":"Freight, adjustment, handling, postage and excise-per-unit amounts on the line, in ₹."},"Postage":{"type":"number","description":"Freight, adjustment, handling, postage and excise-per-unit amounts on the line, in ₹."},"ExciseUnit":{"type":"number","description":"Freight, adjustment, handling, postage and excise-per-unit amounts on the line, in ₹."},"ExcisePercentage":{"type":"number","description":"Despite its name, an amount: the market-fee charge on the line."},"CD_Per":{"type":"number","description":"The percentages of those discounts."},"TD_Per":{"type":"number","description":"The percentages of those discounts."},"SP_CD_Per":{"type":"number","description":"The percentages of those discounts."},"Tax_P_1":{"type":"number","description":"Tax rates (%) of the three tax slots of the line."},"Tax_P_2":{"type":"number","description":"Tax rates (%) of the three tax slots of the line."},"Tax_P_3":{"type":"number","description":"Tax rates (%) of the three tax slots of the line."},"Qty_Scanned":{"type":"number","description":"Quantity scanned and quantity rejected for this line in the physical verification of the voucher; `0` when not verified."},"Qty_Rejected":{"type":"number","description":"Always `0`."},"Qty_Excess":{"type":"number","description":"Always `0`."},"ItemName":{"type":"string","description":"Item name."},"ItemHDName":{"type":"string","description":"Item name with its colour, as shown in the item master."},"ColorName":{"type":"string","description":"Colour, or `(NIL)`."},"ItemDesc_1":{"type":"string","description":"Item description."},"CompanyName":{"type":"string","description":"Item's company (brand)."},"HSN_Serial_No":{"type":"string","description":"HSN code, serial number, description and unit of the item (`(NIL)` / empty when none)."},"HSN_Description":{"type":"string","description":"HSN code, serial number, description and unit of the item (`(NIL)` / empty when none)."},"HSN_UOM":{"type":"string","description":"HSN code, serial number, description and unit of the item (`(NIL)` / empty when none)."},"Packing":{"type":"string","description":"Packing description from the item master."},"Item_Group_Name_1":{"type":"string","description":"Item's group."},"LotPcsInfo":{"type":"array","items":{"type":"object"},"description":"Always an empty list here."}}},"description":"The item lines. See below."}}},"nullable":true,"description":"The records found; null when the call failed or nothing was found - read Message."},"Status":{"type":"boolean","description":"See the Status rules on this page and on How Every API Call Works."},"Message":{"type":"string","description":"Why the call failed, or a note. The reason may be followed by technical detail - read the first line."},"LastGlobalModifyCode":{"type":"integer","description":"The change-log bookmark (see How Every API Call Works)."},"resultSize":{"type":"string","description":"Size of the answer, for example \"2 KB\"."}}}}}},"401":{"description":"No login was sent."}}}}}}
```

### **Response fields**

Every field is the same as in the [response of Get Purchase Vouchers](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/purchase/pull/get-purchase-vouchers.md) (`GetData` items and `ListItems`). For a challan:

| Field                                                   | Value for a challan                                                                                  |
| ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `Vouch_Code`                                            | Internal challan number, unique across all years.                                                    |
| `Vouch_No`                                              | The internal challan number shortened to year, `-`, month, day and serial, for example `2024-04262`. |
| `Doc_Type`                                              | `CH` (empty on a deleted challan's short record).                                                    |
| `Doc_Type_Desc`                                         | `Purchase Challan` (empty on a short record).                                                        |
| `GRN_Prefix`, `GRN_Number`                              | The challan's series prefix and number, for example `TGRN` and `79`.                                 |
| `Bill_No`, `Bill_Date`                                  | The supplier's challan or bill number and date.                                                      |
| `Action_Code`                                           | `"0"` = added, `"1"` = changed, `"2"` = deleted challan.                                             |
| `GPN_Number`, `GPN_Date`                                | Always empty.                                                                                        |
| `ListItems[].Qty_Scanned`, `Qty_Rejected`, `Qty_Excess` | Always `0`.                                                                                          |

### **Example response**

A challan and a deleted challan:

```json
{
  "GetData": [
    {
      "Vouch_Code": 140,
      "Vouch_No": "2026-04262",
      "Vouch_Date": "26/04/2026",
      "Account_Code": "S2001",
      "Account_Name": "JAIPUR HANDLOOM HOUSE         -JAIPUR",
      "Agent_Name": "NIL",
      "Quantity": 10.0,
      "Gross_Amount": 4500.0,
      "Net_Amount": 4725.0,
      "Total_Tax": "225",
      "Branch_Name": "LUDHIANA MAIN",
      "Branch_Code": 2,
      "Currency_Name": "INR",
      "Bill_No": "DC-2231",
      "Bill_Date": "25/04/2026",
      "GRN_Prefix": "TGRN",
      "GRN_Number": 79,
      "Tax_Region_Name": "CGST/SGST",
      "Goods_In_Transit": 0,
      "Action_Code": "0",
      "Doc_Type_Desc": "Purchase Challan",
      "Doc_Type": "CH",
      "Gr_Number": "",
      "Gr_Date": "",
      "Order_No": "",
      "Order_Date": "",
      "Header_Remarks_1": "",
      "Header_Remarks_2": "",
      "Header_Remarks_3": "",
      "Transport_Mode": "",
      "Transport_Name": "",
      "Trans_ID": "",
      "Trans_Services": "",
      "Weight": "",
      "Cases": "",
      "GPN_Number": "",
      "GPN_Date": "",
      "ListItems": [
        {
          "Pur_Txn_Code": 512,
          "Lot_Code": 24180,
          "Lot_Number": "L-2611",
          "AddlItemCode": "8901234567029",
          "ItemCode": "KUR-1001-L",
          "PackName": "L",
          "CF_1": 1.0,
          "CF_2": 1.0,
          "CF_3": 1.0,
          "Item_Sale_Rate": 1200.0,
          "Item_Sp_Rate_1": 0.0,
          "Item_Sp_Rate_2": 0.0,
          "Item_Sp_Rate_3": 0.0,
          "Item_Sp_Rate_4": 0.0,
          "Item_Sp_Rate_5": 0.0,
          "Item_Pur_Rate": 450.0,
          "Item_MRP": 1499.0,
          "HSN_Code": "62113990",
          "Quantity": 10.0,
          "Lot_MRP": 1499.0,
          "Rate": 450.0,
          "Tax_Amt_1": 112.5,
          "Tax_Amt_3": 112.5,
          "Pur_MRP": 1499.0,
          "Pur_Gross_Amt": 4500.0,
          "Pur_Net_Amt": 4725.0,
          "Pur_Round_Amt": 0.0,
          "Pur_Net_Rate": 450.0,
          "Gross_Pur_Amt": 4500.0,
          "CD": 0.0,
          "TD": 0.0,
          "SP_CD": 0.0,
          "Scheme_Unit": 0.0,
          "Scheme_Rs": 0.0,
          "Freight": 0.0,
          "Adjust_Item": 0.0,
          "Handling": 0.0,
          "Postage": 0.0,
          "ExciseUnit": 0.0,
          "ExcisePercentage": 0.0,
          "CD_Per": 0.0,
          "TD_Per": 0.0,
          "SP_CD_Per": 0.0,
          "Tax_P_1": 2.5,
          "Tax_P_2": 0.0,
          "Tax_P_3": 2.5,
          "Qty_Scanned": 0.0,
          "Qty_Rejected": 0.0,
          "Qty_Excess": 0.0,
          "ItemName": "COTTON KURTA",
          "ItemHDName": "COTTON KURTA BLUE",
          "ColorName": "BLUE",
          "ItemDesc_1": "Cotton kurta, straight fit",
          "CompanyName": "SHREE GANESH",
          "HSN_Serial_No": "62113990",
          "HSN_Description": "GARMENTS OF COTTON",
          "HSN_UOM": "PCS-PIECES",
          "Packing": "PCS",
          "Item_Group_Name_1": "KURTA",
          "LotPcsInfo": []
        }
      ]
    },
    {
      "Vouch_Code": 138,
      "Vouch_No": "2026-04251",
      "Vouch_Date": "25/04/2026",
      "Account_Code": "",
      "Account_Name": "",
      "Agent_Name": "",
      "Quantity": 0.0,
      "Gross_Amount": 0.0,
      "Net_Amount": 0.0,
      "Total_Tax": "",
      "Branch_Name": "",
      "Branch_Code": 2,
      "Currency_Name": "",
      "Bill_No": "",
      "Bill_Date": "",
      "GRN_Prefix": "",
      "GRN_Number": 0,
      "Tax_Region_Name": "",
      "Goods_In_Transit": 0,
      "Action_Code": "2",
      "Doc_Type_Desc": "",
      "Doc_Type": "",
      "Gr_Number": "",
      "Gr_Date": "",
      "Order_No": "",
      "Order_Date": "",
      "Header_Remarks_1": "",
      "Header_Remarks_2": "",
      "Header_Remarks_3": "",
      "Transport_Mode": "",
      "Transport_Name": "",
      "Trans_ID": "",
      "Trans_Services": "",
      "Weight": "",
      "Cases": "",
      "GPN_Number": "",
      "GPN_Date": "",
      "ListItems": []
    }
  ],
  "Status": true,
  "Message": "",
  "LastGlobalModifyCode": 1026771,
  "resultSize": "4 KB"
}
```

### **Messages you may see**

| Message                                                                             | Meaning                                                                                                                                                                           | What to do                                                                                            |
| ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| *No Pending Purchase 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 purchase challan matched: the batch held only challan returns or challans outside your filters, nothing in the period was a challan, or the numbers you sent are not challans. | 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`.                                                   |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/purchase/pull/get-purchase-challans.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
