> 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/inventory/push/godown-transfer.md). Agents can also search and read this documentation through its [MCP server](https://kb.logicerp.com/~gitbook/mcp).

# Godown Transfer

Moves stock from one **godown** to another **within the same branch** by saving a **godown-to-godown stock transfer** in Logic ERP. You send the two godowns, the items and quantities; Logic ERP picks the lots in the source godown, oldest purchase first, and moves them – the lot stays the same, only its godown changes. The branch's total stock does not change. The request is refused when the source godown does not have enough stock.

To send stock to **another branch**, use [Save a Stock Transfer Out](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/sale/push/save-a-stock-transfer-out.md). To take stock out or bring it in without a transfer, use [Issue Stock](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/inventory/push/issue-stock.md) or [Receipt Stock](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/inventory/push/receipt-stock.md).

### **Endpoint**

| Name          | Detail                                       |
| ------------- | -------------------------------------------- |
| Address       | `https://your-server/api/SaveGodownTransfer` |
| 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; capitals do not matter.

| Field                                 | Type   | Required                                         | Default    | Meaning                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------------------------- | ------ | ------------------------------------------------ | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `BranchCode`                          | number | No – but always send it (or `Branch_Short_Name`) | `-1`       | The branch whose godowns are used, 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)).                                                                                                                                                                                                                |
| `Branch_Short_Name`                   | text   | No                                               | empty      | The branch by its short name; used only when `BranchCode` is `0` or less. When `BranchCode` is left out (or below `0`) and `Branch_Short_Name` is empty, the request is refused with `Branch_Code or Branch_Short_Name is required.`; with `"BranchCode": 0` and no short name it still runs against Logic ERP's empty placeholder branch, which holds no stock, so it is normally refused with the *Insufficient Stock* message – always send one. |
| `Godown_From`                         | text   | Yes                                              | –          | The godown the stock leaves, by its name in Logic ERP.                                                                                                                                                                                                                                                                                                                                                                                              |
| `Godown_To`                           | text   | Yes                                              | –          | The godown the stock goes into, by its name in Logic ERP.                                                                                                                                                                                                                                                                                                                                                                                           |
| `GT_Date`                             | date   | No                                               | today      | The transfer date, `yyyy-MM-dd`. It also decides the financial year the transfer is saved in, whose stock is moved and whose numbering is used.                                                                                                                                                                                                                                                                                                     |
| `GT_Prefix`                           | text   | No                                               | `GT`       | Prefix of the transfer number, **up to 4 characters** – a longer prefix is refused, and so is a prefix containing an apostrophe (`'`). The transfer gets the next number for this prefix in the branch and financial year.                                                                                                                                                                                                                          |
| `PartyUserCode`                       | text   | No                                               | none       | A customer to note on the transfer, 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)). Only customers (or parties marked as customers too) are accepted. Nothing is posted to the party.                                                                                                     |
| `DepartmentName`                      | text   | No                                               | none       | A department, by its name in Logic ERP.                                                                                                                                                                                                                                                                                                                                                                                                             |
| `Remarks_1`, `Remarks_2`, `Remarks_3` | text   | No                                               | empty      | Remarks 1 to 3 of the transfer.                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `ListItems`                           | list   | Yes                                              | empty list | The items and quantities to move – 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 item (and lot, if you name one)**

| Field                 | Type   | Required       | Default | Meaning                                                                                                                                                                                                                               |
| --------------------- | ------ | -------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `LogicUserCode`       | 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)).                                    |
| `EANCode`             | text   | One of the two | empty   | The additional item code / barcode (`AddlItemCode` in Get Item Master). When `LogicUserCode` is empty, one of the item's extra barcodes is accepted too. When both are sent, `EANCode` is tried only if `LogicUserCode` is not found. |
| `Quantity`            | number | Yes            | `0`     | Quantity to move. Must be above `0`.                                                                                                                                                                                                  |
| `Rate`                | number | No             | `0`     | A rate saved on the transfer lines for information. It does not change any lot or stock value.                                                                                                                                        |
| `Lot_Number`          | text   | No             | empty   | Move only from lots with this lot number.                                                                                                                                                                                             |
| `Lot_Bill_No`         | text   | No             | empty   | Move only from lots with this purchase bill number.                                                                                                                                                                                   |
| `Lot_Production_Unit` | text   | No             | empty   | Move only from lots with this production unit.                                                                                                                                                                                        |

