> 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/push/save-a-purchase-challan.md).

# Save a Purchase Challan

Creates a **purchase challan** in Logic ERP: a goods receipt for goods that arrive from a supplier **before the supplier's bill**, usually with the supplier's delivery challan. The goods are **added to your branch's stock** at once, in lots, and get a **GRN number**. A purchase challan is not a purchase bill: it is kept with the challans, not with the year's purchase vouchers, and the bill is raised later against it.

### **Endpoint**

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

The response envelope, branches, dates and the common messages 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).

Send one challan per request. Field names are matched without regard to upper/lower case; fields not listed below are ignored. Do not send `null` for `LstItems`.

### **Where a purchase challan fits**

* **Goods first, bill later.** This endpoint receives the goods. When the supplier's bill arrives, raise the purchase bill against the challan with [Save a Purchase Voucher Against a Purchase Challan](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/purchase/push/save-a-purchase-voucher-against-a-purchase-challan.md), sending this challan's `LastSavedCode` as `Challan_Code`.
* **Sending goods back.** Goods returned to the supplier before billing are sent back with [Save a Purchase Challan Return](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/purchase/push/save-a-purchase-challan-return.md).
* **Reading it back.** Saved challans are returned by [Get Purchase Challans](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/purchase/pull/get-purchase-challans.md); send `LastSavedCode` in `Doc_Codes` to fetch this one.

### **How it differs from Save a Purchase Voucher**

The request has the same fields as [Save a Purchase Voucher](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/purchase/push/save-a-purchase-voucher.md). The differences:

* The document is a **challan**, not a purchase bill. It is kept with the purchase challans, apart from the purchase vouchers, and has its own numbering.
* This endpoint always uses Logic ERP's **import save routine**. Save a Purchase Voucher can be switched by your Logic ERP team to a routine that drives the purchase screen; this one cannot.
* **`LotNo` is optional.** Without it the lot number is the first 24 characters of `Bill_No`. (On Save a Purchase Voucher with the import routine a lot number is required on every line.)
* Your API site has **separate settings** for this endpoint: the default purchase-challan series, the default godown and the duplicate bill-number check. Goods-in-transit does not apply to challans.
* A `Bill_No` already used is checked against the supplier's **purchase challans and purchase challan returns**, not against purchase bills.

### **Request fields**

