> 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/payroll/pull/get-employee-discount-balance.md).

# Get Employee Discount Balance

Returns an employee's **Employee Discount Program** details: which scheme applies, the scheme's discount %, its bill, month and year limits, how much has been **used** and how much is **left**, and any brand or item-group discount %. Use it before giving an employee a discount in your app or online store – for example to show the employee their balance, or to cap the discount – and then record the discount with **Record Employee Discount**. It only reads data; nothing is saved.

### **Endpoint**

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

Although it only reads data, this endpoint answers like a Push endpoint (`Status`, `Message`, `LastSavedCode`, `request_ID`, plus `Result`), not with `GetData`. It does not use the change-log bookmark or date fields. 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.

| Field          | Type | Required | Default | Meaning                                                                                                                                                         |
| -------------- | ---- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `RCU_MobileNo` | text | Yes      | –       | The employee's mobile number. Employees are registered in Logic ERP as **retail customers**; this must match the mobile number of that retail customer exactly. |
| `Ext_APP_Code` | text | Yes      | –       | A short code that names your app, for example `"STAFFAPP"`. It must be filled, but it does not change the answer.                                               |

`OrderNo` and `Discount_Rs` are accepted but ignored.

### **Rules Logic ERP applies**

* **Program switched on.** The Employee Discount Program must be active in your Logic ERP and its configuration saved (see the messages).
* **Finding the employee.** The retail customer whose mobile number is exactly `RCU_MobileNo`. If more than one retail customer has that number, one of them is used and you cannot choose which.
* **Finding the scheme.** Logic ERP takes the first **active** employee discount scheme it finds for the employee:
  * a scheme the employee is linked to individually, or
  * a scheme set up for the employee's **retail customer group** (the group level is chosen in the program's configuration; level 1 when not set), unless the employee is excluded from that scheme. A scheme that has employees linked to it individually applies only to those employees, not to the whole group.
* **Used and left.** "Used" adds up every employee discount recorded for this employee – through Record Employee Discount from any app, and on bills made in Logic ERP itself:

  * month = the current calendar month, by today's date on the Logic ERP server;
  * year = the current financial year (for example April to March).

  `MonthBalance` and `YearBalance` are the limit minus the amount used. A limit of `0` means no limit; the balance is then `0` too – it does not mean nothing is left. A balance can be negative when more was given than the limit allows (for example after the limit was lowered).
* Branches do not apply: the figures cover all branches.
* `LastSavedCode` is always `0` and `request_ID` is always empty for this endpoint.
* When the program is not switched on or not configured, the employee is not found, or no scheme applies, the response has `Status: false`; the reason is in `Message` and `Result.StatusCode` is `1`.
* When `RCU_MobileNo` or `Ext_APP_Code` is missing, the response has `Status: false`; the reason is in `Message` and in `Result.Message` (for example `Ext_APP_Code Cannot allow null..`), and `Result.StatusCode` is `1`.

### **Example request**

```json
{
  "RCU_MobileNo": "9876501234",
  "Ext_APP_Code": "STAFFAPP"
}
```

### **Response**