### **Rules Logic ERP applies**

* **Which stock is moved.** For each entry, Logic ERP uses the item's lots that have free stock in `Godown_From`, in the branch, in the financial year of `GT_Date`, limited by `Lot_Number`, `Lot_Bill_No` and `Lot_Production_Unit` when you send them. Lots are used in order of purchase date, oldest first; one entry can be split over several lots, each becoming its own line. Each lot moves as it is to `Godown_To` – no new lot is created.
* **Not enough stock.** When the lots found do not cover the quantity of an entry, the whole request is refused. Entries for the same item share the stock: a second entry for the item only gets what the first one left.
* **The stock is the current stock** of that financial year, not the stock as on `GT_Date`.
* **The two godowns must differ.** The same godown in `Godown_From` and `Godown_To` is refused. A godown marked as disabled in Logic ERP is refused as `Godown_To`; it is still accepted as `Godown_From`, so stock can be moved out of it.
* **Number.** The transfer gets the next number for `GT_Prefix` among godown transfers of the branch in the financial year of `GT_Date`, so numbering starts again each year. The document number is the prefix followed directly by the number, for example `GT57`.
* **Configuration.** Your API site's settings must name a **Stock Transfer configuration** for godown transfers, or the request is refused. The configuration's options are not applied to the transfer, and the prefix and *Ignore Invalid Item* options of these settings have no effect – the prefix comes only from `GT_Prefix`.
* **Date checks.** The transfer is refused when `GT_Date` is on or before the lock date in the access rights of the Logic ERP user linked to your API site, or on or before the branch's last physical stock date when that user's access rights switch the physical-stock lock on.
* **Duplicates.** There is no duplicate check: every request that succeeds saves a new transfer. Check `Status` before you resend.
* **All or nothing.** The transfer, its lines and the stock changes are saved together. If anything fails, nothing is moved.
* **Switching off.** Your support team can switch this endpoint off for your API site as a whole, not per branch. Then nothing is saved and the answer has `Status: true` with the *In-Active* sentence in `Message` (as explained in How Every API Call Works).
* Your Logic ERP licence must include the API for godown-wise stock transfers.

### **Example request**

```json
{
  "BranchCode": 2,
  "Branch_Short_Name": "",
  "GT_Prefix": "GT",
  "GT_Date": "2026-11-05",
  "PartyUserCode": "",
  "Godown_From": "MAIN",
  "Godown_To": "SHOWROOM",
  "Remarks_1": "Display refill",
  "Remarks_2": "",
  "Remarks_3": "",
  "DepartmentName": "",
  "ListItems": [
    { "LogicUserCode": "SHT1042", "EANCode": "", "Quantity": 6, "Rate": 450.00, "Lot_Number": "", "Lot_Bill_No": "", "Lot_Production_Unit": "" },
    { "LogicUserCode": "", "EANCode": "8901234567895", "Quantity": 2, "Rate": 0, "Lot_Number": "L2610B", "Lot_Bill_No": "", "Lot_Production_Unit": "" }
  ]
}
```

### **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: each send moves the test item `APITEST0001` between the godowns `MAIN` and `REPAIR`. To move it back, swap `Godown_From` and `Godown_To`; keep `GT_Prefix` at 4 characters or fewer.

## Godown Transfer

> Moves stock from one godown to another within the same branch by saving a godown-to-godown stock transfer in Logic ERP. You send the two godowns, the items and quantities; Logic ERP picks the lots in the source godown, oldest purchase first, and moves them – the lot stays the same, only its godown changes. The branch's total stock does not change. The request is refused when the source godown does not have enough stock.