| Field                                                                                                                                             | Type         | Required | Default                            | Meaning                                                                                                                                                                                                                                                                                                            |
| ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `AccountCode`                                                                                                                                     | text         | **Yes**  | –                                  | The supplier's **party code** (`User_Code` in [Get Party Master](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/pull/get-party-master.md)). Must already exist. The tax region, credit days, transporter and default discounts are taken from this account. |
| `SupplierCode`                                                                                                                                    | text         | No       | `AccountCode`                      | A different party code for the supplier of the goods, when the account is someone else. Must exist. Usually left out.                                                                                                                                                                                              |
| `BranchCode`                                                                                                                                      | number       | No       | `0`                                | The branch receiving the goods, by Logic ERP's branch number (`Branch_Code` in [Get Branch Info](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/pull/get-branch-info.md)).                                                                                  |
| `BranchShortName`                                                                                                                                 | text         | No       | empty                              | The branch by its short name; used only when `BranchCode` is `0`. With neither, Logic ERP falls back to a default branch – always send one.                                                                                                                                                                        |
| `Bill_No`                                                                                                                                         | text         | No\*     | empty                              | The supplier's bill or delivery-challan number. \*Required when your API site checks duplicate supplier bills. Also becomes the lot number when `LotNo` is empty, and is stored on the lots as their bill number.                                                                                                  |
| `InvoiceDate`                                                                                                                                     | date         | No       | today                              | Date of the challan (the goods-receipt date), `yyyy-MM-dd`. See the rules on dates.                                                                                                                                                                                                                                |
| `Bill_Date`                                                                                                                                       | date         | No       | `InvoiceDate`                      | Date of the supplier's bill / challan; also the lots' purchase date.                                                                                                                                                                                                                                               |
| `PartyBillDate`                                                                                                                                   | date         | No       | `InvoiceDate`                      | Party bill date stored on the challan.                                                                                                                                                                                                                                                                             |
| `Godown_Name`                                                                                                                                     | text         | No       | API site default godown            | Godown the goods go into, by name. Must exist.                                                                                                                                                                                                                                                                     |
| `GRN_Prefix`                                                                                                                                      | text         | No       | the series' GRN prefix, else `GRN` | Prefix of the GRN number. The number itself is always the next free number.                                                                                                                                                                                                                                        |
| `GR_Number`, `GR_Date`                                                                                                                            | text, date   | No       | empty                              | Transporter's LR / GR number and date; `GR_Date` is used when it is a date. A separate field `GRDate`, when sent as a date, takes priority over `GR_Date`.                                                                                                                                                         |
| `GPN_No`, `GPN_Date`                                                                                                                              | text, date   | No       | empty                              | Gate pass number and date. `GPN_Date` must be a date when `GPN_No` is sent.                                                                                                                                                                                                                                        |
| `OrderNo`, `OrderDate`                                                                                                                            | text, date   | No       | empty                              | Your purchase order reference and its date.                                                                                                                                                                                                                                                                        |
| `ChallanNo`, `ChallanDate`                                                                                                                        | text, date   | No       | empty                              | A further challan reference and date, stored only.                                                                                                                                                                                                                                                                 |
| `PU_Remarks_1`                                                                                                                                    | text         | No       | empty                              | Remarks.                                                                                                                                                                                                                                                                                                           |
| `PU_Remarks_2`, `PU_Remarks_3`                                                                                                                    | text         | No       | empty                              | Remarks.                                                                                                                                                                                                                                                                                                           |
| `AgentName`                                                                                                                                       | text         | No       | none                               | Agent, by name. Must exist.                                                                                                                                                                                                                                                                                        |
| `TransporterName`                                                                                                                                 | text         | No       | the supplier's transporter         | Transporter, by name. Must exist.                                                                                                                                                                                                                                                                                  |
| `CostCenter`                                                                                                                                      | text         | No       | none                               | Cost centre, by name. Must exist.                                                                                                                                                                                                                                                                                  |
| `CurrencyName`, `ExchangeRate`                                                                                                                    | text, number | No       | empty, `1`                         | Foreign currency by name (must exist) and its rate; the rate is used when more than `0`.                                                                                                                                                                                                                           |
| `CreditDays`                                                                                                                                      | number       | No       | the supplier's payment terms       | Used when more than `0`.                                                                                                                                                                                                                                                                                           |
| `Freight`, `Adjustment_Rs`, `SpDiscountRs`                                                                                                        | number       | No       | `0`                                | Freight, adjustment and special discount in ₹ for the whole challan; used when more than `0` and spread over the lines.                                                                                                                                                                                            |
| `CD_P`, `TD_P`, `SP_CD`, `SchemeRs`, `AdjustUnit`                                                                                                 | number       | No       | `0`                                | See the known issue on bill-level discounts.                                                                                                                                                                                                                                                                       |
| `TransportMode`, `VehicleNo`, `Cases`, `Weight`, `PVTMark`, `Insurance_Policy_No`, `Declaration_No`, `DeliveryAt`, `DeliveryAdd1`, `DeliveryAdd2` | text         | No       | empty                              | Transport, packing and delivery details, stored on the challan.                                                                                                                                                                                                                                                    |
| `Series_Code`                                                                                                                                     | number       | No\*     | –                                  | Logic ERP's internal number of a purchase series. \*Used only when your API site has **no** default series for this endpoint; otherwise ignored. Ask your Logic ERP team for the number.                                                                                                                           |
| `LstItems`                                                                                                                                        | list         | **Yes**  | –                                  | The goods received. See below. `ListItems` is accepted as another name.                                                                                                                                                                                                                                            |
| `DisplayError`                                                                                                                                    | text         | No       | `"0"`                              | `"1"` = full technical error text in `Message` when something fails.                                                                                                                                                                                                                                               |
| `Doc_Type`                                                                                                                                        | text         | No       | `"PU"`                             | Leave it out. Any value other than `PU` or `PR` stops the reverse-charge flag from being taken from the tax region.                                                                                                                                                                                                |
| `Challan_Code`                                                                                                                                    | number       | No       | `0`                                | Leave it out. A value above `0` is refused: this endpoint does not save a return against a challan return.                                                                                                                                                                                                         |
| `Request_ID`, `EntrySource`, `DNO_Code`, `PO_Code`                                                                                                | –            | No       | –                                  | **Ignored** by this endpoint.                                                                                                                                                                                                                                                                                      |