| Field           | Meaning for this endpoint                                                                                                                                                 |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Status`        | `true` when the scheme was found and `Result` holds the figures. `false` otherwise: a required field was missing, or the program, the employee or a scheme was not found. |
| `Message`       | `Success.` when the scheme was found; otherwise the reason.                                                                                                               |
| `LastSavedCode` | Always `0`.                                                                                                                                                               |
| `request_ID`    | Always empty.                                                                                                                                                             |
| `Result`        | The employee's scheme, limits and balance – see below. When a required field was missing, `Result.StatusCode` is `1` and `Result.Message` holds the reason.               |

**`Result`**

| Field              | Type   | Meaning                                                                                                                                        |
| ------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `StatusCode`       | number | `0` = found; the figures below are valid. `1` = not found or not possible, also when a required field was missing; the reason is in `Message`. |
| `Message`          | text   | `Success.` or the reason.                                                                                                                      |
| `SchemeCode`       | number | Logic ERP's number of the employee discount scheme.                                                                                            |
| `SchemeName`       | text   | Name of the scheme.                                                                                                                            |
| `DiscP`            | number | The scheme's discount %.                                                                                                                       |
| `BillLimit`        | number | Most discount allowed on one bill, in ₹. `0` = no limit.                                                                                       |
| `MonthLimit`       | number | Most discount allowed in a calendar month, in ₹. `0` = no limit.                                                                               |
| `YearLimit`        | number | Most discount allowed in a financial year, in ₹. `0` = no limit.                                                                               |
| `MonthLimitUsed`   | number | Discount used this month, in ₹.                                                                                                                |
| `YearLimitUsed`    | number | Discount used this financial year, in ₹.                                                                                                       |
| `MonthBalance`     | number | Left for this month, in ₹. `0` when there is no month limit.                                                                                   |
| `YearBalance`      | number | Left for this financial year, in ₹. `0` when there is no year limit.                                                                           |
| `LstCompGroupDisc` | list   | Discount % the scheme gives for particular brands (companies) or item groups. Empty when the scheme has none. See below.                       |

**`LstCompGroupDisc`**

| Field                    | Type         | Meaning                                                                                                      |
| ------------------------ | ------------ | ------------------------------------------------------------------------------------------------------------ |
| `CodeType`               | text         | `COMP` = for a company (brand), `GROUP` = for an item group, `COMPGROUP` = for an item group of one company. |
| `CompCode`, `CompName`   | number, text | The company (brand); `0` and empty for `GROUP`.                                                              |
| `GroupCode`, `GroupName` | number, text | The item group; `0` and empty for `COMP`.                                                                    |
| `DiscP`                  | number       | Discount % for that company or group.                                                                        |

The largest discount you can give on one bill is the smallest of `BillLimit`, `MonthBalance` and `YearBalance`, counting only the limits that are above `0`.

### **Example response**

```json
{
  "Result": {
    "StatusCode": 0,
    "Message": "Success.",
    "SchemeCode": 3,
    "SchemeName": "STORE STAFF 2026",
    "YearLimit": 20000.0000,
    "MonthLimit": 3000.0000,
    "BillLimit": 1500.0000,
    "YearLimitUsed": 6700.0,
    "MonthLimitUsed": 1350.0,
    "YearBalance": 13300.0000,
    "MonthBalance": 1650.0000,
    "DiscP": 10.0000,
    "LstCompGroupDisc": [
      {
        "GroupCode": 0,
        "GroupName": "",
        "CompCode": 214,
        "CompName": "URBAN STEP",
        "CodeType": "COMP",
        "DiscP": 15.0
      }
    ]
  },
  "Status": true,
  "Message": "Success.",
  "LastSavedCode": 0,
  "request_ID": ""
}
```

### **Messages you may see**

| Message                                                                  | Status  | Meaning                                                             | What to do                                                               |
| ------------------------------------------------------------------------ | ------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `Success.`                                                               | `true`  | The scheme was found; `Result` holds the figures.                   | –                                                                        |
| `RCU_MobileNo Cannot allow null..` or `Ext_APP_Code Cannot allow null..` | `false` | That field is missing or empty.                                     | Send the field.                                                          |
| `Employee Discount program not activated...`                             | `false` | The Employee Discount Program is not switched on in your Logic ERP. | Ask your Logic ERP support team.                                         |
| `Employee Discount Program Configuration not defined.`                   | `false` | The program's configuration has not been saved in Logic ERP.        | Ask your Logic ERP team to complete the configuration.                   |
| `Customer not found.`                                                    | `false` | No retail customer has exactly this mobile number.                  | Check the number.                                                        |
| `Employee Discount Program not found.`                                   | `false` | No active scheme applies to this employee.                          | Ask your Logic ERP team to link the employee or their group to a scheme. |
| Any other message with `Result.StatusCode` `1`                           | `false` | A database error while reading the scheme.                          | Try again; if it continues, contact 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/payroll/pull/get-employee-discount-balance.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.
