> 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-indent.md).

# Save a Purchase Indent

Creates a new **purchase indent** in Logic ERP – an internal request to buy goods, which purchase orders can later be made against. The request is exactly the same as for [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) and goes through the same checks and calculations; the differences are listed under **How it differs from a purchase order** below. You send the supplier, the indent prefix and the items with their quantities and rates; Logic ERP gives the indent a number, works out taxes and totals with the purchase-indent series chosen for your API site, and saves it as **pending**.

### **Endpoint**

| Name          | Detail                                       |
| ------------- | -------------------------------------------- |
| Address       | `https://your-server/api/SavePurchaseIndent` |
| 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**

Field names are not case-sensitive. Names and codes are matched as you send them – spaces in front of them are not removed (only `Tax_Region` and the item codes `LogicUser_Code` / `AddlItemCode` are trimmed). Capital and small letters do not matter.

| Field                                                               | Type   | Required                         | Default                   | Meaning                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------------- | ------ | -------------------------------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Branch_Code`                                                       | number | **Yes** (or `Branch_Short_Name`) | `-1`                      | The branch the indent is saved in (`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)). When it is left out (or `0` or less) and `Branch_Short_Name` is sent, the branch is found by its short name. With neither, the request is refused. |
| `Branch_Short_Name`                                                 | text   | No                               | empty                     | The branch by its short name. Used only when `Branch_Code` is left out, `0` or less. A short name that does not exist is refused.                                                                                                                                                                                                                         |
| `Party_User_code`                                                   | text   | Yes                              | empty                     | The supplier, by the party code shown in Logic ERP (`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)). A supplier or customer account is accepted. An indent cannot be saved without one.                                                |
| `Order_Prefix`                                                      | text   | Yes                              | empty                     | The prefix of the indent number, for example `PI`. The indent number is the prefix, a hyphen and a number – for example `PI-43`. See the known issue on numbering.                                                                                                                                                                                        |
| `Order_Date`                                                        | date   | No                               | today                     | The indent date, `yyyy-MM-dd`. It also decides the financial year.                                                                                                                                                                                                                                                                                        |
| `Valid_Till_Date`                                                   | date   | No                               | the indent date           | The date the indent is valid till. A value that cannot be read as a date is ignored.                                                                                                                                                                                                                                                                      |
| `Delivery_Date`                                                     | date   | No                               | none                      | The date the goods are needed.                                                                                                                                                                                                                                                                                                                            |
| `Supplier_Order_No`                                                 | text   | No\*                             | empty                     | The supplier's reference. \*Required when the indent series has **Do not allow duplicate Supp. Order No. for Same Supplier** ticked – see the known issue below.                                                                                                                                                                                          |
| `Quotation_No`                                                      | text   | No                               | empty                     | The supplier's quotation number.                                                                                                                                                                                                                                                                                                                          |
| `Quotation_Date`                                                    | date   | No                               | none                      | The supplier's quotation date. A value that cannot be read as a date is ignored.                                                                                                                                                                                                                                                                          |
| `Remarks`                                                           | text   | No                               | empty                     | Remarks of the indent.                                                                                                                                                                                                                                                                                                                                    |
| `Tax_Region`                                                        | text   | No                               | the supplier's tax region | A tax region by name, exactly as in Logic ERP. `(NIL)` (or only spaces) means no tax region. A name that is not found is refused. See the known issue below.                                                                                                                                                                                              |
| `Agent_Name`                                                        | text   | No                               | the supplier's agent      | An agent / broker by name, exactly as in Logic ERP. `(NIL)` means no agent. Left out, the indent gets the supplier's default agent.                                                                                                                                                                                                                       |
| `Company_Name`                                                      | text   | No                               | none                      | A company (brand) by name, exactly as in Logic ERP's company master. `(NIL)` means none.                                                                                                                                                                                                                                                                  |
| `Transport_Name`                                                    | text   | No                               | none                      | A transporter by name, exactly as in Logic ERP. `(NIL)` means none.                                                                                                                                                                                                                                                                                       |
| `DepartmentName`                                                    | text   | No                               | none                      | The department asking for the goods, by name exactly as in Logic ERP.                                                                                                                                                                                                                                                                                     |
| `Transfer_Party_UserCode`                                           | text   | No                               | none                      | A transfer party, by party code.                                                                                                                                                                                                                                                                                                                          |
| `Delivery_At`, `Delivery_Add_1`, `Delivery_Add_2`, `Delivery_Add_3` | text   | No                               | empty                     | The delivery place and three address lines.                                                                                                                                                                                                                                                                                                               |
| `Total_Other_Val_1` to `Total_Other_Val_5`                          | number | No                               | `0`                       | Amounts for "other value" 1 to 5, in ₹. Used only when the indent series' calculation includes that other value. `0` lets the series' default apply.                                                                                                                                                                                                      |
| `ListItems`                                                         | list   | Yes                              | empty list                | The items asked for – see below.                                                                                                                                                                                                                                                                                                                          |
| `DisplayError`                                                      | text   | No                               | `"0"`                     | `"1"` = when the request fails, `Message` holds the full technical detail. Use only while testing.                                                                                                                                                                                                                                                        |

**`ListItems` – one entry per indent line**

| 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 (`AddlItemCode` in Get Item Master). Used when `LogicUser_Code` is empty or not found. A code from the item's list of extra barcodes is accepted too.           |
| `Order_Qty`      | number | Yes                     | `0`     | Quantity asked for. Must be above `0`.                                                                                                                                                             |
| `Rate`           | number | No – but always send it | `0`     | Expected rate per unit, in ₹. See the known issue below.                                                                                                                                           |
| `SPCD_P`         | number | No                      | `0`     | Discount percentage for the line. Used when the series' calculation has an item-wise discount.                                                                                                     |
| `Tax_Amount`     | number | No                      | `0`     | Despite its name, the **tax percentage** of the line. See the known issue below.                                                                                                                   |
| `Remarks`        | text   | No                      | empty   | Remarks of the line.                                                                                                                                                                               |
| `Lot_Number`     | text   | No                      | empty   | Saved on the indent line. Replaced by the indent number when the series has **Move PO Number to Lot Number** ticked.                                                                               |

**Ignored fields.** `Total_Other_Val_6`, `Total_Other_Val_7`, and in `ListItems`: `Lot_QR_Code`, `Lot_Extra_1`, `Addl_Lot_Number`, `ItemDetCode`. Any other field you send is ignored.

### **How it differs from a purchase order**

* **What is saved.** A purchase indent, kept apart from purchase orders: it has its own list, its own numbers and its own approval.
* **Series.** The indent series chosen as **Default Configuration** in your API site's settings for *LOGIC API PUSH - PURCHASE INDENT* (a separate setting from the one for purchase orders). If none is chosen, the message still says *Purchase Order*: `Default Purchase Order Configuration Not Selected!!`.
* **Number.** The number is counted among the branch's indents with the same prefix – see the known issue on numbering.
* **Lots.** No lots are created, whatever the series says, so `Lot_QR_Code`, `Lot_Extra_1` and `Addl_Lot_Number` are ignored.
* **Back-dated check.** "Earlier than the latest document" is checked against the branch's latest **indent**.
* **Approval.** When indents need approval in your Logic ERP set-up, the indent is saved as waiting for approval.
* **Licence.** Your Logic ERP licence must include the purchase-indent API.

Everything else – the supplier, item and name checks, rates, taxes, other values, date checks, the switch-off behaviour (`Status: true` with the *In-Active* sentence) and the absence of a duplicate check – works exactly as described in the **Rules** of [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).

### **Rules Logic ERP applies**

* **Items.** Each `ListItems` entry becomes one indent line. Every item code must exist; one unknown code stops the whole request. When the API setting **Ignore Invalid Item for Request Json** is ticked, entries whose `LogicUser_Code` is exactly `-1` are dropped first.
* **Rates and taxes.** `Rate` is used as sent. Without `Tax_Region`, the supplier's tax region is used. When the series finds item-wise GST itself, `Tax_Amount` is replaced; otherwise it is used as the line's tax percentage.
* **Duplicates.** There is no duplicate check on the request. Sending the same request twice creates two indents – check `Status` before you resend.
* **All or nothing.** The indent and all its lines are saved together. If anything fails, nothing is saved.
* **Branch.** Send `Branch_Code` or `Branch_Short_Name`. With neither, nothing is saved and the request is refused with *Branch\_Code or Branch\_Short\_Name is required.*

> **Known issue – indent numbering.** The indent gets number 1 when no indent of the branch has the prefix with number 1; only otherwise does it get the highest number + 1. If indent 1 of a prefix was deleted, the next indent takes number 1 again. Check `LastSavedDocNo` for the number given.

> **Known issue – the supplier order number check looks at purchase orders.** When the indent series has **Do not allow duplicate Supp. Order No. for Same Supplier** ticked, `Supplier_Order_No` is checked against the supplier's **purchase orders**, not its indents. A number already used on a purchase order is refused; a number already used on another indent is accepted.

> **Known issue – a missing `Rate` is not the purchase rate.** When `Rate` is `0` or left out, the line gets the supplier's rate for the item (the transfer party's, when you send `Transfer_Party_UserCode`) if the series has **Pick Supplier + Item Wise Rates** ticked and such a rate exists; otherwise it gets the item's **sale** rate. Always send the rate.

> **Known issue – `Tax_Amount` is a percentage.** The value is used as the line's tax rate, not as a tax amount. Send the tax percentage, or `0` when the series finds the taxes itself.

> **Known issue – the default tax region.** Without `Tax_Region`, the indent takes the tax region linked to the supplier for **sales** in this branch, not the one linked for purchases. When they differ, send the purchase one in `Tax_Region`.

### **Example request**

```json
{
  "Branch_Code": 2,
  "Party_User_code": "S0412",
  "Order_Prefix": "PI",
  "Order_Date": "2026-10-30",
  "Delivery_Date": "2026-11-15",
  "Remarks": "Requirement for Diwali display",
  "DepartmentName": "Visual Merchandising",
  "ListItems": [
    { "LogicUser_Code": "MNQ0105", "Order_Qty": 6, "Rate": 2400, "Tax_Amount": 18, "Remarks": "Half mannequins" },
    { "AddlItemCode": "8901234500127", "Order_Qty": 50, "Rate": 35, "Tax_Amount": 12, "Remarks": "Hangers" }
  ]
}
```

### **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 indent of the sandbox's test item `APITEST0001`; change `Supplier_Order_No` each time.

## Save a Purchase Indent

> Creates a new purchase indent in Logic ERP – an internal request to buy goods, which purchase orders can later be made against. The request is exactly the same as for Save a Purchase Order and goes through the same checks and calculations; the differences are listed under How it differs from a purchase order below. You send the supplier, the indent prefix and the items with their quantities and rates; Logic ERP gives the indent a number, works out taxes and totals with the purchase-indent series chosen for your API site, and saves it as pending.

```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":{"/SavePurchaseIndent":{"post":{"tags":["Orders - Push"],"operationId":"SavePurchaseIndent","summary":"Save a Purchase Indent","description":"Creates a new purchase indent in Logic ERP – an internal request to buy goods, which purchase orders can later be made against. The request is exactly the same as for Save a Purchase Order and goes through the same checks and calculations; the differences are listed under How it differs from a purchase order below. You send the supplier, the indent prefix and the items with their quantities and rates; Logic ERP gives the indent a number, works out taxes and totals with the purchase-indent series chosen for your API site, and saves it as pending.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"Branch_Code":{"type":"integer","description":"The branch the indent is saved in (`Branch_Code` in Get Branch Info). When it is left out (or `0` or less) and `Branch_Short_Name` is sent, the branch is found by its short name. With neither, the request is refused."},"Party_User_code":{"type":"string","description":"The supplier, by the party code shown in Logic ERP (`User_Code` in Get Party Master). A supplier or customer account is accepted. An indent cannot be saved without one."},"Order_Prefix":{"type":"string","description":"The prefix of the indent number, for example `PI`. The indent number is the prefix, a hyphen and a number – for example `PI-43`. See the known issue on numbering."},"Order_Date":{"type":"string","description":"The indent date, `yyyy-MM-dd`. It also decides the financial year."},"Supplier_Order_No":{"type":"string","description":"The supplier's reference. *Required when the indent series has Do not allow duplicate Supp. Order No. for Same Supplier ticked – see the known issue below."},"Remarks":{"type":"string","description":"Remarks of the indent."},"ListItems":{"type":"array","items":{"type":"object","properties":{"LogicUser_Code":{"type":"string","description":"The item code shown in Logic ERP (`UserCode` in Get Item Master)."},"Order_Qty":{"type":"integer","description":"Quantity asked for. Must be above `0`."},"Rate":{"type":"integer","description":"Expected rate per unit, in ₹. See the known issue below."},"SPCD_P":{"type":"integer","description":"Discount percentage for the line. Used when the series' calculation has an item-wise discount."},"Tax_Amount":{"type":"integer","description":"Despite its name, the tax percentage of the line. See the known issue below."},"Remarks":{"type":"string","description":"Remarks of the indent."}}},"description":"The items asked for – see below."}}}}}},"responses":{"200":{"description":"Always HTTP 200. Check Status and Message.","content":{"application/json":{"schema":{"type":"object","properties":{"LastSavedDocNo":{"type":"string","description":"The indent number – prefix, a hyphen and the number, for example `PI-43`. Empty (`null`) when not saved."},"Order_No":{"type":"string","nullable":true,"description":"Always `null`."},"ErrorCode":{"type":"string","description":"Always empty."},"Status":{"type":"boolean","description":"`true` when the indent 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 indent; `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 indent was saved.                                                                        |
| `Message`        | text         | Empty when saved; the reason when not saved.                                                             |
| `LastSavedCode`  | number       | Logic ERP's internal number of the new indent; `0` when not saved.                                       |
| `LastSavedDocNo` | text         | The indent number – prefix, a hyphen and the number, for example `PI-43`. Empty (`null`) when not saved. |
| `Order_No`       | text         | Always `null`.                                                                                           |
| `ErrorCode`      | text         | Always empty.                                                                                            |
| `request_ID`     | text         | The ID of this request – quote it to support.                                                            |

### **Example response**

```json
{
  "LastSavedDocNo": "PI-43",
  "Order_No": null,
  "ErrorCode": "",
  "Status": true,
  "Message": "",
  "LastSavedCode": 118,
  "request_ID": "1e7b5c90-4d2a-4f36-9b8e-a03c5d7f2e41"
}
```

### **Messages you may see**

The messages are the same as for [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) (they say *order* even for an indent). The ones you will meet most:

| Message                                                            | Meaning                                                                                                      | What to do                                                              |
| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
| `Branch_Code or Branch_Short_Name is required.`                    | Neither branch field was sent. Nothing was saved.                                                            | Send `Branch_Code` or `Branch_Short_Name`.                              |
| `No financial year covers the date …` (date as day/month/year)     | `Order_Date` lies outside every financial year set up in Logic ERP. Nothing was saved.                       | Send a date inside a financial year.                                    |
| `Default Purchase Order Configuration Not Selected!!`              | No indent series is chosen for *LOGIC API PUSH - PURCHASE INDENT* in your API site's settings.               | Ask your Logic ERP team to choose the Default Configuration.            |
| `Invalid Party User Code...`                                       | `Party_User_code` is missing or is not a supplier or customer account.                                       | Send the supplier's party code.                                         |
| `Invalid LogicUserCode / EANCode : …`                              | An item code was not found.                                                                                  | Send the code exactly as in Logic ERP.                                  |
| `Quantity cannot be blank. Logic User Code : …`                    | `Order_Qty` is `0` or less.                                                                                  | Send a quantity above `0`.                                              |
| `Entry not allowed in back date.......`                            | The date is earlier than the branch's latest indent (or than today), and back-dated entries are not allowed. | Send a later `Order_Date`, or ask your Logic ERP team about the rights. |
| `Invalid Order Prefix Entered...`                                  | `Order_Prefix` is empty.                                                                                     | Send a prefix.                                                          |
| `No Item Found!!`                                                  | `ListItems` is empty.                                                                                        | Send at least one item.                                                 |
| `Unable to found Department Name : …`                              | The department was not found.                                                                                | Send it exactly as in Logic ERP, or leave it out.                       |
| `Unable to found Tax Region : …`                                   | `Tax_Region` was not found. Nothing was saved.                                                               | Send it exactly as in Logic ERP, `(NIL)` for none, or leave it out.     |
| `Supplier Order No. Cannot be blank.Please Check`                  | The indent series needs a supplier reference.                                                                | Send `Supplier_Order_No`.                                               |
| `Supplier Order No. already exists for same Supplier.Please Check` | See the known issue above.                                                                                   | Send another reference, or leave it out if the series allows.           |


---

# 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-indent.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.
