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
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.
Request fields
Field names are not case-sensitive.
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).
MonthBalanceandYearBalanceare the limit minus the amount used. A limit of0means no limit; the balance is then0too – 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.
LastSavedCodeis always0andrequest_IDis always empty for this endpoint.
Known issue – a refusal comes back with
Status: true. When the program is not switched on or not configured, the employee is not found, or no scheme applies, the response hasStatus: true; the reason is inMessageandResult.StatusCodeis1. Use the figures only whenStatusistrueandResult.StatusCodeis0.
Known issue – a missing field gives a technical message. When
RCU_MobileNoorExt_APP_Codeis missing,StatusisfalseandMessagestarts with technical text, followed on the same line by the reason (for exampleExt_APP_Code Cannot allow null..) and then more technical lines.
Example request
Response
Status
true when the request was handled – also check Result.StatusCode (see the known issue). false when a required field was missing.
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 0 and Result.Message is null – go by Status.
Result
StatusCode
number
0 = found; the figures below are valid. 1 = not found or not possible; the reason is in Message. Also 0, with every other field empty, when a required field was missing (Status: false).
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
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
Messages you may see
Success.
true
The scheme was found; Result holds the figures.
–
RCU_MobileNo Cannot allow null.. or Ext_APP_Code Cannot allow null.. (inside technical text)
false
That field is missing or empty.
Send the field.
Employee Discount program not activated...
true
The Employee Discount Program is not switched on in your Logic ERP.
Ask your Logic ERP support team.
Employee Discount Program Configuration not defined.
true
The program's configuration has not been saved in Logic ERP.
Ask your Logic ERP team to complete the configuration.
Customer not found.
true
No retail customer has exactly this mobile number.
Check the number.
Employee Discount Program not found.
true
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
true
A database error while reading the scheme.
Try again; if it continues, contact support.
Last updated