> 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/pull/get-pending-discount-coupons.md).

# Get Pending Discount Coupons

Returns **discount coupons that can still be used**: coupons not yet redeemed against a sale and not yet expired. Use it to show a shopper the coupons waiting for them (by **mobile number**), or to keep your app's list of open coupons up to date.

### **Endpoint**

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

The response is 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). This endpoint **does not use the change log**: `GlobalModifyCode`, `Doc_Codes`, `Branch_Codes_From` and `Doc_Num_Like` are not read, and `LastGlobalModifyCode` is always `0`. Each call returns every coupon that matches.

### **Request fields**

| Field                | Type | Required | Default | Meaning                                                                                                                                                                         |
| -------------------- | ---- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `MobileNo`           | text | No       | empty   | Only coupons issued to the retail customer(s) with this mobile number. One number only. Note the spelling: `MobileNo`, not `Mobile_No`.                                         |
| `Coupon_Group_Name`  | text | No       | empty   | Only coupons of this coupon group, exact name, for example `"DIWALI 2026"`.                                                                                                     |
| `DateFrom`, `DateTo` | date | No       | empty   | Only coupons **created or changed** in this period (both days included). Write them as `yyyy-MM-dd`. Used only when both are valid dates; otherwise ignored, without a message. |

All filters are optional and combine: a coupon must pass every filter you send. With no filters, every pending coupon is returned.

### **Rules Logic ERP applies**

* **Pending** means: not yet used on a sale, and the expiry date is today or later. Used and expired coupons are not returned.
* Coupons whose start date is still in the future **are** returned – check `Start_Date` before you offer one.
* Coupons with no coupon group are included (their `Coupon_Group_Name` is `"(NIL)"`).
* Without `MobileNo`, coupons not issued to any particular customer are included too (their `RCU_Membership_No` is empty).
* With `MobileNo`, the coupon is matched to the customer through the customer's membership number. If several customers share the mobile number, coupons of all of them are returned.
* There is no branch filter and no batch limit. The order of the records is not fixed.
* A coupon that may be used more than once (`Allow_Unlimited_Use: true`) is left out once it has been used `Allow_Max_Count` times. When `Allow_Max_Count` is `0` it stays in the list however often it is used.

> **Known issue – coupons without an expiry date are left out.** A coupon that has no expiry date entered in Logic ERP is never returned, even when it has not been used. If your company issues coupons without an expiry date, ask your Logic ERP team to give them one so they appear here.

### **Example request**

```json
{
  "MobileNo": "9876543210",
  "Coupon_Group_Name": "",
  "DateFrom": null,
  "DateTo": null
}
```

### **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**. The example lists every pending coupon of the sandbox; fill `MobileNo` or `Coupon_Group_Name` to narrow it.

## Get Pending Discount Coupons

> Returns discount coupons that can still be used: coupons not yet redeemed against a sale and not yet expired. Use it to show a shopper the coupons waiting for them (by mobile number), or to keep your app's list of open coupons up to date.