```json
{"openapi":"3.0.3","info":{"title":"Logic ERP API","version":"1.0"},"tags":[{"name":"Inventory - 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":{"/SaveGodownTransfer":{"post":{"tags":["Inventory - Push"],"operationId":"SaveGodownTransfer","summary":"Godown Transfer","description":"Moves stock from one godown to another within the same branch by saving a godown-to-godown stock transfer in Logic ERP. You send the two godowns, the items and quantities; Logic ERP picks the lots in the source godown, oldest purchase first, and moves them – the lot stays the same, only its godown changes. The branch's total stock does not change. The request is refused when the source godown does not have enough stock.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"BranchCode":{"type":"integer","description":"The branch whose godowns are used, by Logic ERP's branch number (`Branch_Code` in Get Branch Info)."},"Branch_Short_Name":{"type":"string","description":"The branch by its short name; used only when `BranchCode` is `0` or less. When `BranchCode` is left out (or below `0`) and `Branch_Short_Name` is empty, the request is refused with `Branch_Code or Branch_Short_Name is required.`; with `\"BranchCode\": 0` and no short name it still runs against Logic ERP's empty placeholder branch, which holds no stock, so it is normally refused with the Insufficient Stock message – always send one."},"GT_Prefix":{"type":"string","description":"Prefix of the transfer number, up to 4 characters – a longer prefix is refused, and so is a prefix containing an apostrophe (`'`). The transfer gets the next number for this prefix in the branch and financial year."},"GT_Date":{"type":"string","description":"The transfer date, `yyyy-MM-dd`. It also decides the financial year the transfer is saved in, whose stock is moved and whose numbering is used."},"PartyUserCode":{"type":"string","description":"A customer to note on the transfer, by the party code shown in Logic ERP (`User_Code` in Get Party Master). Only customers (or parties marked as customers too) are accepted. Nothing is posted to the party."},"Godown_From":{"type":"string","description":"The godown the stock leaves, by its name in Logic ERP."},"Godown_To":{"type":"string","description":"The godown the stock goes into, by its name in Logic ERP."},"Remarks_1":{"type":"string","description":"Remarks 1 to 3 of the transfer."},"Remarks_2":{"type":"string","description":"Remarks 1 to 3 of the transfer."},"Remarks_3":{"type":"string","description":"Remarks 1 to 3 of the transfer."},"DepartmentName":{"type":"string","description":"A department, by its name in Logic ERP."},"ListItems":{"type":"array","items":{"type":"object","properties":{"LogicUserCode":{"type":"string","description":"The item code shown in Logic ERP (`UserCode` in Get Item Master)."},"EANCode":{"type":"string","description":"The additional item code / barcode (`AddlItemCode` in Get Item Master). When `LogicUserCode` is empty, one of the item's extra barcodes is accepted too. When both are sent, `EANCode` is tried only if `LogicUserCode` is not found."},"Quantity":{"type":"integer","description":"Quantity to move. Must be above `0`."},"Rate":{"type":"integer","description":"A rate saved on the transfer lines for information. It does not change any lot or stock value."},"Lot_Number":{"type":"string","description":"Move only from lots with this lot number."},"Lot_Bill_No":{"type":"string","description":"Move only from lots with this purchase bill number."},"Lot_Production_Unit":{"type":"string","description":"Move only from lots with this production unit."}}},"description":"The items and quantities to move – see below."}}}}}},"responses":{"200":{"description":"Always HTTP 200. Check Status and Message.","content":{"application/json":{"schema":{"type":"object","properties":{"LastSavedDocNo":{"type":"string","description":"The transfer number, for example `GT57`. Empty (`null`) when not saved."},"Status":{"type":"boolean","description":"`true` when the transfer was saved."},"Message":{"type":"string","description":"`Sucess` (spelt this way) when saved; the reason when not saved."},"LastSavedCode":{"type":"integer","description":"Logic ERP's internal number of the new transfer; `0` when not saved."},"request_ID":{"type":"string","description":"The ID of this request – quote it to support. `null` when the request was refused before saving started."}}}}}},"401":{"description":"No login was sent."}}}}}}
```

### **Response**

| Field            | Type         | Meaning                                                                                                  |
| ---------------- | ------------ | -------------------------------------------------------------------------------------------------------- |
| `Status`         | true / false | `true` when the transfer was saved.                                                                      |
| `Message`        | text         | `Sucess` (spelt this way) when saved; the reason when not saved.                                         |
| `LastSavedCode`  | number       | Logic ERP's internal number of the new transfer; `0` when not saved.                                     |
| `LastSavedDocNo` | text         | The transfer number, for example `GT57`. Empty (`null`) when not saved.                                  |
| `request_ID`     | text         | The ID of this request – quote it to support. `null` when the request was refused before saving started. |

### **Example response**

```json
{
  "LastSavedDocNo": "GT57",
  "Status": true,
  "Message": "Sucess",
  "LastSavedCode": 912,
  "request_ID": "9c41e2d7-5b3a-4f08-8e1d-27a6c0b5f4e2"
}
```

### **Messages you may see**

| Message                                                                                       | Meaning                                                                                                                                         | What to do                                                   |
| --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| `Branch_Code or Branch_Short_Name is required.`                                               | `BranchCode` was left out (or is below `0`) and `Branch_Short_Name` is empty. Nothing was saved.                                                | Send the branch.                                             |
| `No financial year covers the date dd/MM/yyyy.`                                               | No financial year in Logic ERP covers `GT_Date`.                                                                                                | Send a date inside an open financial year.                   |
| `Default Godown Transfer Configuration Defined..`                                             | No Stock Transfer configuration is chosen for godown transfers in your API site's settings (the message leaves out "not").                      | Ask your Logic ERP team to choose the configuration.         |
| `Invalid Party User Code...`                                                                  | `PartyUserCode` is not found among customers.                                                                                                   | Send a customer's party code, or leave it empty.             |
| `Unable to found DepartmentName : …`                                                          | No department has that name.                                                                                                                    | Send the name exactly as in Logic ERP, or leave it empty.    |
| `Invalid Godown From...`                                                                      | `Godown_From` is empty or not found.                                                                                                            | Send the godown name exactly as in Logic ERP.                |
| `Invalid Godown To...`                                                                        | `Godown_To` is empty or not found.                                                                                                              | Send the godown name exactly as in Logic ERP.                |
| `Godown To : … is disabled...Please Check` (your `Godown_To` in place of …)                   | The godown in `Godown_To` is marked as disabled in Logic ERP.                                                                                   | Send another godown, or ask your Logic ERP team.             |
| `Godown From and Godown To cannot be same...`                                                 | `Godown_From` and `Godown_To` are the same godown.                                                                                              | Send two different godowns.                                  |
| `Invalid Godown Transfer Date...`                                                             | `GT_Date` is not a date.                                                                                                                        | Send `yyyy-MM-dd`.                                           |
| `Unable to found List Items In Payload...`                                                    | `ListItems` is empty.                                                                                                                           | Send at least one item.                                      |
| `LogicUserCode Or EAN Code Cannot Blank!!`                                                    | An entry has neither code.                                                                                                                      | Send `LogicUserCode` or `EANCode`.                           |
| `Invalid LogicUserCode / EANCode : …`                                                         | The item was not found. The code shown is your `EANCode` when sent, otherwise your `LogicUserCode`, in capitals.                                | Send the code exactly as in Logic ERP.                       |
| `Quantity cannot be blank. LogicUserCode : …`                                                 | `Quantity` is `0` or less.                                                                                                                      | Send a quantity above `0`.                                   |
| `Insufficient Stock ( … ) available for Godown Transfer... Item Code : …`                     | `Godown_From` has less free stock of the item (in the lots you named) than the quantity; the stock found is in brackets.                        | Send at most that quantity, or check the lot fields.         |
| `Modification rights not available for this date.....`                                        | `GT_Date` is on or before the lock date of the API site's Logic ERP user.                                                                       | Send a later date or ask your Logic ERP team.                |
| `This document date is before/equal to Last Physical Stock Entry Date:…`                      | A physical stock entry of the branch is dated on or after `GT_Date`, and the API site's Logic ERP user has the physical-stock lock switched on. | Send a later date.                                           |
| A message saying the prefix allows a maximum of 4 characters, followed by the length you sent | `GT_Prefix` is longer than 4 characters. Nothing was saved.                                                                                     | Send a prefix of at most 4 characters.                       |
| `GT_Prefix cannot contain an apostrophe (')...Please Check`                                   | `GT_Prefix` contains a `'`. Nothing was saved.                                                                                                  | Send a prefix without an apostrophe.                         |
| `Godown Transfer could not be saved...`                                                       | Saving stopped inside Logic ERP without a reason; nothing was saved.                                                                            | Retry once; 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. |


---

# 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/inventory/push/godown-transfer.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.
