Customer Portal
The Customer Portal is a separate mobile-friendly web site, in Arabic and English, where a customer signs in with their mobile number and a one-time code. The customer sees their invoices and returns (sales, service center and point of sale) with PDF download, their account statement between two dates with PDF download, and their loyalty points, and can chat with support, which reaches the support staff in Nama's chats. Licence: basic-customer-portal.
Installing and connecting
- The portal ships as
customerportal.war. The upgrader installs it into the ERP's Tomcat, and every ERP upgrade keeps it current. Its address is<server>/customerportal/. To give it a host name of its own over HTTPS, see SSL certificate installation. - Create an API Credentials record for the portal (see Nama ERP REST API) and a Customer Portal Configuration (below).
- On first run the portal shows a setup page instead of the sign-in page. It opens only from a browser on the server itself (
http://localhost…). Enter the ERP address (for examplehttp://localhost:8080/erp), the API Key (Client Secret) of the API Credentials record, the code of the Customer Portal Configuration, and a user name and password for cp-admin. - Later,
<portal address>/cp-adminchanges the same settings from any browser after signing in. The API key and the password are never shown there; leaving them empty keeps the current ones. After each save the portal checks that the ERP answers.
The settings are kept in customer-portal.properties in Tomcat's lib folder. Forgotten cp-admin password: on the server, type a new one in clear text after portal.admin.password= in that file; the portal replaces it with its hash the next time it reads the file.
The PDF button opens the invoice link straight on the ERP, so the ERP's /r/ address must be reachable by customers.
Customer Portal Configuration
| Field | Field id | Rule |
|---|---|---|
| Brand Name | brandName | Shown on the sign-in page and the portal's header. Required. |
| Logo, Primary Color, Secondary Color | logo, primaryColor, secondaryColor | The portal's branding. |
| Default Language | defaultLanguage | The portal's language before the customer chooses one. Default Arabic. |
| Default Mobile Country | defaultMobileCountry | The country pre-selected on the sign-in page: a two-letter code such as SA or EG. |
| OTP Notification | otpNotification | The Notification Definition that sends the sign-in code: on Customer, with {otpCode} in its template. The channel and wording come from the definition. |
| Currency | currency | The currency label shown on the statement and the points. Nothing is converted. Required. |
| Invoice Types | invoiceTypes | The document types the portal shows: Invoice Type (invoiceTypes.invoiceType: Sales Invoice, Sales Return, the service center sales invoice and return, the POS sales invoice and return) and Link Template (invoiceTypes.linkTemplate), the PDF link of that type. A type may appear once. Empty: every type whose module is installed, all using Invoice Retriever URL Template. |
| Invoice Retriever URL Template | invoiceRetrieverUrlTemplate | The PDF link for types whose line has no Link Template, written as a template on the invoice, such as https://<server>/erp/r/{retrieverFileId}.pdf (see Invoice Retriever Lines). This field or one Link Template must be filled. |
| Accounts Shown in Account Statement | statementAccounts | Limits the statement to these accounts (statementAccounts.account). Empty: all the customer's accounts. |
| Paid Tolerance | paidTolerance | An invoice counts as paid when its remaining amount is at or below this value. Default 1. |
| Hide Payment State | hidePaymentState | Shows invoices without marking them paid, due or overdue. |
| Show Item Images | showItemImages | Shows each line's item picture. Needs Allow Downloading Attachment Without Authentication in the Global Config. |
| Show Invoice Branch | showInvoiceBranch | Shows the invoice's branch under its code in the invoice list and details. An empty or public branch is not shown. |
| Support Groups | supportGroups | Who answers the support chat (see Support chat). Required. |
Signing in
- The customer types their mobile number. It is matched against the Mobile on the customer's contact info, ignoring spaces, formatting, leading zeros and a stored number without the country code; customers with Customer Deleted (No Portal Access) (
customerDeleted) ticked are left out. Exactly one customer must have that number: none or several refuse the sign-in with This number can't be used to sign in. Please contact {brand}. — «لا يمكن تسجيل الدخول بهذا الرقم. يرجى التواصل مع {brand}.» - The portal sends a 6-digit code through OTP Notification. With no notification chosen, it shows We couldn't send the sign-in code. Please contact {brand}. — «تعذر إرسال رمز الدخول. يرجى التواصل مع {brand}.»
- A code is valid for 5 minutes and allows 5 wrong attempts. A number waits 60 seconds between codes and gets at most 5 codes an hour; the same limits count per customer across every form of their number. Past that: Too many codes were requested for this number. Try again in an hour. — «تم طلب رموز كثيرة لهذا الرقم. حاول مرة أخرى بعد ساعة.»
- The customer stays signed in until 30 days without use.
What the customer sees
- Invoices: the customer's saved, not cancelled documents of the configured types, newest first. Status: paid when the remaining amount is at or below Paid Tolerance, otherwise overdue when the due date has passed, otherwise due. Returns and point-of-sale documents have no due date; returns have no status. Each line shows the item, quantity, unit price and total, the barcode when the code typed on the line differs from the item code, and the item picture with Show Item Images.
- Account statement: this month, the last 3 months, the year to date, or two dates of the customer's choice, both days included. The opening balance is everything before the from date; amounts are the ledger's local-currency amounts, over the accounts in Accounts Shown in Account Statement. Downloadable as PDF.
- Points: the available points and their value, and the 20 latest earn and redeem entries. Points are set up on Setting Up Nama Reward Points.
Support chat
Each Support Groups line has Group Arabic Name, Group English Name, dimensions and an Employee Group (supportGroups.employeeGroup, required). A line applies when its dimensions match the customer's dimensions (an empty or public dimension on either side matches any). Lines that fill no dimension apply only when no other line does. The staff are the users of the employees of every applying line's group. When no staff is found, the customer sees Support is not available right now. Please try again later. — «الدعم غير متاح الآن. حاول لاحقًا.»
The customer's first message opens a group chat in Nama's chats with the customer and the staff, named after the customer and their mobile. A customer has one open chat at a time and starts a new one only after it has ended. The customer or a staff member can press End chat; the chat becomes read-only and shows who ended it and when. Ending chats on the staff side is on Internal chat.
Messages you may see
| Message | Why | What to do |
|---|---|---|
| Fill the Invoice Retriever URL Template, or add an invoice type with a Link Template, so customers can download invoices as PDF — «املأ قالب رابط استرجاع الفاتورة، أو أضف نوع فاتورة له قالب رابط، حتى يتمكن العملاء من تحميل الفواتير بصيغة PDF» | Neither PDF link is filled. | Fill one of them. |
| To show item images, turn on Allow Downloading Attachments Without Authentication in the global configuration — «لعرض صور الأصناف، فعّل خيار "السماح بتحميل المرفقات دون الحاجة إلى التسجيل في نما" في الإعدادات العامة» | Show Item Images is ticked while the Global Config option is off. | Turn the option on, or untick Show Item Images. |
| Default Mobile Country must be a two-letter country code such as SA or EG — «يجب أن تكون دولة رقم الجوال الافتراضية رمز دولة من حرفين مثل SA أو EG» | Default Mobile Country is not a known country code. | Type a two-letter code. |
| Invoice type {0} is repeated at lines {1} and {2} — «نوع الفاتورة {0} مكرر في السطرين {1} و {2}» | The same type is twice in Invoice Types. | Remove one line. |
| Customer Portal Configuration {0} was not found — «إعدادات بوابة العملاء {0} غير موجودة» | The code entered on the portal's setup page or cp-admin names no configuration. | Correct the code in cp-admin. |