> 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/orders/push/save-a-purchase-voucher-against-a-purchase-order.md).

# Save a Purchase Voucher Against a Purchase Order

Records the goods received against a **purchase order** that is already in Logic ERP and bills them as a **purchase voucher** (goods receipt / GRN) posted to the order's supplier. You send the order's internal number and the items, lots and quantities received; Logic ERP takes the supplier, the purchase rate and the taxes from the order, creates the lines and takes the received quantity off the order's pending quantity, so the rest can be received later.

To record a purchase **without** an order, use [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). To create the order itself, use [Save a Purchase Order](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/orders/push/save-a-purchase-order.md).

### **Endpoint**

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

The response envelope, branches, dates, queueing 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).

### **Request fields**

The request has the same shape 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), but this endpoint reads only the fields below and treats several of them differently. Field names are not case-sensitive. Codes and names are matched as you send them – spaces around them are not trimmed (only `TransporterName` and `CurrencyName` are trimmed).

| Field                                                                                                                                   | Type                   | Required                   | Default                                            | Meaning                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | -------------------------- | -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `PO_Code`                                                                                                                               | number                 | Yes                        | `0`                                                | Logic ERP's internal number of the purchase order – the `LastSavedCode` you got from Save a Purchase Order, or `Vouch_Code` in [Get Purchase Orders](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/orders/pull/get-purchase-orders.md). One order per request. The **supplier** of the voucher is the order's supplier. |
| `BranchCode`                                                                                                                            | number                 | Yes (or `BranchShortName`) | `0`                                                | The branch the voucher is saved in (as explained in How Every API Call Works). It must be the order's branch – see the rules.                                                                                                                                                                                                                                           |
| `BranchShortName`                                                                                                                       | text                   | No                         | empty                                              | The branch's short name, used only when `BranchCode` is `0`.                                                                                                                                                                                                                                                                                                            |
| `InvoiceDate`                                                                                                                           | date                   | No                         | today                                              | The **voucher date**, `yyyy-MM-dd`. Must fall in the current financial year.                                                                                                                                                                                                                                                                                            |
| `Bill_No`                                                                                                                               | text                   | No                         | empty                                              | The supplier's bill (invoice) number.                                                                                                                                                                                                                                                                                                                                   |
| `Bill_Date`                                                                                                                             | date                   | No                         | `InvoiceDate`                                      | The supplier's bill date, `yyyy-MM-dd`.                                                                                                                                                                                                                                                                                                                                 |
| `PartyBillDate`                                                                                                                         | date                   | No                         | `InvoiceDate`                                      | The party bill date, `yyyy-MM-dd`.                                                                                                                                                                                                                                                                                                                                      |
| `GRN_Prefix`                                                                                                                            | text                   | No                         | `GRN`                                              | Prefix of the goods receipt (GRN) number. The voucher gets the next GRN number for that prefix.                                                                                                                                                                                                                                                                         |
| `LstItems`                                                                                                                              | list                   | Yes                        | empty list                                         | The items, lots and quantities received – see below. `ListItems` is accepted as another name for the same list.                                                                                                                                                                                                                                                         |
| `Godown_Name`                                                                                                                           | text                   | No                         | the item's default godown                          | The godown all lines are received into, by name exactly as in Logic ERP. A godown set as **Default Godown** in your API site's settings for this endpoint takes priority. A name that does not exist stops the request.                                                                                                                                                 |
| `SupplierCode`                                                                                                                          | text                   | No                         | the order's supplier                               | A party code. When sent, it must be the order's supplier; any other party is refused. Leave it out.                                                                                                                                                                                                                                                                     |
| `PU_Remarks_1`, `PU_Remarks_2`, `PU_Remarks_3`                                                                                          | text                   | No                         | empty                                              | Remarks 1 to 3 of the voucher.                                                                                                                                                                                                                                                                                                                                          |
| `OrderNo`, `GR_Number`                                                                                                                  | text                   | No                         | empty                                              | Order number and transport GR (lorry receipt) number.                                                                                                                                                                                                                                                                                                                   |
| `GRDate`, `OrderDate`, `ChallanNo`, `ChallanDate`                                                                                       | date, date, text, date | No                         | none                                               | Used when sent. Dates `yyyy-MM-dd`; a date that cannot be read is ignored.                                                                                                                                                                                                                                                                                              |
| `PVTMark`, `Insurance_Policy_No`, `Declaration_No`, `Cases`, `TransportMode`, `DeliveryAt`, `DeliveryAdd1`, `DeliveryAdd2`, `VehicleNo` | text                   | No                         | none                                               | Used when sent (not empty).                                                                                                                                                                                                                                                                                                                                             |
| `AgentName`                                                                                                                             | text                   | No                         | none                                               | An agent / broker, by name exactly as in Logic ERP. Saved on the voucher; a name that is not found stops the request.                                                                                                                                                                                                                                                   |
| `CostCenter`                                                                                                                            | text                   | No                         | none                                               | A cost centre, by name exactly as in Logic ERP.                                                                                                                                                                                                                                                                                                                         |
| `TransporterName`                                                                                                                       | text                   | No                         | none                                               | A transporter, by name as in Logic ERP.                                                                                                                                                                                                                                                                                                                                 |
| `CurrencyName`, `ExchangeRate`                                                                                                          | text, number           | No                         | none, `1`                                          | A currency by name, and its exchange rate (used only when above `0`).                                                                                                                                                                                                                                                                                                   |
| `CD_P`, `TD_P`, `SP_CD`, `SchemeRs`, `Freight`, `Adjustment_Rs`, `SpDiscountRs`, `AdjustUnit`, `CreditDays`                             | number                 | No                         | none (credit days: from the order's payment terms) | Document-level discounts, charges and credit days. Only values above `0` are used.                                                                                                                                                                                                                                                                                      |
| `DisplayError`                                                                                                                          | text                   | No                         | `"0"`                                              | `"1"` = when the request fails, `Message` holds the full technical detail. Use only while testing.                                                                                                                                                                                                                                                                      |

**`LstItems` – one entry per item (and lot) received**

| Field                              | Type   | Required                                   | Default                                                                                     | Meaning                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------------------- | ------ | ------------------------------------------ | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `LogicUser_Code`                   | text   | One of the two                             | 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   | One of the two                             | empty                                                                                       | The additional item code / barcode. Used only when `LogicUser_Code` is empty.                                                                                                                                                                                                                                                                                        |
| `ScannedQty`                       | number | Yes                                        | `0`                                                                                         | Quantity received. Must be above `0` and not more than the item's pending quantity on the order (see the rules).                                                                                                                                                                                                                                                     |
| `LotNo`                            | text   | Only when the order line has no lot number | the order line's lot number                                                                 | The lot number for the received goods. **When the order line already has a lot number – for example when the purchase-order series puts the order number into the lot number – that lot is used and `LotNo` is ignored.** Otherwise `LotNo` is used; when it is empty, the purchase series' default lot number. A line that ends up without a lot number is refused. |
| `Lot_Mrp`                          | number | Yes, in practice                           | the order line's MRP (none when the purchase series is set not to take the MRP from orders) | The MRP of the lot. **Send it** – the rates below are applied only when it equals the line's MRP (see the known issue).                                                                                                                                                                                                                                              |
| `PurRate`, `SaleRate`, `BasicRate` | number | Depends on the purchase series             | none                                                                                        | Purchase, sale and basic rate of the line. Used only when above `0`; `BasicRate` replaces the basic rate taken from the order line. Unless the purchase series fills or does not require them, a missing purchase or sale rate stops the request.                                                                                                                    |
| `SP_Rate_1` to `SP_Rate_5`         | number | No                                         | none                                                                                        | Special rates 1 to 5 for the lot, used only when above `0`.                                                                                                                                                                                                                                                                                                          |
| `MFG_Date`, `Expiry_Date`          | date   | No                                         | none                                                                                        | Manufacturing and expiry date of the lot, `yyyy-MM-dd`.                                                                                                                                                                                                                                                                                                              |
| `Production_Unit`                  | text   | No                                         | empty                                                                                       | Production unit of the lot.                                                                                                                                                                                                                                                                                                                                          |
| `Lot_Bill_No`                      | text   | No                                         | empty                                                                                       | The lot's bill number.                                                                                                                                                                                                                                                                                                                                               |

**Ignored fields.** `Challan_Code`, `DNO_Code`, `Series_Code` (the series comes from your API site's settings), `GR_Date`, `GPN_No`, `GPN_Date`, `Weight`, `EntrySource`, and in `LstItems`: `ItemDescription`, `LotCode`, `Godown_Code`, `Org_Production_Unit`. `AccountCode` is only checked: the voucher is always posted to the order's supplier, and an `AccountCode` that is not the order's supplier is refused. Leave `Doc_Type` out (it defaults to `PU`; any value other than `PU` or `PR` stops the reverse-charge setting being taken from the tax region).

### **Rules Logic ERP applies**

* **What is received.** The order lines of the items in `LstItems` that are not cancelled and still have a pending quantity. Lines of items you did not list stay pending.
* **How much.** For each item, the `ScannedQty` of all its entries together must not be more than the item's pending quantity on the order (all its pending lines together); otherwise the request is refused with `GRN Quantity must be less than PO Pending Qty...`. The quantity is spread over the item's pending order lines, each line taking at most its own pending quantity. An item that is not on the order, or has nothing pending, is refused with `Item Code Not belongs to PO Or No Pending Qty Available to GRN. Item Code: …`. If the purchase series allows receiving more than ordered by a percentage, that percentage is added to the pending quantity for this check.
* **Billing in parts.** The received quantity is taken off the order line's pending quantity, so the rest can be received later with another request. For an **open order** the pending quantity is not reduced.
* **Rates and amounts.** Each line takes the order line's rate as it is on the order; a `BasicRate` you send replaces it, as described in `LstItems`. Purchase and sale rates are not taken from the order – send them. The order line's discount, and its tax set-up, are carried over. Rate formulas set on the purchase series are applied, as on Logic ERP's purchase screen.
* **Taxes.** The tax region is the supplier's: its tax region for your branch when one is linked, otherwise the supplier's own tax region, otherwise the default tax region. When the purchase series works out taxes item by item, they are worked out for that region, as on Logic ERP's purchase screen. Without a tax region the request is refused.
* **Lots.** When the order line has a lot number (or is tied to an existing lot), that lot is used and your `LotNo` is ignored. Otherwise a lot is created with the lot number, MRP, rates and dates described above. If an order line being received has **no lot number** and you send no `LotNo` for it, the request is refused with `Lot Number is missing in Item Details ...` – unless Logic ERP is set up, in the purchase series or in the user's rights, to accept order lines without a lot number. With `LotNo` left empty, each order line keeps its own lot number.
* **Godown.** The godown set as Default Godown in your API site's settings, else `Godown_Name`, else each item's default godown.
* **Series and number.** The voucher is saved in the purchase series chosen as **Default Configuration** for *Purchase voucher against PO* in your API site's settings. There is no request field for the series. The voucher gets the series' next number and the next GRN number for `GRN_Prefix`.
* **Checks of the series.** The purchase series' own checks apply – for example a mandatory MRP or purchase/sale rate, or refusing a supplier bill number that already exists for the supplier.
* **Branch and supplier are checked.** The order must belong to the branch you send, and `AccountCode` / `SupplierCode`, when sent, must be the order's supplier; otherwise the request is refused. If you send neither `BranchCode` nor `BranchShortName`, an order of a branch is refused with `Branch_Code or Branch_Short_Name is required.` – only an order of Logic ERP's empty placeholder branch (`0`) can be received without a branch.
* **Duplicates.** There is no duplicate check on the request. A repeat receives again from what is still pending (or is refused when nothing is left). Check `Status` before you resend.
* **All or nothing.** The voucher and all its lines are saved together. If anything fails, nothing is saved.
* Your Logic ERP licence must include the API for purchase against purchase orders.

> **Known issue – rates ignored without `Lot_Mrp`.** `PurRate`, `SaleRate`, `BasicRate` and the special rates are applied only when the line's MRP equals `Lot_Mrp`. When you leave `Lot_Mrp` out and the order line has an MRP, they are ignored and the request may then be refused for a missing purchase or sale rate. Always send `Lot_Mrp`.

### **Example request**

```json
{
  "PO_Code": 1186,
  "BranchCode": 2,
  "InvoiceDate": "2026-10-30",
  "Bill_No": "INV/26-27/2215",
  "Bill_Date": "2026-10-29",
  "PartyBillDate": "2026-10-29",
  "GRN_Prefix": "",
  "Godown_Name": "MAIN",
  "PU_Remarks_1": "Received against PO-1186",
  "LstItems": [
    { "LogicUser_Code": "KRT3301", "ScannedQty": 24, "LotNo": "L2610K", "Lot_Mrp": 1299, "PurRate": 520, "SaleRate": 1199 },
    { "LogicUser_Code": "JNS4410", "ScannedQty": 10, "LotNo": "L2610J", "Lot_Mrp": 1899, "PurRate": 760, "SaleRate": 1749 }
  ]
}
```

### **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 and adds stock. The example's test order is already fully received, so the example is refused – first save a test order with Save a Purchase Order and send its internal number, and change `Bill_No` each time.

## Save a Purchase Voucher Against a Purchase Order

> Records the goods received against a purchase order that is already in Logic ERP and bills them as a purchase voucher (goods receipt / GRN) posted to the order's supplier. You send the order's internal number and the items, lots and quantities received; Logic ERP takes the supplier, the purchase rate and the taxes from the order, creates the lines and takes the received quantity off the order's pending quantity, so the rest can be received later.

```json
{"openapi":"3.0.3","info":{"title":"Logic ERP API","version":"1.0"},"tags":[{"name":"Orders - 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":{"/SavePurchaseAgainstPO":{"post":{"tags":["Orders - Push"],"operationId":"SavePurchaseAgainstPO","summary":"Save a Purchase Voucher Against a Purchase Order","description":"Records the goods received against a purchase order that is already in Logic ERP and bills them as a purchase voucher (goods receipt / GRN) posted to the order's supplier. You send the order's internal number and the items, lots and quantities received; Logic ERP takes the supplier, the purchase rate and the taxes from the order, creates the lines and takes the received quantity off the order's pending quantity, so the rest can be received later.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"PO_Code":{"type":"integer","description":"Logic ERP's internal number of the purchase order – the `LastSavedCode` you got from Save a Purchase Order, or `Vouch_Code` in Get Purchase Orders. One order per request. The supplier of the voucher is the order's supplier."},"BranchCode":{"type":"integer","description":"The branch the voucher is saved in (as explained in How Every API Call Works). It must be the order's branch – see the rules."},"InvoiceDate":{"type":"string","description":"The voucher date, `yyyy-MM-dd`. Must fall in the current financial year."},"Bill_No":{"type":"string","description":"The supplier's bill (invoice) number."},"Bill_Date":{"type":"string","description":"The supplier's bill date, `yyyy-MM-dd`."},"PartyBillDate":{"type":"string","description":"The party bill date, `yyyy-MM-dd`."},"Godown_Name":{"type":"string","description":"The godown all lines are received into, by name exactly as in Logic ERP. A godown set as Default Godown in your API site's settings for this endpoint takes priority. A name that does not exist stops the request."},"PU_Remarks_1":{"type":"string","description":"Remarks 1 to 3 of the voucher."},"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. Must be above `0` and not more than the item's pending quantity on the order (see the rules)."},"LotNo":{"type":"string","description":"The lot number for the received goods. When the order line already has a lot number – for example when the purchase-order series puts the order number into the lot number – that lot is used and `LotNo` is ignored. Otherwise `LotNo` is used; when it is empty, the purchase series' default lot number. A line that ends up without a lot number is refused."},"Lot_Mrp":{"type":"integer","description":"The MRP of the lot. Send it – the rates below are applied only when it equals the line's MRP (see the known issue)."},"PurRate":{"type":"integer","description":"Purchase, sale and basic rate of the line. Used only when above `0`; `BasicRate` replaces the basic rate taken from the order line. Unless the purchase series fills or does not require them, a missing purchase or sale rate stops the request."},"SaleRate":{"type":"integer","description":"Purchase, sale and basic rate of the line. Used only when above `0`; `BasicRate` replaces the basic rate taken from the order line. Unless the purchase series fills or does not require them, a missing purchase or sale rate stops the request."},"BasicRate":{"type":"integer","description":"Purchase, sale and basic rate of the line. Used only when above `0`; `BasicRate` replaces the basic rate taken from the order line. Unless the purchase series fills or does not require them, a missing purchase or sale rate stops the request."}}},"description":"The items, lots and quantities received – see below. `ListItems` is accepted as another name for the same list."}}}}}},"responses":{"200":{"description":"Always HTTP 200. Check Status and Message.","content":{"application/json":{"schema":{"type":"object","properties":{"LastSavedDocNo":{"type":"string","description":"The voucher's GRN number – prefix, a hyphen and the number with two decimals, for example `GRN-14.00`. Empty (`null`) when not saved."},"Status":{"type":"boolean","description":"`true` when the voucher was saved."},"Message":{"type":"string","description":"Empty when saved; the reason when not saved."},"LastSavedCode":{"type":"integer","description":"Logic ERP's internal number of the new purchase voucher; `0` when not saved."},"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` when the voucher was saved.                                                                                                    |
| `Message`        | text         | Empty when saved; the reason when not saved.                                                                                          |
| `LastSavedCode`  | number       | Logic ERP's internal number of the new purchase voucher; `0` when not saved.                                                          |
| `LastSavedDocNo` | text         | The voucher's GRN number – prefix, a hyphen and the number with two decimals, for example `GRN-14.00`. Empty (`null`) when not saved. |
| `request_ID`     | text         | The ID of this request – quote it to support.                                                                                         |

### **Example response**

```json
{
  "LastSavedDocNo": "GRN-14.00",
  "Status": true,
  "Message": "",
  "LastSavedCode": 291,
  "request_ID": "8d41b2e7-5c3a-4f19-9e62-0a7b3c4d5e6f"
}
```

### **Messages you may see**

Messages from checks made while the voucher is being built and saved (marked \*) come back with technical text before the reason and technical detail after it – look for the reason in the first line.

| Message                                                                                                                                                                                      | Meaning                                                                                                                                                                                                                             | What to do                                                                                                                                                                                      |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Invalid PO Code […]. Please Check...`                                                                                                                                                       | `PO_Code` is missing or no purchase order has that number.                                                                                                                                                                          | Send the order's internal number.                                                                                                                                                               |
| `Default Configuration Not Defined in API Template..`                                                                                                                                        | No purchase series is chosen for purchase vouchers against purchase orders in your API site's settings.                                                                                                                             | Ask your Logic ERP team to choose the Default Configuration.                                                                                                                                    |
| `Invalid Supplier Code Defined...`                                                                                                                                                           | `SupplierCode` was sent but not found.                                                                                                                                                                                              | Leave `SupplierCode` out.                                                                                                                                                                       |
| `PO Code […] belongs to another branch...`                                                                                                                                                   | The order is not of the branch you sent.                                                                                                                                                                                            | Send the order's own branch.                                                                                                                                                                    |
| `Branch_Code or Branch_Short_Name is required.`                                                                                                                                              | No branch was sent and the order belongs to a branch. Nothing was saved.                                                                                                                                                            | Send the order's own branch.                                                                                                                                                                    |
| `Account Code […] is not the supplier of PO Code […]...`, `Supplier Code […] is not the supplier of PO Code […]...`                                                                          | `AccountCode` or `SupplierCode` is not the order's supplier.                                                                                                                                                                        | Leave them out, or send the order's supplier.                                                                                                                                                   |
| `Invalid Godown Name […]. Please Check...`                                                                                                                                                   | `Godown_Name` does not exist.                                                                                                                                                                                                       | Send the name exactly as in Logic ERP, or leave it out.                                                                                                                                         |
| `Invalid Invoice Date Defined...` / `Invalid Bill Date...` / `Invalid Party Bill Date...`                                                                                                    | A date could not be read.                                                                                                                                                                                                           | Send dates as `yyyy-MM-dd`.                                                                                                                                                                     |
| `Logic User Code/Additional Item Code Not Defined for Item No : …`                                                                                                                           | An entry in `LstItems` has neither code.                                                                                                                                                                                            | Send `LogicUser_Code` or `AddlItemCode`.                                                                                                                                                        |
| `Invalid Logic User Code : '…' Defined for Item No : …` / `Invalid Additional Item Code : '…' Defined for Item No : …`                                                                       | The item code is not found.                                                                                                                                                                                                         | Send the code exactly as in Logic ERP.                                                                                                                                                          |
| `Quantity Not Defined For : '…' Item No : …`                                                                                                                                                 | `ScannedQty` is `0` or less.                                                                                                                                                                                                        | Send a quantity above `0`.                                                                                                                                                                      |
| `Invoice Date not Within Financial Year.Please Check....`                                                                                                                                    | `InvoiceDate` is outside the current financial year.                                                                                                                                                                                | Send a date in the current financial year.                                                                                                                                                      |
| `GRN Quantity must be less than PO Pending Qty...`                                                                                                                                           | The quantity of an item (all its entries together) is more than its pending quantity on the order.                                                                                                                                  | Check the order's pending quantities ([Get Purchase Orders](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/orders/pull/get-purchase-orders.md)). |
| `Item Code Not belongs to PO Or No Pending Qty Available to GRN. Item Code: …`                                                                                                               | The item is not on the order, or has nothing pending on it.                                                                                                                                                                         | Check the order with Get Purchase Orders.                                                                                                                                                       |
| `Lot Number is missing in Item Details ...` \*                                                                                                                                               | An order line being received has no lot number.                                                                                                                                                                                     | See the rules (Lots).                                                                                                                                                                           |
| `Lot No.… cannot be blank. Item Code: …` \*                                                                                                                                                  | A line ended up without a lot number.                                                                                                                                                                                               | Send `LotNo`.                                                                                                                                                                                   |
| `Default Tax Region not Set.Please Check....` \*                                                                                                                                             | No tax region could be found for the supplier.                                                                                                                                                                                      | Set the supplier's tax region 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 was not found.                                                                                                                                                                                                               | Send it exactly as in Logic ERP.                                                                                                                                                                |
| `M.R.P. Entry is mandatory......Row No: …` \*                                                                                                                                                | The purchase series needs an MRP and the line has none.                                                                                                                                                                             | Send `Lot_Mrp`.                                                                                                                                                                                 |
| `Purchase Rate entry is mandatory.... Row No:…` / `Sale Rate entry is mandatory.... Row No:…` \*                                                                                             | The purchase series needs a rate and the line has none.                                                                                                                                                                             | Send `PurRate` / `SaleRate` and `Lot_Mrp`.                                                                                                                                                      |
| `Unable to identify taxes of Item at Row No.:…` \*                                                                                                                                           | No tax could be found for an item in the supplier's tax region.                                                                                                                                                                     | Check the item's tax set-up in Logic ERP.                                                                                                                                                       |
| `Bill No:… already exists for this supplier... Cannot Continue.` \*                                                                                                                          | The series refuses a supplier bill number that is already used for this supplier.                                                                                                                                                   | Send the correct `Bill_No`.                                                                                                                                                                     |
| `Error while saving voucher` \*                                                                                                                                                              | Saving was stopped inside Logic ERP; nothing was saved. One known cause: the supplier bill number already exists for this supplier and the purchase series is set to ask before accepting it – the API cannot answer that question. | Check `Bill_No`; otherwise retry once and, if it repeats, send the `request_ID` to support.                                                                                                     |
| Another technical error \*                                                                                                                                                                   | Saving failed inside Logic ERP; nothing was saved.                                                                                                                                                                                  | Retry once; if it repeats, send the `request_ID` to support.                                                                                                                                    |
| `Voucher not saved. The item-wise amounts could not be calculated.`                                                                                                                          | Saving stopped inside Logic ERP without giving a reason. Nothing was saved.                                                                                                                                                         | Check the order in Logic ERP; send the `request_ID` to support.                                                                                                                                 |


---

# 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/orders/push/save-a-purchase-voucher-against-a-purchase-order.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.
