> 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-retail-customers.md).

# Get Retail Customers

Returns **retail customers** (members registered at your stores): name, membership number, mobile number, address, birthday and anniversary, and the customer groups they belong to. Use it to look up a shopper by **mobile number**, for example at checkout in your app or website, or to fetch particular customers by their Logic ERP customer number.

### **Endpoint**

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

The response and the common request fields 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                                                                                                                                                                                                                                                                                                                                                                                                                           |
| -------------------- | ------ | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Mobile_No`          | text   | No       | empty   | One or more mobile numbers separated by commas, for example `"9876543210,9123456780"`. Customers whose mobile number is exactly one of these are returned. Do not put spaces after the commas.                                                                                                                                                                                                                                    |
| `Doc_Codes`          | text   | No       | empty   | Logic ERP's customer numbers (`RCU_Code` in the response), separated by commas, for example `"42961,42965"`.                                                                                                                                                                                                                                                                                                                      |
| `GlobalModifyCode`   | number | No       | `0`     | Your bookmark in the change log, as described in How Every API Call Works, used only when you send neither `Mobile_No` nor `Doc_Codes`: `0` = from the start (or a period, with `DateFrom`/`DateTo`), a number = only customers added or changed after it, `-1` = Logic ERP keeps the bookmark for you. With `Mobile_No` or `Doc_Codes`, send `0`; a `-1` sent with them is treated the same way and does not move your bookmark. |
| `DateFrom`, `DateTo` | date   | No       | –       | A period, as `yyyy-MM-dd`: only customers **registered** in the period are returned. Without `Mobile_No` or `Doc_Codes`, a customer must also have been added or changed in the period. Leave them out when you do not want a period.                                                                                                                                                                                             |

`Branch_Codes_From` and `Doc_Num_Like` have no effect on this endpoint.

### **Rules Logic ERP applies**

* When `Mobile_No` and `Doc_Codes` are both sent, a customer must match both.
* The mobile number must match exactly as stored – no partial match, and a space **before** a number stops it matching.
* One mobile number can belong to more than one customer; all of them are returned.
* Every customer is returned whatever branch registered them – there is no branch filter.
* Customers are listed in order of membership series, then membership number.
* With `Mobile_No`, `Doc_Codes` or a period there is no batch limit: all matching customers come back in one response.
* With the bookmark, each call reads up to **200 change-log lines**; a customer changed several times in that range is returned once. If the batch holds no customer that can be returned, you get *Customer Not Found...* with `Status: true` and a **higher** `LastGlobalModifyCode` – store it and call again. You have caught up when the message is *No Customer found...* and `LastGlobalModifyCode` is the value you sent.
* With `Mobile_No`, `Doc_Codes` or a period, `LastGlobalModifyCode` is `0` – do not store it. With the bookmark, it is your new bookmark.

### **Example request**

```json
{
  "Mobile_No": "9876543210"
}
```

### **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**. Fill `Mobile_No` here. Do not send `"GlobalModifyCode": -1` here – it changes what the sandbox has marked as already sent.

## Get Retail Customers

> Returns retail customers (members registered at your stores): name, membership number, mobile number, address, birthday and anniversary, and the customer groups they belong to. Use it to look up a shopper by mobile number, for example at checkout in your app or website, or to fetch particular customers by their Logic ERP customer number.

```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":{"/GetRetailCustomer":{"post":{"tags":["Masters - Pull"],"operationId":"GetRetailCustomer","summary":"Get Retail Customers","description":"Returns retail customers (members registered at your stores): name, membership number, mobile number, address, birthday and anniversary, and the customer groups they belong to. Use it to look up a shopper by mobile number, for example at checkout in your app or website, or to fetch particular customers by their Logic ERP customer number.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"Mobile_No":{"type":"string","description":"One or more mobile numbers separated by commas, for example `\"9876543210,9123456780\"`. Customers whose mobile number is exactly one of these are returned. Do not put spaces after the commas."},"Doc_Codes":{"type":"string","description":"Logic ERP's customer numbers (`RCU_Code` in the response), separated by commas, for example `\"42961,42965\"`."},"GlobalModifyCode":{"type":"integer","description":"Your bookmark in the change log, as described in How Every API Call Works, used only when you send neither `Mobile_No` nor `Doc_Codes`: `0` = from the start (or a period, with `DateFrom`/`DateTo`), a number = only customers added or changed after it, `-1` = Logic ERP keeps the bookmark for you. With `Mobile_No` or `Doc_Codes`, send `0`; a `-1` sent with them is treated the same way and does not move your bookmark."},"DateFrom":{"type":"string","description":"A period, as `yyyy-MM-dd`: only customers registered in the period are returned. Without `Mobile_No` or `Doc_Codes`, a customer must also have been added or changed in the period. Leave them out when you do not want a period."},"DateTo":{"type":"string","description":"A period, as `yyyy-MM-dd`: only customers registered in the period are returned. Without `Mobile_No` or `Doc_Codes`, a customer must also have been added or changed in the period. Leave them out when you do not want a period."}}}}}},"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":{"RCU_Code":{"type":"integer","description":"Logic ERP's customer number. Use it in `Doc_Codes`."},"MemberShip_Series":{"type":"string","description":"Membership series, for example `\"RT\"`."},"MemberShip_No":{"type":"integer","description":"Membership number within the series. Series and number together make the membership number, for example `RT39362`."},"Title":{"type":"string","description":"Title, for example `\"Mr.\"`. Empty, or a single space, when not recorded."},"First_Name":{"type":"string","description":"Customer's name."},"Middle_Name":{"type":"string","description":"Customer's name."},"Last_Name":{"type":"string","description":"Customer's name."},"Birth_Date":{"type":"string","description":"Date of birth, as text in the server's short date format – for example `15/08/1990` or `15/08/90` – so be ready to parse both. A time is added only when one was stored. Empty when not recorded."},"Anniversary_Date":{"type":"string","description":"Wedding anniversary, written like `Birth_Date`. Empty when not recorded."},"Mobile_No":{"type":"string","description":"Mobile number."},"EMail":{"type":"string","description":"E-mail address."},"Gender":{"type":"string","description":"`\"Male\"`, `\"Female\"` or `\"None\"`. `\"Male\"` is also sent when no gender was recorded."},"Address_1":{"type":"string","description":"Address lines."},"Address_2":{"type":"string","description":"Address lines."},"PinCode":{"type":"string","description":"PIN code."},"CityName":{"type":"string","description":"City. Empty when no city is recorded."},"StateName":{"type":"string","description":"State of that city. `\"(NIL)\"` when the city has no state set, or no city is recorded."},"Telephone_No1":{"type":"string","description":"Other phone numbers."},"Telephone_No2":{"type":"string","description":"Other phone numbers."},"House_No":{"type":"string","description":"House number."},"Profession_":{"type":"string","description":"Logic ERP's number for the customer's profession; `\"0\"` when none is set."},"Marital_Status":{"type":"string","description":"`\"Married\"`, `\"Unmarried\"` or `\"None\"`. `\"Married\"` is also sent when no status was recorded."},"Group_Name_1":{"type":"string","description":"The customer's five retail customer groups (for example loyalty tier or segment). `\"(NIL)\"` when the customer has no group in that position."},"Group_Name_2":{"type":"string","description":"The customer's five retail customer groups (for example loyalty tier or segment). `\"(NIL)\"` when the customer has no group in that position."},"Group_Name_3":{"type":"string","description":"The customer's five retail customer groups (for example loyalty tier or segment). `\"(NIL)\"` when the customer has no group in that position."},"Group_Name_4":{"type":"string","description":"The customer's five retail customer groups (for example loyalty tier or segment). `\"(NIL)\"` when the customer has no group in that position."},"Group_Name_5":{"type":"string","description":"The customer's five retail customer groups (for example loyalty tier or segment). `\"(NIL)\"` when the customer has no group in that position."}}},"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                                                                                                                                                                                           |
| ---------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `RCU_Code`                               | number | Logic ERP's customer number. Use it in `Doc_Codes`.                                                                                                                                               |
| `MemberShip_Series`                      | text   | Membership series, for example `"RT"`.                                                                                                                                                            |
| `MemberShip_No`                          | number | Membership number within the series. Series and number together make the membership number, for example `RT39362`.                                                                                |
| `Title`                                  | text   | Title, for example `"Mr."`. Empty, or a single space, when not recorded.                                                                                                                          |
| `First_Name`, `Middle_Name`, `Last_Name` | text   | Customer's name.                                                                                                                                                                                  |
| `Birth_Date`                             | text   | Date of birth, as text in the server's short date format – for example `15/08/1990` or `15/08/90` – so be ready to parse both. A time is added only when one was stored. Empty when not recorded. |
| `Anniversary_Date`                       | text   | Wedding anniversary, written like `Birth_Date`. Empty when not recorded.                                                                                                                          |
| `Mobile_No`                              | text   | Mobile number.                                                                                                                                                                                    |
| `EMail`                                  | text   | E-mail address.                                                                                                                                                                                   |
| `Gender`                                 | text   | `"Male"`, `"Female"` or `"None"`. `"Male"` is also sent when no gender was recorded.                                                                                                              |
| `Marital_Status`                         | text   | `"Married"`, `"Unmarried"` or `"None"`. `"Married"` is also sent when no status was recorded.                                                                                                     |
| `Address_1`, `Address_2`                 | text   | Address lines.                                                                                                                                                                                    |
| `House_No`                               | text   | House number.                                                                                                                                                                                     |
| `PinCode`                                | text   | PIN code.                                                                                                                                                                                         |
| `CityName`                               | text   | City. Empty when no city is recorded.                                                                                                                                                             |
| `StateName`                              | text   | State of that city. `"(NIL)"` when the city has no state set, or no city is recorded.                                                                                                             |
| `Telephone_No1`, `Telephone_No2`         | text   | Other phone numbers.                                                                                                                                                                              |
| `Profession_`                            | text   | Logic ERP's number for the customer's profession; `"0"` when none is set.                                                                                                                         |
| `Group_Name_1` … `Group_Name_5`          | text   | The customer's five retail customer groups (for example loyalty tier or segment). `"(NIL)"` when the customer has no group in that position.                                                      |

