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
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.
Known issue – the change bookmark does not work here. A request with neither
Mobile_NonorDoc_Codesdoes not return only new or changed customers. IfGlobalModifyCodeis not0, orDateFromandDateToare sent asnull, it returns every retail customer on every call. IfGlobalModifyCodeis0and the dates are left out, it returns no data and the message Invalid Date From.. instead. Always sendMobile_NoorDoc_Codes.
Known issue – a date period makes the call fail. When
DateFromandDateToare both dates, the call fails (Status: false), with or withoutMobile_No/Doc_Codes. LeaveDateFromandDateToout.
Request fields
Mobile_No
text
One of Mobile_No / Doc_Codes
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
One of Mobile_No / Doc_Codes
empty
Logic ERP's customer numbers (RCU_Code in the response), separated by commas, for example "42961,42965".
GlobalModifyCode
number
No
0
Does not change which customers are returned. A value above 0 is only echoed back in LastGlobalModifyCode.
DateFrom, DateTo
date
No
–
Leave them out when you send Mobile_No or Doc_Codes (see the Known issue notes above).
Branch_Codes_From and Doc_Num_Like have no effect on this endpoint.
Rules Logic ERP applies
When
Mobile_NoandDoc_Codesare 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.
There is no batch limit: all matching customers come back in one response.
LastGlobalModifyCodeis0, or theGlobalModifyCodeyou sent when that is above0. Do not store it.
Example request
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. Always fill Mobile_No here – without it the sandbox sends back its whole customer list (see the known issues on this page).
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.
The user name and password of your API site.
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.
Logic ERP's customer numbers (RCU_Code in the response), separated by commas, for example "42961,42965".
Does not change which customers are returned. A value above 0 is only echoed back in LastGlobalModifyCode.
Leave them out when you send Mobile_No or Doc_Codes (see the Known issue notes above).
Leave them out when you send Mobile_No or Doc_Codes (see the Known issue notes above).
Always HTTP 200. Check Status, Message and GetData.
See the Status rules on this page and on How Every API Call Works.
Why the call failed, or a note. The reason may be followed by technical detail - read the first line.
The change-log bookmark (see How Every API Call Works).
Size of the answer, for example "2 KB".
No login was sent.
POST /api/GetRetailCustomer HTTP/1.1
Host: demo.logicerp.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 26
{
"Mobile_No": "9876543210"
}{
"GetData": [
{
"RCU_Code": 1,
"MemberShip_Series": "text",
"MemberShip_No": 1,
"Title": "text",
"First_Name": "text",
"Middle_Name": "text",
"Last_Name": "text",
"Birth_Date": "text",
"Anniversary_Date": "text",
"Mobile_No": "text",
"EMail": "text",
"Gender": "text",
"Address_1": "text",
"Address_2": "text",
"PinCode": "text",
"CityName": "text",
"StateName": "text",
"Telephone_No1": "text",
"Telephone_No2": "text",
"House_No": "text",
"Profession_": "text",
"Marital_Status": "text",
"Group_Name_1": "text",
"Group_Name_2": "text",
"Group_Name_3": "text",
"Group_Name_4": "text",
"Group_Name_5": "text"
}
],
"Status": true,
"Message": "text",
"LastGlobalModifyCode": 1,
"resultSize": "text"
}Response fields
Each record in GetData:
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
Messages you may see
Customer Not Found... (with Status: true)
No customer matches the mobile numbers or customer numbers you sent. GetData is null.
Check the number. For a new shopper, register the customer first.
Invalid Date From..
You sent neither Mobile_No nor Doc_Codes, and DateFrom was left out or is not a date. Status is true here – check GetData, which is null.
Send Mobile_No or Doc_Codes.
Invalid Date To.
You sent neither Mobile_No nor Doc_Codes, and DateTo was left out or is not a date. Status is true here – check GetData, which is null.
Send Mobile_No or Doc_Codes.
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.
A message containing Conversion failed when converting character string to smalldatetime data type. (with Status: false)
DateFrom and DateTo were both dates (see the Known issue note above). The reason may come with technical detail – read the first line.
Leave DateFrom and DateTo out.
Another error text (with Status: false)
The request could not be read – for example a Doc_Codes value that is not a list of numbers. 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.