SMS match templates are the intelligence layer of OwnPay’s mobile payment automation. When a paired Android device forwards an incoming wallet notification to the server, OwnPay needs to know which gateway the message belongs to and how to extract the payment amount and transaction ID from the raw SMS text. Templates define these rules using regular expressions (regex), sender identifiers, and priority ordering. A well-configured set of templates means your manual wallet gateways — bKash, Nagad, Rocket, and others — confirm payments automatically without any staff intervention.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/own-pay/OwnPay-Documentation/llms.txt
Use this file to discover all available pages before exploring further.
Navigating to SMS Templates
In the OwnPay admin dashboard, expand the MOBILE & SMS section in the left sidebar and click SMS Centre. The SMS Centre opens with the templates list, creation form, and testing tools.How Templates Work
When an SMS arrives from a paired device, the server runs it through the template evaluation engine:- The message’s sender identifier (the “From” field) is matched against each template’s Sender Pattern.
- The first template whose sender pattern matches (ordered by Priority) is selected.
- The template’s Amount Regex and Transaction ID Regex are applied to the message body using capture group
(1)to extract the values. - The extracted Transaction ID is matched against open
pendingtransactions on the server. - If a match is found and the amount aligns, the transaction is automatically marked
completed.
Template Fields
| Field | Required | Example | Description |
|---|---|---|---|
| Gateway | Yes | Nagad Personal | The manual gateway this template serves. Matched transactions are approved against this gateway’s pending checkouts. |
| Sender Pattern | Yes | NAGAD | The SMS sender identifier. Case-sensitive. Must match the “From” field of the wallet provider’s SMS exactly. |
| Priority | No | 10 | Evaluation order (1–999). Lower numbers are evaluated first. Use priority to resolve conflicts when multiple templates could match the same sender. |
| Amount Regex | Yes | Amount: Tk ([\d\.]+) | Regex with a capture group (1) that extracts the payment amount from the message body. |
| Transaction ID Regex | No | TxID: (\w+) | Regex with a capture group (1) that extracts the unique Transaction ID from the message body. |
| Sender Account Regex | No | Customer: (01\d{9}) | Regex with a capture group (1) that extracts the customer’s phone number from the message body. Optional but useful for cross-referencing. |
| Status | Yes | Active | Active templates are evaluated; Inactive templates are skipped. |
All regex patterns must include parentheses
() to designate a capture group. OwnPay extracts the value matched inside group (1). A pattern without parentheses will cause parsing failure — for example, use Amount: Tk ([\d\.]+) rather than Amount: Tk [\d\.]+.Creating a Template Manually
Open the SMS Centre and click + New Template
Navigate to Mobile & SMS → SMS Centre and click the + New Template button to open the creation form.
Select the target gateway
Open the Gateway dropdown and select the manual gateway this template will serve (e.g.
Nagad Personal). Matched transactions will be looked up against pending checkouts on this gateway.Set the sender pattern
Enter the Sender Pattern exactly as it appears in the SMS “From” field for this wallet provider (e.g.
NAGAD for Nagad, bKash for bKash). Remember that this field is case-sensitive.Write the amount regex
In the Amount Regex field, enter a regex pattern that captures the payment amount in group
(1). For example: Amount: Tk ([\d,]+\.?\d*) captures the amount from “Amount: Tk 1,500.00”.Write the transaction ID regex
In the Transaction ID Regex field, enter a pattern that captures the unique TrxID in group
(1). For example: TxID: (\w+) captures the ID from “TxID: 12A34B56C7”.Set priority and status
Assign a Priority value (lower = evaluated first). Leave Status set to
Active.Testing a Template Against Sample SMS
OwnPay provides a Live Regex Tester sandbox directly in the SMS Centre, allowing you to verify a pattern before saving it as an active template.Scroll to the Live Regex Tester section
On the SMS Centre page, scroll down to the Live Regex Tester panel.
Paste a real SMS message
Paste the full text of an actual wallet SMS into the SMS Body textbox. Use a real message to ensure your pattern accounts for the exact formatting the provider uses.
Enter your regex pattern
Type your capture group regex in the Regex Pattern input (e.g.
TxID: (\w+)).Select the target field
Choose the field you are testing from the Field dropdown —
Amount, Transaction ID, or Sender Account.Alternative Template Creation Methods
OwnPay offers two additional methods for creating templates if you are unfamiliar with regex syntax:Smart SMS Parser — Heuristic Analysis (Method B)
Smart SMS Parser — Heuristic Analysis (Method B)
Paste a sample SMS message into the Smart SMS Parser section. The system analyses the message structure using heuristic rules and suggests a pre-built regex template. Review the suggested patterns, adjust if needed, and click Use Template to populate the creation form automatically.
AI Prompt Generator (Method C)
AI Prompt Generator (Method C)
Click Generate AI Prompt to produce a structured prompt you can copy and paste into an AI assistant such as ChatGPT, Gemini, or Claude. The AI translates your sample SMS text into a JSON parsing block that maps directly to OwnPay’s template fields. Paste the AI’s output into the creation form to populate all regex fields at once.
Templates List View
The templates table shows all active and inactive parsing rules:| Column | Description |
|---|---|
| Gateway | The manual gateway this template is bound to. |
| Sender Pattern | The “From” identifier matched against incoming SMS sender fields. |
| Amount Regex | The capture pattern used to extract the payment amount. |
| TrxID Regex | The capture pattern used to extract the Transaction ID. |
| Priority | Evaluation order — lower numbers run first. |
| Status | Active (evaluated) or Inactive (skipped). |
| Actions | Edit modifies the template; Delete removes it permanently. |