> 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/delete-retail-customer-group-discounts.md).

# Delete Retail Customer Group Discounts

Deletes the **item-group discounts** given to a **retail customer** (a cash discount % and a trade discount % on an item group, for a period). The customer is found by **mobile number**. Discounts already used on a sale bill are kept.

There is **no endpoint to create or change** these discounts – they are set up in Logic ERP. This endpoint only removes them.

### **Endpoint**

| Name          | Detail                                           |
| ------------- | ------------------------------------------------ |
| Address       | `https://your-server/api/DeleteRCUGroupDiscount` |
| 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                                                                                                                                                                                                                                                                      |
| ------------ | ------ | ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `MobileNo`   | text   | Yes              | –       | The retail customer's mobile number, exactly as stored in Logic ERP (`Mobile_No` in [Get Retail Customers](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/pull/get-retail-customers.md)), for example `"9876543210"`. |
| `GroupName`  | text   | No               | empty   | Name of an item group. When filled, only the customer's discount on this group is deleted; the group must exist at `GroupLevel`, or the request is refused.                                                                                                                  |
| `GroupLevel` | number | With `GroupName` | `0`     | The group level of `GroupName` – the number in `Group_Name1` … `Group_Name30` of [Get Item Master](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/pull/get-item-master.md) (`2` for `Group_Name2`).                   |

**Ignored** although they exist: `CompanyName`, `UserCode`, `DateFrom`, `DateTo`, `CD_P`, `TD_P`.

### **Rules Logic ERP applies**

* The customer is the retail customer with that mobile number. If several customers share the number, the one with the lowest `RCU_Code` (in Get Retail Customers) is affected.
* **Every** item-group discount of that customer – or, with `GroupName`, the discount on that group – is deleted, except discounts already used on a sale bill. Company-wise discounts and item-wise discounts of the customer are not touched.
* If the customer has no such discount, the call still reports `Discounts Deleted Successfully...`.
* The deletes are done together: if one fails, none are kept.

### **Example request**

```json
{
  "MobileNo": "9876543210"
}
```

### **Response**

* `Status` – `true` when the delete ran; `false` when the request was refused or failed.
* `Message` – `Discounts Deleted Successfully...` when the delete ran; otherwise the reason (see below).
* `LastSavedCode` – always `0`.
* `request_ID` – the ID of this request, as described in How Every API Call Works.

### **Example response**

```json
{
  "Status": true,
  "Message": "Discounts Deleted Successfully...",
  "LastSavedCode": 0,
  "request_ID": "5c1e8a42-7d3b-4f69-b2a0-9e6d4c1f8b37"
}
```

### **Messages you may see**

| Message                                                                                         | Meaning                                                                                                       | What to do                             |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
| `Discounts Deleted Successfully...` (with `Status: true`)                                       | The customer's item-group discounts not used on a sale were deleted (or there were none).                     | Nothing – this is success.             |
| `Invalid Mobile No...` (with `Status: false`)                                                   | `MobileNo` is empty. Nothing was deleted.                                                                     | Send the mobile number.                |
| `Retail Customer not exists against Mobile No. : …` (the number you sent; with `Status: false`) | No retail customer has that mobile number. Nothing was deleted.                                               | Check `MobileNo`.                      |
| `Unable to found Group Name : …` (with `Status: false`)                                         | No item group has that name at `GroupLevel`. Nothing was deleted.                                             | Check `GroupName` and `GroupLevel`.    |
| A technical error (with `Status: false`)                                                        | The delete failed. Nothing was deleted. The reason may be followed by technical detail – read the first line. | 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/delete-retail-customer-group-discounts.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.