```json
{"openapi":"3.0.3","info":{"title":"Logic ERP API","version":"1.0"},"tags":[{"name":"Masters - Pull"}],"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":{"/GetRCUPendingCoupons":{"post":{"tags":["Masters - Pull"],"operationId":"GetRCUPendingCoupons","summary":"Get Pending Discount Coupons","description":"Returns discount coupons that can still be used: coupons not yet redeemed against a sale and not yet expired. Use it to show a shopper the coupons waiting for them (by mobile number), or to keep your app's list of open coupons up to date.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"MobileNo":{"type":"string","description":"Only coupons issued to the retail customer(s) with this mobile number. One number only. Note the spelling: `MobileNo`, not `Mobile_No`."},"Coupon_Group_Name":{"type":"string","description":"Only coupons of this coupon group, exact name, for example `\"DIWALI 2026\"`."},"DateFrom":{"type":"string","nullable":true,"description":"Only coupons created or changed in this period (both days included). Write them as `yyyy-MM-dd`. Used only when both are valid dates; otherwise ignored, without a message."},"DateTo":{"type":"string","nullable":true,"description":"Only coupons created or changed in this period (both days included). Write them as `yyyy-MM-dd`. Used only when both are valid dates; otherwise ignored, without a message."}}}}}},"responses":{"200":{"description":"Always HTTP 200. Check Status, Message and GetData.","content":{"application/json":{"schema":{"type":"object","properties":{"GetData":{"type":"array","items":{"type":"object","properties":{"Coupon_Group_Name":{"type":"string","description":"The coupon group. `\"(NIL)\"` when the coupon has no group."},"Discount_Coupon_PreFix":{"type":"string","description":"Prefix of the coupon number."},"Discount_Coupon_Number":{"type":"integer","description":"Running number of the coupon."},"Discount_Coupon_Num":{"type":"string","description":"Full coupon number – prefix followed by number, for example `\"DW1025\"`. This is what the shopper quotes."},"Discount_Coupon_Barcode":{"type":"string","description":"Barcode printed on the coupon. Empty when none."},"Allow_Max_Count":{"type":"integer","description":"How many times a multi-use coupon may be used."},"Start_Date":{"type":"string","description":"First day the coupon may be used, `dd/MM/yyyy` (day/month/four-digit year, for example `31/01/2026`). Empty when not set."},"Expiry_Date":{"type":"string","description":"Last day the coupon may be used, `dd/MM/yyyy`."},"ModifyDate":{"type":"string","description":"Day the coupon was last changed, `dd/MM/yyyy`. Empty when not recorded."},"SchemeRs":{"type":"number","description":"Discount as a fixed amount in ₹. `0` when the coupon gives a percentage instead."},"CD_P":{"type":"number","description":"Discount as a percentage of the bill. `0` when the coupon gives a fixed amount instead."},"Min_Amount":{"type":"number","description":"Minimum bill amount, in ₹, for the coupon to apply."},"Max_Amount_For_CD_P":{"type":"number","description":"The most a percentage discount may come to, in ₹."},"Allow_Unlimited_Use":{"type":"boolean","description":"`true` when the coupon can be used more than once."},"RCU_Membership_No":{"type":"string","description":"Membership number of the customer the coupon was issued to, for example `\"RC10458\"`. Empty when the coupon is not tied to a customer."}}},"nullable":true,"description":"The records found; null when the call failed or nothing was found - read Message."},"Status":{"type":"boolean","description":"See the Status rules on this page and on How Every API Call Works."},"Message":{"type":"string","description":"Why the call failed, or a note. The reason may be followed by technical detail - read the first line."},"LastGlobalModifyCode":{"type":"integer","description":"The change-log bookmark (see How Every API Call Works)."},"resultSize":{"type":"string","description":"Size of the answer, for example \"2 KB\"."}}}}}},"401":{"description":"No login was sent."}}}}}}
```

### **Response fields**

Each record in `GetData`:

| Field                     | Type         | Meaning                                                                                                                               |
| ------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------- |
| `Coupon_Group_Name`       | text         | The coupon group. `"(NIL)"` when the coupon has no group.                                                                             |
| `Discount_Coupon_PreFix`  | text         | Prefix of the coupon number.                                                                                                          |
| `Discount_Coupon_Number`  | number       | Running number of the coupon.                                                                                                         |
| `Discount_Coupon_Num`     | text         | Full coupon number – prefix followed by number, for example `"DW1025"`. This is what the shopper quotes.                              |
| `Discount_Coupon_Barcode` | text         | Barcode printed on the coupon. Empty when none.                                                                                       |
| `RCU_Membership_No`       | text         | Membership number of the customer the coupon was issued to, for example `"RC10458"`. Empty when the coupon is not tied to a customer. |
| `CD_P`                    | number       | Discount as a percentage of the bill. `0` when the coupon gives a fixed amount instead.                                               |
| `SchemeRs`                | number       | Discount as a fixed amount in ₹. `0` when the coupon gives a percentage instead.                                                      |
| `Max_Amount_For_CD_P`     | number       | The most a percentage discount may come to, in ₹.                                                                                     |
| `Min_Amount`              | number       | Minimum bill amount, in ₹, for the coupon to apply.                                                                                   |
| `Allow_Unlimited_Use`     | true / false | `true` when the coupon can be used more than once.                                                                                    |
| `Allow_Max_Count`         | number       | How many times a multi-use coupon may be used.                                                                                        |
| `Start_Date`              | text         | First day the coupon may be used, `dd/MM/yyyy` (day/month/four-digit year, for example `31/01/2026`). Empty when not set.             |
| `Expiry_Date`             | text         | Last day the coupon may be used, `dd/MM/yyyy`.                                                                                        |
| `ModifyDate`              | text         | Day the coupon was last changed, `dd/MM/yyyy`. Empty when not recorded.                                                               |

### **Example response**

```json
{
  "GetData": [
    {
      "Coupon_Group_Name": "DIWALI 2026",
      "Discount_Coupon_PreFix": "DW",
      "Discount_Coupon_Number": 1025,
      "Discount_Coupon_Num": "DW1025",
      "Discount_Coupon_Barcode": "DW0001025",
      "Allow_Max_Count": 0,
      "Start_Date": "20/10/2026",
      "Expiry_Date": "15/11/2026",
      "ModifyDate": "20/10/2026",
      "SchemeRs": 500.0,
      "CD_P": 0.0,
      "Min_Amount": 2000.0,
      "Max_Amount_For_CD_P": 0.0,
      "Allow_Unlimited_Use": false,
      "RCU_Membership_No": "RC10458"
    }
  ],
  "Status": true,
  "Message": "",
  "LastGlobalModifyCode": 0,
  "resultSize": "1 KB"
}
```

### **Messages you may see**

| Message                                     | Meaning                                                                                                                   | What to do                                                     |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| *No Record Found...* (with `Status: false`) | No pending coupon matches the request. Unlike most endpoints, `Status` is `false` here even though the request was valid. | Treat it as "no coupons". Do not treat it as an error.         |
| Another error text (with `Status: false`)   | The request could not be processed.                                                                                       | If it continues, send the text to your Logic ERP support team. |


---

# 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/pull/get-pending-discount-coupons.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.
