> ## Documentation Index
> Fetch the complete documentation index at: https://ownpay.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> OwnPay is licensed under AGPL-3.0 and is completely free - no licensing fees.
> Production docs URL: https://ownpay.org/docs - append .md to any page URL for clean markdown.
> OwnPay requires PHP 8.3+, MySQL/MariaDB, and Redis.
> MCP server available at https://ownpay.org/docs/mcp for programmatic documentation queries.
> Use root-relative links (e.g. /quickstart) for internal navigation - do NOT include /docs prefix.
> Plugin development: consult /developer/plugins/ pages for correct interfaces and manifests.
> Canonical locations: API auth = /api/authentication, webhook verification = /api/webhooks, rate limits = /resources/rate-limiting, transaction statuses = /fundamentals/payment-flow.
> The documentation uses the Diataxis framework: Tutorials (learning), How-to (tasks), Reference (lookup), Explanation (understanding).

# SMS auto-verification

> How to set up SMS-based automatic verification for manual and mobile money payments using the OwnPay companion app.

SMS auto-verification lets OwnPay confirm manual payments without you lifting a finger. When a customer pays via a mobile wallet or bank, the payment confirmation SMS is forwarded to OwnPay, parsed, and matched to the pending transaction.

<Note>
  **Privacy scope:** The companion app only forwards **incoming** SMS that look like payment transaction confirmations (for example, bKash/Nagad/Rocket receipts). It applies an **on-device privacy filter** that silently discards all other SMS—including OTP codes, verification codes from other services, promotional messages, and personal messages. These non-payment SMS are **never sent to your OwnPay server**.
</Note>

## How it works

```mermaid theme={"theme":{"light":"github-light","dark":"github-dark"}}
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#0F97ED','primaryTextColor':'#ffffff','primaryBorderColor':'#102963','lineColor':'#102963','secondaryColor':'#E8F4FD','tertiaryColor':'#F0F7FF','noteBkgColor':'#E8F4FD','noteTextColor':'#102963','noteBorderColor':'#0F97ED'}}}%%
flowchart LR
    A[Customer pays
via mobile wallet] --> B[Wallet sends
confirmation SMS]
    B --> C[Companion app
receives SMS]
    C --> C2{Privacy filter:
payment SMS?}
    C2 -->|Yes| D[SMS forwarded
to OwnPay server]
    C2 -->|No (OTP, personal, etc.)| X[Silently
discarded on device]
    D --> E{Smart parser
extracts data}
    E -->|Match found| F[Transaction
auto-completed]
    E -->|No match| G[Stays in
awaiting verification]
    E -->|Low confidence| G
```

1. The customer completes a payment and submits the transaction ID at checkout.
2. The wallet provider sends a confirmation SMS to the phone running the companion app.
3. The companion app applies its on-device privacy filter. Only SMS matching payment receipt patterns are forwarded; all other SMS (OTP, personal, promotional) are silently discarded on the device.
4. The companion app forwards the filtered payment SMS to your OwnPay server.
5. The smart parser extracts the **amount** and **transaction ID** from the SMS text.
6. OwnPay matches the extracted data against pending transactions.
7. If the amount and transaction ID match with sufficient confidence, the transaction is automatically completed.

## Prerequisites

Before setting up SMS verification, you need:

* The **OwnPay companion app** installed on an Android phone - see [Companion app](/docs/mobile/companion-app).
* The device **paired** with your OwnPay server - see [Paired devices](/docs/mobile/devices).
* SMS forwarding **enabled** in the companion app settings.
* At least one manual gateway with **Enable SMS Verification** turned on.

## Smart parser

The smart parser extracts payment data from SMS messages using a combination of regex patterns and heuristic rules. It does not require an external AI service.

* **Regex templates** - you define patterns per gateway under [SMS templates](/docs/mobile/sms-templates). Each template specifies how to extract amount, transaction ID, and sender.
* **Heuristic rules** - when no template matches, the parser uses built-in rules to identify common SMS formats (for example "Tk 500 received from...").
* **Confidence scoring** - each parse result gets a confidence score. Only matches above the threshold are auto-completed. Low-confidence matches stay in awaiting-verification for manual review.

## Supported gateways

| Gateway                     | SMS parsing | Template provided | Notes                        |
| --------------------------- | ----------- | ----------------- | ---------------------------- |
| **bKash**                   | Yes         | Yes               | Well-tested, high confidence |
| **Nagad**                   | Yes         | Yes               | Well-tested, high confidence |
| **Rocket**                  | Yes         | Yes               | Template included            |
| **Upay**                    | Yes         | Yes               | Template included            |
| **Bank transfer (generic)** | Partial     | No                | Requires custom template     |

For gateways not listed, you can create a custom SMS template - see [SMS templates](/docs/mobile/sms-templates).

## Troubleshooting

| Problem                            | Cause                                            | Solution                                                                                       |
| ---------------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------- |
| Transactions not auto-completing   | Companion app offline or SMS forwarding disabled | Check the device status on the Paired Devices page                                             |
| Wrong amount extracted             | Regex template does not match the SMS format     | Edit the SMS template and test with a sample message                                           |
| Match found but confidence too low | SMS format changed after a gateway update        | Update the regex template to match the new format                                              |
| Duplicate SMS causing double-match | Same SMS forwarded multiple times                | The system deduplicates by transaction ID; if issues persist, check the companion app settings |

## Related Pages

* [SMS templates](/docs/mobile/sms-templates) - create and manage parsing templates
* [Companion app](/docs/mobile/companion-app) - install and configure the Android app (only forwards incoming payment SMS)
* [Paired devices](/docs/mobile/devices) - pair your phone with the server
* [Manual methods](/docs/gateways/manual-methods) - create manual gateways with SMS verification enabled


## Related topics

- [Manual payment methods](/docs/gateways/manual-methods.md)
- [Frequently Asked Questions](/docs/resources/faq.md)
- [Glossary](/docs/resources/glossary.md)
- [Features and Capabilities](/docs/resources/features.md)
- [SMS Center](/docs/notifications/sms-center.md)