**`LstItems`**

| Field                                           | Type   | Required                 | Default                          | Meaning                                                                                                                                                                                                |
| ----------------------------------------------- | ------ | ------------------------ | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `LogicUser_Code`                                | text   | Yes, or `AddlItemCode`   | empty                            | The **item code** shown in Logic ERP (`UserCode` in [Get Item Master](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/pull/get-item-master.md)). |
| `AddlItemCode`                                  | text   | Yes, or `LogicUser_Code` | empty                            | The item's additional code / barcode; used when `LogicUser_Code` is empty or not found.                                                                                                                |
| `ScannedQty`                                    | number | **Yes**                  | –                                | Quantity received; more than `0`.                                                                                                                                                                      |
| `BasicRate`                                     | number | No                       | `0`                              | Rate per unit in ₹ used for the line amount (before discounts and taxes).                                                                                                                              |
| `PurRate`                                       | number | No                       | `0`                              | Purchase rate per unit for the lot.                                                                                                                                                                    |
| `SaleRate`                                      | number | No                       | `0`                              | Sale rate per unit for the lot. See the known issue on lot rates.                                                                                                                                      |
| `Lot_Mrp`                                       | number | No                       | `0`                              | MRP per unit for the lot.                                                                                                                                                                              |
| `SP_Rate_1` … `SP_Rate_5`                       | number | No                       | `0`                              | Special rates 1 to 5 for the lot.                                                                                                                                                                      |
| `LotNo`                                         | text   | No                       | first 24 characters of `Bill_No` | Lot (batch) number for the goods. See the rules on lots.                                                                                                                                               |
| `Production_Unit`                               | text   | No                       | empty                            | Production unit of the lot. Added to the lot number as \`LotNo                                                                                                                                         |
| `Expiry_Date`, `MFG_Date`                       | date   | No                       | empty                            | Expiry and manufacturing dates for the lot; used when they are dates.                                                                                                                                  |
| `ItemDescription`                               | text   | No                       | empty                            | Description for the line.                                                                                                                                                                              |
| `Godown_Code`                                   | number | No                       | `0`                              | Logic ERP's internal number of a godown for this line only. `0` = the challan's godown. Must exist.                                                                                                    |
| `LotCode`, `Lot_Bill_No`, `Org_Production_Unit` | –      | No                       | –                                | **Ignored** by this endpoint (the lot always gets `Bill_No` as its bill number).                                                                                                                       |

### **Rules Logic ERP applies**

**Supplier, branch and series**

* The supplier is found by its party code. It must be a customer, supplier or cash account; any other account (bank, expense and so on) is refused. The same applies to `SupplierCode` when sent.
* The series is your API site's **default series for purchase challans**. If none is set, `Series_Code` is used; with neither the request fails.
* The branch is `BranchCode`, else `BranchShortName`.

**Dates and financial year**

* The challan is saved in the **financial year `InvoiceDate` falls in** (today's year when it is left out), also an earlier year. A date that no financial year in Logic ERP covers is refused with `No financial year covers the date dd/MM/yyyy.`
* `InvoiceDate` is the challan date. Left out, it is today. A date after today is refused unless your Logic ERP user may enter post-dated purchase documents; a date in a period locked for entry is refused.
* `Bill_Date` and `PartyBillDate` default to `InvoiceDate`. If the series dates purchases by the supplier's bill date, `Bill_Date` must also fall in the challan's financial year.

**Lots and stock**

* Each line adds stock to a lot of the item in the branch and godown. The lot number is `LotNo`, else the first 24 characters of `Bill_No` – send at least one of them.
* Whether an existing lot with the same item and number is added to, or a new lot is created, depends on how the series keeps lots (set in Logic ERP). When an existing lot is used, its purchase date, supplier and bill number are updated from this challan.
* Godown: the line's `Godown_Code`, else `Godown_Name`, else your API site's default godown.

**Taxes and amounts**

* The **tax region comes only from the supplier**: the account's tax region for this branch, else the account's own tax region (when `SupplierCode` is sent, that party's tax region for this branch takes priority). No request field can supply one, and the series' default tax region is not used. Taxes are then worked out per item from that region.
* The line amount is `ScannedQty` × `BasicRate`. `Freight`, `Adjustment_Rs` and `SpDiscountRs` are spread over the lines. The supplier's default CD %, TD % and special CD % in Logic ERP are applied to every line.
* GST checks run before saving: the supplier's GST state against the tax region (for example an IGST region for a supplier in your own state is refused), and the GST accounts linked to the taxes.

**Duplicates**

* If your API site checks duplicate supplier bills, `Bill_No` must not be empty and must not already be on a purchase challan or purchase challan return – of this supplier and branch, of this supplier, or of anyone, depending on the setting.
* In every case Logic ERP also refuses a `Bill_No` already used on a purchase challan or purchase challan return of the **same supplier in the same branch** (matched without regard to case).

**Saving**

* The challan is saved in one step; on any failure nothing is saved.
* This endpoint's settings, including whether it is switched off, are read for the whole API site, not per branch. For what a switched-off endpoint answers, see How Every API Call Works.

> **Known issue – a supplier without a tax region cannot be used.** If neither the supplier's branch tax region nor its own tax region is set, the request fails with *Default Tax Region not Set.Please Check....* even when the series has a default tax region. Set the supplier's tax region in Logic ERP first.

> **Known issue – bill-level discounts.** `CD_P`, `TD_P`, `SP_CD`, `SchemeRs` and `AdjustUnit` do not change the amounts; the lines take the supplier's default discounts. Send the net rate in `BasicRate` instead.

> **Known issue – lot rates.** On a test run, a challan saved with `SaleRate` 3099 and `BasicRate` 100 showed the lot's sale rate and basic rate as `0` in Get Stock In Hand, while the MRP was kept. Do not rely on lot rates being stored as sent; check them in Logic ERP.

> **Apostrophes in codes and names.** Party codes, item codes, godown, agent, transporter, cost centre and currency names may contain an apostrophe (`'`), for example `D'SOUZA`. Leave apostrophes out of `Bill_No` and `GRN_Prefix`: Logic ERP's own purchase routine also uses them.

### **Example request**

```json
{
  "BranchCode": 2,
  "AccountCode": "S0142",
  "Bill_No": "DC-5521",
  "Bill_Date": "2026-10-28",
  "InvoiceDate": "2026-10-30",
  "Godown_Name": "MAIN",
  "OrderNo": "PO-2026-118",
  "GR_Number": "LR-77412",
  "GR_Date": "2026-10-28",
  "VehicleNo": "TN09AB4521",
  "PU_Remarks_2": "Received against delivery challan",
  "LstItems": [
    { "LogicUser_Code": "SHRT-BLU-M", "ScannedQty": 24, "BasicRate": 450.00, "PurRate": 450.00, "SaleRate": 899.00, "Lot_Mrp": 999.00, "LotNo": "DC5521-01" },
    { "LogicUser_Code": "KRT-WHT-L", "ScannedQty": 12, "BasicRate": 380.00, "PurRate": 380.00, "SaleRate": 749.00, "Lot_Mrp": 799.00, "LotNo": "DC5521-02" }
  ]
}
```

### **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**. This really saves in the sandbox, so use test values like the example. Each send creates one more test challan of the sandbox's test item `APITEST0001`.

## Save a Purchase Challan

> Creates a purchase challan in Logic ERP: a goods receipt for goods that arrive from a supplier before the supplier's bill, usually with the supplier's delivery challan. The goods are added to your branch's stock at once, in lots, and get a GRN number. A purchase challan is not a purchase bill: it is kept with the challans, not with the year's purchase vouchers, and the bill is raised later against it.

```json
{"openapi":"3.0.3","info":{"title":"Logic ERP API","version":"1.0"},"tags":[{"name":"Purchase - Push"}],"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":{"/SavePurchaseChallan":{"post":{"tags":["Purchase - Push"],"operationId":"SavePurchaseChallan","summary":"Save a Purchase Challan","description":"Creates a purchase challan in Logic ERP: a goods receipt for goods that arrive from a supplier before the supplier's bill, usually with the supplier's delivery challan. The goods are added to your branch's stock at once, in lots, and get a GRN number. A purchase challan is not a purchase bill: it is kept with the challans, not with the year's purchase vouchers, and the bill is raised later against it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"BranchCode":{"type":"integer","description":"The branch receiving the goods, by Logic ERP's branch number (`Branch_Code` in Get Branch Info)."},"AccountCode":{"type":"string","description":"The supplier's party code (`User_Code` in Get Party Master). Must already exist. The tax region, credit days, transporter and default discounts are taken from this account."},"Bill_No":{"type":"string","description":"The supplier's bill or delivery-challan number. *Required when your API site checks duplicate supplier bills. Also becomes the lot number when `LotNo` is empty, and is stored on the lots as their bill number."},"Bill_Date":{"type":"string","description":"Date of the supplier's bill / challan; also the lots' purchase date."},"PartyBillDate":{"type":"string","description":"Party bill date stored on the challan."},"InvoiceDate":{"type":"string","description":"Date of the challan (the goods-receipt date), `yyyy-MM-dd`. See the rules on dates."},"Godown_Name":{"type":"string","description":"Godown the goods go into, by name. Must exist."},"OrderNo":{"type":"string","description":"Your purchase order reference and its date."},"PU_Remarks_2":{"type":"string","description":"Remarks."},"LstItems":{"type":"array","items":{"type":"object","properties":{"LogicUser_Code":{"type":"string","description":"The item code shown in Logic ERP (`UserCode` in Get Item Master)."},"ScannedQty":{"type":"integer","description":"Quantity received; more than `0`."},"BasicRate":{"type":"integer","description":"Rate per unit in ₹ used for the line amount (before discounts and taxes)."},"PurRate":{"type":"integer","description":"Purchase rate per unit for the lot."},"SaleRate":{"type":"integer","description":"Sale rate per unit for the lot. See the known issue on lot rates."},"Lot_Mrp":{"type":"integer","description":"MRP per unit for the lot."},"LotNo":{"type":"string","description":"Lot (batch) number for the goods. See the rules on lots."},"ItemDescription":{"type":"string","description":"Description for the line."}}},"description":"The goods received. See below. `ListItems` is accepted as another name."}}}}}},"responses":{"200":{"description":"Always HTTP 200. Check Status and Message.","content":{"application/json":{"schema":{"type":"object","properties":{"LastSavedDocNo":{"type":"string","description":"The challan's GRN number, GRN prefix and number joined by `-`, for example `GRN-10041` (`GRN_Prefix` and `GRN_Number` in Get Purchase Challans). This is not the voucher number (`Vouch_No`). `null` when nothing was saved."},"Status":{"type":"boolean","description":"`true` = the challan was saved."},"Message":{"type":"string","description":"Why it failed; empty on success."},"LastSavedCode":{"type":"integer","description":"Logic ERP's internal number of the challan. Send it as `Challan_Code` to bill the challan, or in `Doc_Codes` to read it back."},"request_ID":{"type":"string","description":"The ID of this request – quote it to support."}}}}}},"401":{"description":"No login was sent."}}}}}}
```

### **Response**

| Field            | Type         | Meaning                                                                                                                                                                                                                      |
| ---------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Status`         | true / false | `true` = the challan was saved.                                                                                                                                                                                              |
| `Message`        | text         | Why it failed; empty on success.                                                                                                                                                                                             |
| `LastSavedCode`  | number       | Logic ERP's internal number of the challan. Send it as `Challan_Code` to bill the challan, or in `Doc_Codes` to read it back.                                                                                                |
| `LastSavedDocNo` | text         | The challan's GRN number, GRN prefix and number joined by `-`, for example `GRN-10041` (`GRN_Prefix` and `GRN_Number` in Get Purchase Challans). This is not the voucher number (`Vouch_No`). `null` when nothing was saved. |
| `request_ID`     | text         | The ID of this request – quote it to support.                                                                                                                                                                                |

### **Example response**

```json
{
  "LastSavedDocNo": "GRN-10041",
  "Status": true,
  "Message": "",
  "LastSavedCode": 1423,
  "request_ID": "3c9e2b71-5d4a-4f0e-9b62-8a1f7c0d2e95"
}
```

### **Messages you may see**

All with `Status: false`. Text in `…` is replaced by the value concerned. Messages marked † arise while the challan is being built and saved: they come with technical text before and after the reason – look for the sentence. With `"DisplayError": "1"` every message carries technical detail – read the first line.

| Message                                                                                                                                                                                                                                                                                                                                                                                      | Meaning                                                                                          | What to do                                                            |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------- |
| `Default Configuration Not Defined in API Template`                                                                                                                                                                                                                                                                                                                                          | No default series for this endpoint and no `Series_Code`.                                        | Ask your Logic ERP team to set the default purchase-challan series.   |
| `Account Code Not Defined...`, `Invalid Account User Code...`                                                                                                                                                                                                                                                                                                                                | `AccountCode` is empty or not found.                                                             | Send an existing party code.                                          |
| `Invalid Supplier Code Defined...`                                                                                                                                                                                                                                                                                                                                                           | `SupplierCode` not found.                                                                        | Send an existing party code, or leave it out.                         |
| `Invalid Invoice Date Defined...`, `Invalid Bill Date...`, `Invalid Party Bill Date...`                                                                                                                                                                                                                                                                                                      | A date that is not a date.                                                                       | Send `yyyy-MM-dd`.                                                    |
| `Post Dated enteries are not allowed.......`                                                                                                                                                                                                                                                                                                                                                 | `InvoiceDate` is after today.                                                                    | Send today or an earlier date.                                        |
| `Entry/Modification is locked for this period....`, `Modification rights not available for this date.....` †                                                                                                                                                                                                                                                                                 | The date falls in a period locked for entry.                                                     | Use a date in an open period, or ask the Logic ERP user to unlock it. |
| `No financial year covers the date …`                                                                                                                                                                                                                                                                                                                                                        | No financial year in Logic ERP covers `InvoiceDate`.                                             | Send a date inside a financial year of Logic ERP.                     |
| `Invoice Date Date not within financial year.Please Check....`                                                                                                                                                                                                                                                                                                                               | `InvoiceDate` falls outside the financial year the challan is being saved in.                    | Check the date.                                                       |
| `Bill Date not Within Financial Year` †                                                                                                                                                                                                                                                                                                                                                      | The series dates purchases by bill date and `Bill_Date` is outside the challan's financial year. | Send a `Bill_Date` in the same financial year as `InvoiceDate`.       |
| `Account Code : … is not a Customer / Supplier / Cash account..Please Check...`                                                                                                                                                                                                                                                                                                              | `AccountCode` or `SupplierCode` is not a customer, supplier or cash account.                     | Send the supplier's party code.                                       |
| `Challan_Code is not supported on this route. A purchase return against a challan return is not supported here..Please Check...`                                                                                                                                                                                                                                                             | `Challan_Code` was sent with a value above `0`.                                                  | Leave `Challan_Code` out.                                             |
| `Bill No can't be blank...`                                                                                                                                                                                                                                                                                                                                                                  | Duplicate checking is on and `Bill_No` is empty.                                                 | Send the supplier's bill number.                                      |
| `Bill No:… already exists for current supplier and current Branch`, `Bill No:… already exists for current supplier..`, `Bill No:… already exists.`                                                                                                                                                                                                                                           | Your API site's duplicate check found the number.                                                | Send the right bill number; do not resend a challan already saved.    |
| `Bill No:… already exists for this supplier... Cannot Continue.` †                                                                                                                                                                                                                                                                                                                           | The number is already on a challan or challan return of this supplier in this branch.            | As above.                                                             |
| `Logic User Code/Additional Item Code Not Defined for Item No : …`                                                                                                                                                                                                                                                                                                                           | A line has neither item code.                                                                    | Send `LogicUser_Code` or `AddlItemCode`.                              |
| `Invalid LogicUserCode / EANCode : …`                                                                                                                                                                                                                                                                                                                                                        | The item code was not found.                                                                     | Check the code with Get Item Master.                                  |
| `Quantity Not Defined For : '…' Item No : …`                                                                                                                                                                                                                                                                                                                                                 | `ScannedQty` is `0` or less on that line; the item code sent is shown.                           | Send a positive quantity.                                             |
| `Unable to Find Items for Import...` †                                                                                                                                                                                                                                                                                                                                                       | `LstItems` is empty or missing.                                                                  | Send at least one line.                                               |
| `Item Details Not Defined...`                                                                                                                                                                                                                                                                                                                                                                | `LstItems` was sent as `null`.                                                                   | Send the item list.                                                   |
| `Invalid Godown Name […]. Please Check...`                                                                                                                                                                                                                                                                                                                                                   | `Godown_Name` not found.                                                                         | Use a godown name from Logic ERP.                                     |
| `Error Finding Godown...…` †                                                                                                                                                                                                                                                                                                                                                                 | A line's `Godown_Code` does not exist.                                                           | Send an existing godown, or `0`.                                      |
| `Default Tax Region not Set.Please Check....`                                                                                                                                                                                                                                                                                                                                                | The supplier has no tax region.                                                                  | See the known issue.                                                  |
| `Party GST State and Company/Branch GST State cannot be same for IGST. Please check.`, `Party GST State and Company/Branch GST State cannot be different for CGST/SGST. Please check.`, `GST State not defined for this party. Please check.`, `Party GSTN State Code and GST State Code do not match . Please check.`, `Export/SEZ Party cannot be billed under CGST/SGST. Please check.` † | The supplier's GST details do not suit its tax region.                                           | Correct the supplier's GST state or tax region in Logic ERP.          |
| `Invalid CGST/SGST accounts linked. Please check.`, `Invalid IGST accounts linked. Please check.`, `Invalid GST accounts linked. Please check.` † (may be followed by `Row No.:…`)                                                                                                                                                                                                           | The tax accounts set up for the taxes do not match the GST type.                                 | Ask your Logic ERP team to correct the tax set-up.                    |
| `Please set Default Tax Type before import this document.......` †                                                                                                                                                                                                                                                                                                                           | The series works taxes for the whole bill and has no default tax type.                           | Ask your Logic ERP team to set it.                                    |
| `Purchase / Tax Details not found for all Items. Check Row No.: …` †                                                                                                                                                                                                                                                                                                                         | No purchase tax was found for an item in the supplier's tax region.                              | Set the item's tax group / HSN in Logic ERP.                          |
| `Invalid Agent […] .Please Check`, `Unable to found Cost Center […] .Please Check` †, `Transporter Name [ … ] not found. Please Check...` †, `Currency Name [ … ] not found. Please Check...` †                                                                                                                                                                                              | A name sent does not exist.                                                                      | Use the name exactly as in Logic ERP.                                 |
| `Invalid GPN_Date .Please Check` †                                                                                                                                                                                                                                                                                                                                                           | `GPN_No` sent without a valid `GPN_Date`.                                                        | Send both.                                                            |
| `Blank GRN Number not allowed..` †                                                                                                                                                                                                                                                                                                                                                           | No GRN number could be given.                                                                    | Contact support with the `request_ID`.                                |
| `This document date is before/equal to Last Physical Stock Entry Date:…` †                                                                                                                                                                                                                                                                                                                   | The branch's stock is locked up to a physical stock date.                                        | Use a later date.                                                     |
| `Error while saving voucher` †                                                                                                                                                                                                                                                                                                                                                               | The save was stopped by a check inside Logic ERP.                                                | Contact support with the `request_ID`.                                |


---

# 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/push/save-a-purchase-challan.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.
