> 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/masters/push/edit-branch-tax-group-taxes.md).

# Edit Branch Tax Group Taxes

Sets which **sale or purchase tax type** applies to an **item group** in a **branch tax group**, region by region (for example CGST/SGST, IGST). Name the tax group directly, or name a branch and Logic ERP uses the tax group that branch is linked to. Use it to keep branch-wise GST settings for item groups in step with your system.

### **Endpoint**

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

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

### **Request fields**

| Field                | Type   | Required                             | Default    | Meaning                                                                                                                                                                                                                                                                                                     |
| -------------------- | ------ | ------------------------------------ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `BranchTaxGroupName` | text   | Either this or `BranchCode`          | empty      | Name of the branch tax group, exactly as set up in Logic ERP, for example `"PUNJAB STORES"`. When filled, `BranchCode` is ignored.                                                                                                                                                                          |
| `BranchCode`         | number | Either this or `BranchTaxGroupName`  | `0`        | Logic ERP's branch code (`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)). Used only when `BranchTaxGroupName` is empty: the taxes are written to the tax group that branch is linked to. |
| `TaxType`            | text   | Yes                                  | –          | `"SL"` to set the **sale** tax, `"PU"` to set the **purchase** tax. Capital letters only, no spaces. One request sets one side only.                                                                                                                                                                        |
| `ListTaxRegions`     | list   | No – but nothing is saved without it | empty list | The tax regions to set. See below.                                                                                                                                                                                                                                                                          |

`BranchShortName` is accepted but **ignored**.

**`ListTaxRegions`** – one entry per tax region:

| Field           | Type | Required | Default | Meaning                                                                                                                                                                     |
| --------------- | ---- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `TaxRegionName` | text | Yes      | –       | Name of the tax region as set up in Logic ERP, for example `"CGST/SGST"` or `"IGST"`. Spaces before and after are ignored; capital and small letters are not distinguished. |
| `ListGroups`    | list | **Yes**  | –       | The item groups and their tax type in this region. See below.                                                                                                               |

**`ListGroups`** – one entry per item group:

| Field            | Type | Required                        | Default | Meaning                                                                                                                                                                                                                                                            |
| ---------------- | ---- | ------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `GroupName`      | text | Either this or `GroupShortName` | empty   | Name of the item group (as in `Group_Name1` … `Group_Name30` in [Get Item Master](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/pull/get-item-master.md)). When filled, `GroupShortName` is not looked at. |
| `GroupShortName` | text | Either this or `GroupName`      | empty   | Short name of the item group.                                                                                                                                                                                                                                      |
| `TaxTypeName`    | text | Yes                             | –       | The name of the tax type in Logic ERP – see the rule below.                                                                                                                                                                                                        |

### **Rules Logic ERP applies**

* **A tax group is shared.** The taxes belong to the tax group, not to one branch: every branch linked to the group is affected. Naming a branch only tells Logic ERP which group to change.
* With `BranchCode`, the branch must exist and must be linked to a tax group. With `BranchTaxGroupName`, the name must match a branch tax group in Logic ERP; capital and small letters are not distinguished on a standard installation.
* **How the tax type is found.** Logic ERP looks for a tax type named `TaxTypeName`. If there is none, it looks for `TaxTypeName`, a hyphen, then the item group's name as stored in Logic ERP – for example `TaxTypeName` `"GST 5%"` with group `"FOOTWEAR"` finds a tax type named `GST 5%` or, failing that, `GST 5%-FOOTWEAR`. The tax type must also be of the side you chose (`TaxType`) and of the same GST kind as the region (CGST/SGST, IGST or non-GST).
* **One group level per tax group.** All item groups in one tax group must come from the same group level (for example all from level 2). If the tax group already has sale taxes (for `"SL"`) or purchase taxes (for `"PU"`) set for groups of another level, the request is refused. This also applies within one request: send groups of one level only.
* Item groups are matched by name or short name across all group levels; spaces before and after are ignored. If the same name is used at more than one level, Logic ERP takes one of them – use a name that is unique. Fill `GroupName` or `GroupShortName` on every line: a line with both empty is refused with `Invalid Group Name :` .
* For each group, only the tax of the region and side you sent is set. Other regions, and the other side (sale or purchase), keep their values. A group that has no taxes in the tax group yet is added.
* Lines are processed in order and saved together at the end. If a line is refused, or anything fails while saving, nothing of the request is kept – correct it and send the whole request again. Sending the same lines twice is safe – each one simply sets the same tax again.
* An empty `ListTaxRegions` saves nothing and is not reported. A region with an empty or missing `ListGroups` is refused with `Groups not defined...`.