### **Example response**

```json
{
  "GetData": [
    {
      "RCU_Code": 42965,
      "MemberShip_Series": "RT",
      "MemberShip_No": 3466,
      "Title": "Mrs.",
      "First_Name": "Priya",
      "Middle_Name": "",
      "Last_Name": "Sharma",
      "Birth_Date": "15/08/90",
      "Anniversary_Date": "",
      "Mobile_No": "9876543210",
      "EMail": "priya.sharma@example.com",
      "Gender": "Female",
      "Address_1": "12, Lajpat Nagar",
      "Address_2": "Near Central Market",
      "PinCode": "110024",
      "CityName": "NEW DELHI",
      "StateName": "DELHI",
      "Telephone_No1": "",
      "Telephone_No2": "",
      "House_No": "12",
      "Profession_": "0",
      "Marital_Status": "Married",
      "Group_Name_1": "GOLD",
      "Group_Name_2": "(NIL)",
      "Group_Name_3": "(NIL)",
      "Group_Name_4": "(NIL)",
      "Group_Name_5": "(NIL)"
    }
  ],
  "Status": true,
  "Message": "",
  "LastGlobalModifyCode": 0,
  "resultSize": "2 KB"
}
```

### **Messages you may see**

| Message                                                                             | Meaning                                                                                                                                                                 | What to do                                                                                                                        |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| *Customer Not Found...* (with `Status: true`)                                       | No customer matches the mobile numbers or customer numbers you sent. `GetData` is `null`. With the bookmark: this batch held no customer that can be returned.          | Check the number. For a new shopper, register the customer first. With the bookmark, store `LastGlobalModifyCode` and call again. |
| *No Customer found...* (with `Status: true`)                                        | You sent neither `Mobile_No` nor `Doc_Codes`, and nothing has been added to the change log after your bookmark (or in your period). `GetData` is `null`.                | Nothing new – call again later.                                                                                                   |
| `Invalid Date From..`                                                               | You sent neither `Mobile_No` nor `Doc_Codes`, `GlobalModifyCode` was `0`, and `DateFrom` is not a date. **`Status` is `true` here – check `GetData`, which is `null`.** | Send the date as `yyyy-MM-dd`, or leave it out.                                                                                   |
| `Invalid Date To.`                                                                  | You sent neither `Mobile_No` nor `Doc_Codes`, `GlobalModifyCode` was `0`, and `DateTo` is not a date. **`Status` is `true` here – check `GetData`, which is `null`.**   | Send the date as `yyyy-MM-dd`, or leave it out.                                                                                   |
| `If Date From exists then Date To cannot be null..Please Check..`                   | You sent neither `Mobile_No` nor `Doc_Codes`, `DateFrom` was a date and `DateTo` was `null`. **`Status` is `true` here – check `GetData`, which is `null`.**            | Send `Mobile_No` or `Doc_Codes`.                                                                                                  |
| `Date From cannot be greater than Date To...Please Check..`                         | You sent neither `Mobile_No` nor `Doc_Codes`, and `DateFrom` was later than `DateTo`. **`Status` is `true` here – check `GetData`, which is `null`.**                   | Send `Mobile_No` or `Doc_Codes`.                                                                                                  |
| `Invalid code in list: '…'. Only numeric codes are allowed.` (with `Status: false`) | A value in `Doc_Codes` is not a number (the value is shown in place of …). It may be followed by technical detail – read the first line.                                | Send customer numbers only, separated by commas.                                                                                  |
| Another error text (with `Status: false`)                                           | The request could not be read. The reason may come with technical detail – read the first line.                                                                         | Correct the request. 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-retail-customers.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.
