Flashpay docs home

For POS apps · Docs

Tap to pay on any Android POS.

Your terminal turns into an NFC tag for the length of a sale. The customer taps their phone, the payment opens in their browser, and they finish the transfer in their own bank app. No app for the customer to install, no card scheme.

The flow

How it works

  1. 01

    Ring up the sale

    Your POS app creates a payment on the Flashpay API for the amount and this device.

  2. 02

    Arm the tap

    The Flashpay HCE SDK makes the terminal serve the payment's checkout link over NFC.

  3. 03

    Customer taps

    Their phone reads the link and opens the checkout in the browser. Nothing to install.

  4. 04

    Customer picks their bank

    Their banking app opens with the payment filled in, and they authorise it there.

  5. 05

    You get the result

    Your app checks the payment's status and prints the receipt.

  6. 06

    Disarm

    Stop serving the link once the sale is done.

Before you start

Sandbox and production

Use the same secret API key as an online integration (see Authentication), in the environment you're calling. Sandbox and production don't share keys, stores or devices.

SandboxProduction
APIhttps://api.sandbox.flashpayweb.comhttps://api.flashpayweb.com
Checkouthttps://pay.sandbox.flashpayweb.comhttps://pay.flashpayweb.com

Once per terminal

Register the device

Each terminal is a device in the merchant portal. Open Devices, add one, and give it:

FieldNotes
Device IDYour own ID for the terminal, e.g. its serial number. Your POS app sends it with every payment.
Typenfc for a tap terminal or sticker, qr for a printed code
Settlement accountBank, account number and account name the money goes to
StoreThe location the device belongs to
LabelA name you'll recognise, e.g. "Till 2"
01

Install the SDK

The Flashpay HCE SDK is on Maven Central as com.flashpayweb:hce-android. It registers its own NFC service, so you don't touch the manifest.

  • Android 5.0 (API 21) or later, on a terminal with NFC card emulation (HCE).
  • Kotlin 1.8+ and JDK 17 to build.
  • HCE doesn't work in the Android emulator: test on the real terminal.
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
    }
}
02

Create a payment

When the cashier rings up a sale, create the payment the same way as online, plus the terminal's deviceId. The response's id is the payment you'll serve on tap.

Call the API from your back office, not from the terminal, so the secret key never sits on a device in the shop. amount is in kobo: NGN 5,000 is 500000. The other fields work as in Create a payment.

POST /api/v1/paymentcURL
curl -X POST https://api.flashpayweb.com/api/v1/payment \
  -H "Authorization: Bearer YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "storeId": "loc_YOUR_STORE_ID",
    "deviceId": "TILL-2",
    "amount": 500000,
    "currency": "NGN",
    "reference": "sale-1042",
    "idempotencyKey": "sale-1042",
    "destinationBankId": "YOUR_BANK_CODE",
    "destinationAccount": "YOUR_ACCOUNT_NUMBER",
    "destinationAccountName": "Your Business Ltd"
  }'
03

Serve it on tap

Call init once, then activate with the payment's checkout link. From then on, any phone held to the terminal opens that link.

CallWhat it does
init(context, callback)Set up the SDK and your callback. Call before activate.
activate(url)Start serving url, the link to serve (not blank).
deactivate()Stop serving it.
isActive()Whether a link is being served.

Use the payment's own link, https://pay.flashpayweb.com/pay/<payment id> (sandbox: pay.sandbox.flashpayweb.com), so each tap opens exactly the sale on screen.

The terminal acts as a standard NFC Forum Type 4 tag (NDEF application D2760000850101), so phones open the link natively, and it doesn't clash with card payment applications on the same terminal.

Kotlin
class CheckoutActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        FlashpayHce.init(this, object : HceCallback {
            override fun onTagRead(url: String) {
                // A phone read the link.
            }
            override fun onDeactivated(reason: DeactivationReason) {
                // LINK_LOSS after every tap is normal: the phone moved away.
            }
            override fun onError(error: HceError) {
                // NfcNotAvailable, NfcDisabled or InvalidUrl
            }
        })
    }

    fun armTap(paymentId: String) {
        // Replaces whatever link was served before
        FlashpayHce.activate("https://pay.flashpayweb.com/pay/$paymentId")
    }

    fun disarm() = FlashpayHce.deactivate()
}
04

Get the result

The customer finishes in their bank app, so the terminal learns the outcome from Flashpay. Check the payment from your back office (every 2 seconds is fine) until it reaches a final status, then print the receipt and call deactivate().

StatusMeaning
OPENWaiting for the customer to tap and pick a bank
IN_PROGRESS, PENDINGThe customer's bank has it
SUCCESSFUL, COMPLETEDPaid: print the receipt
REVERSEDThe bank reversed a paid sale
FAILED, CANCELLED, EXPIREDNot paid: offer to try again

If the customer gives up before picking a bank, cancel the sale from your back office so the link stops working, then call deactivate(). See Cancel a payment: it only works while the payment is still OPEN.

GET /api/v1/payment/{id}cURL
curl https://api.flashpayweb.com/api/v1/payment/PAYMENT_ID \
  -H "Authorization: Bearer YOUR_SECRET_KEY"

No terminal needed

QR and NFC stickers

A printed QR code or an NFC sticker carries a fixed link for one device instead of one payment. It opens a page with the device's settlement account and a bank picker, and the customer enters the amount in their bank app. Good for counters and market stalls without a terminal.

StickerLinkOpens
QR codehttps://pay.flashpayweb.com/qr/<device id>Account details and bank picker
NFC stickerhttps://pay.flashpayweb.com/nfc/<device id>Account details and bank picker

Troubleshooting

ProblemFix
onError: NfcNotAvailableThe terminal doesn't expose Android card emulation. Use a QR code instead.
onError: NfcDisabledAsk the cashier to turn NFC on in Settings.
onError: InvalidUrlThe URL passed to activate() was blank.
The phone does nothing on tapCheck NFC is on in the customer's phone and hold it still on the terminal's NFC area for a second.
The checkout says the payment wasn't foundThe link and the API key are from different environments.