Skip to main content

Set Up Virtual Collection (Static QR)

A Funding Method is a persistent collection method attached to an account — a static QRPH code and/or virtual account number that remains active until you archive it. Use this for:

  • A merchant's permanent QR code displayed at their counter
  • A subscriber's persistent billing QR (same code every month)
  • A kiosk's embedded QR printed on the machine

Unlike Payment Intents (single-use, exact amount), Funding Methods accept any amount from any payer at any time.

Prerequisites

Step 1: Create a Funding Method

curl -u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
-X POST "https://api.partners.nextpay.world/v2/accounts/acct_01HXYZ/funding-methods" \
-H "Content-Type: application/json" \
-d '{
"type": "qrph",
"external_id": "merchant-store-qr"
}'

Response

{
"id": "fm_01HXYZ",
"account_id": "acct_01HXYZ",
"type": "qrph",
"status": "active",
"external_id": "merchant-store-qr",
"qr_code": "00020101021226...",
"qr_image_url": "https://api.partners.nextpay.world/v2/accounts/acct_01HXYZ/funding-methods/fm_01HXYZ/qr",
"bank_account": {
"bank_name": "NextPay Partner Bank",
"account_number": "8823456789",
"account_name": "NextPay OPC"
},
"created_at": "2025-11-15T10:00:00Z"
}

Key fields:

  • qr_code — raw QRPH payload string
  • qr_image_url — pre-rendered QR image
  • bank_account — the virtual account number for bank transfer deposits (issued by one of NextAPI's partner banks)

Step 2: Display or print the QR

For a merchant counter display:

<img src="https://api.partners.nextpay.world/v2/accounts/acct_01HXYZ/funding-methods/fm_01HXYZ/qr"
alt="Scan to pay"
width="300" height="300" />
<p>Or transfer to partner bank account: 8823456789</p>

For a kiosk or printed material, download the QR image and embed it in your design. The QR is standard QRPH format compatible with all Philippine bank and e-wallet apps.

Step 3: Handle incoming payment webhooks

When someone pays via this Funding Method, NextAPI sends a funding_method.paid event:

app.post('/webhooks/nextapi', express.raw({ type: 'application/json' }), (req, res) => {
const signature = req.headers['x-nextpay-signature'];

if (!verifySignature(req.body, signature, process.env.WEBHOOK_SECRET)) {
return res.status(401).send('Unauthorized');
}

const event = JSON.parse(req.body);

if (event.type === 'funding_method.paid') {
const { funding_method_id, account_id, amount, payer_reference } = event.data;

// For static QRs, you may need to match by amount or payer_reference
// to know which subscriber or transaction this corresponds to
await handleIncomingPayment({
fundingMethodId: funding_method_id,
accountId: account_id,
amount,
payerReference: payer_reference,
});
}

res.status(200).send('OK');
});
Matching payments to invoices

Unlike Payment Intents (which carry your external_id), static Funding Methods accept any payment. Use the amount and payer_reference fields in the webhook payload to match incoming payments to specific invoices or subscribers in your system.

Step 4: List and manage Funding Methods

List all Funding Methods for an account:

curl -u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
"https://api.partners.nextpay.world/v2/accounts/acct_01HXYZ/funding-methods"

Get a specific Funding Method by external ID:

curl -u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
"https://api.partners.nextpay.world/v2/accounts/acct_01HXYZ/funding-methods/external/merchant-store-qr"

Archive a Funding Method (stops accepting new payments):

curl -u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \
-X POST "https://api.partners.nextpay.world/v2/accounts/acct_01HXYZ/funding-methods/fm_01HXYZ/archive"

Funding Method vs Payment Intent: when to use which

Funding Method (static)Payment Intent (dynamic)
QR typeStatic — same code alwaysDynamic — new code per transaction
AmountAny amount from payerExact amount specified by you
ReusePermanent (until archived)Single-use
Use caseCounter QR, kiosk, recurring billingCheckout, invoice, one-time collection
Payment matchingMatch by amount or payer referenceMatched via external_id

→ See Collections Lifecycle for the full state machine comparison.