> **Known issue – a missing `TaxType` gives an incomplete message.** Leaving `TaxType` out answers `Invalid Tax Type :` with nothing after it.

### **Example request**

```json
{
  "BranchCode": 4,
  "TaxType": "SL",
  "ListTaxRegions": [
    {
      "TaxRegionName": "CGST/SGST",
      "ListGroups": [
        { "GroupName": "FOOTWEAR", "TaxTypeName": "GST 5%" },
        { "GroupName": "APPAREL", "TaxTypeName": "GST 12%" }
      ]
    },
    {
      "TaxRegionName": "IGST",
      "ListGroups": [
        { "GroupName": "FOOTWEAR", "TaxTypeName": "IGST 5%" }
      ]
    }
  ]
}
```

For this request Logic ERP looks for sale tax types named `GST 5%`, `GST 12%` (CGST/SGST kind) and `IGST 5%` (IGST kind) – or, where one of these does not exist, `GST 5%-FOOTWEAR`, `GST 12%-APPAREL` and `IGST 5%-FOOTWEAR`.

### **Response**

* `Status` – `true` when all lines were saved.
* `Message` – empty when saved; otherwise the reason (see below).
* `LastSavedCode` – always `0`.
* `request_ID` – filled once the tax group and `TaxType` have been accepted. When the request is refused before that it is `null`.

### **Example response**

```json
{
  "Status": true,
  "Message": "",
  "LastSavedCode": 0,
  "request_ID": "b7e0d2a4-1c9f-4a3e-8d65-2f4a9c0e7b13"
}
```

### **Messages you may see**

| Message                                                                                             | Meaning                                                                                                                               | What to do                                                                    |
| --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `Branch Code is missing...`                                                                         | Neither `BranchTaxGroupName` nor `BranchCode` was sent.                                                                               | Send one of them.                                                             |
| `Invalid Branch Code...`                                                                            | No branch has this `BranchCode`.                                                                                                      | Check the code with Get Branch Info.                                          |
| `Branch Tax Group Not Defined...`                                                                   | The branch is not linked to a tax group, or no tax group has the name you sent.                                                       | Check the name, or ask your Logic ERP team to link the branch to a tax group. |
| `Invalid Tax Type : …` (the `TaxType` you sent)                                                     | `TaxType` is not exactly `SL` or `PU`.                                                                                                | Send `"SL"` or `"PU"`.                                                        |
| `Invalid Tax Region Name : …`                                                                       | The region name is empty or not found. Nothing was saved.                                                                             | Check the region name in Logic ERP.                                           |
| `Groups not defined...`                                                                             | A region was sent with an empty or missing `ListGroups`. Nothing was saved.                                                           | Send the groups for every region.                                             |
| `Invalid Group Name : …`                                                                            | No item group has this name (or short name), or the line has neither. Nothing was saved.                                              | Check the group.                                                              |
| `Records Exist For Other Group Levels - ( …)` (the other level numbers)                             | The tax group already has taxes of this side for groups of another level. Nothing was saved.                                          | Use groups of the level already in use, or ask your Logic ERP team.           |
| `Invalid Tax Type : …` (the tax type name Logic ERP looked for last, for example `GST 5%-FOOTWEAR`) | No tax type of this side and GST kind is named `TaxTypeName`, or `TaxTypeName` with a hyphen and the group's name. Nothing was saved. | Check the tax type names in Logic ERP.                                        |
| A technical error (with `Status: false`)                                                            | Something failed while saving. Nothing was saved.                                                                                     | Correct the request and send it again.                                        |


---

# 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/masters/push/edit-branch-tax-group-taxes.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.
