Skip to main content
SMS templates define how OwnPay matches incoming payment confirmation SMS from the companion app to pending transactions. Each template binds a gateway to a regex pattern that extracts the payment amount and transaction ID from the SMS text.
The companion app’s on-device privacy filter ensures only incoming payment receipt SMS (for example, bKash/Nagad/Rocket confirmations) are forwarded. OTP messages, personal SMS, and all other non-payment SMS are never sent to the server, so templates only ever process payment confirmation messages.
For the full end-to-end auto-verification flow, see SMS Verification.

Template structure

Each SMS template has these fields:

Creating a template

1
Navigate to Mobile > SMS Templates and click Add Template.
2
Select the Gateway from the dropdown. This ensures the template only matches SMS for transactions on that gateway.
3
Enter a Regex Pattern that captures the payment details. For example, a bKash payment confirmation SMS might look like:
You would use a pattern like: Tk ([\d,.]+) received.*TrxID: (\w+) to capture the amount and transaction ID.
4
Set the Code Field Mapping to the capture group index that contains the extracted value (usually 1).
5
Click Save to activate the template.

Testing regex patterns

Use the built-in Regex Tester at the bottom of the template form. Paste a sample SMS message into the test input, and the tester highlights which capture groups match in real time.
Always test your regex against multiple real SMS samples before going live. Banks occasionally change their message format, which can break existing templates.

SMS logs

The lower section of the SMS Templates page displays recent incoming payment SMS logs forwarded by the companion app. Use this to:
  • Search by phone number or transaction ID
  • Filter by gateway or match status (matched, unmatched, ignored)
  • View raw SMS by clicking any log row to see the full message text
Unmatched SMS appear with a red indicator. Review these regularly to identify new message formats that need a template update.

Editing and disabling templates

Click a template’s row to edit it. If a gateway changes its SMS format, update the regex pattern and use the tester to confirm it still works. You can disable a template without deleting it - this is useful for temporarily pausing verification for a specific gateway.
Last modified on August 25, 2026