Collect a Payment
Generate a QR code at checkout and start receiving payments from any connected network — one API call to create the code, one scan to collect the money.
Receiving payments traditionally means building a separate integration for every payment network, every QR standard, every alias directory. Each rail has its own format, its own onboarding process, and its own way of telling you that money arrived. Adding a new channel means months of work.
This guide builds on the store wallet created in Create a Wallet. If you haven't completed that guide yet, start there first.
With Minka, you register a single anchor — a mapping between a simple identifier and a wallet — and the ledger handles everything else. Payments arrive through any connected network, settle automatically, and credit the right account without you writing a single line of routing logic.
What you're building
In this guide you'll generate a QR code for a checkout at the Great Coffee store from Create a Wallet. A customer orders a coffee, your POS creates a QR with the exact amount, the customer scans and pays. One API call to generate the code, one scan to collect the money.
Generate a QR at checkout
A dynamic QR is generated per transaction — at the POS, on an invoice, or in a mobile app. It embeds the exact amount so the customer just confirms rather than typing a number. Each code is single-use: once the payment settles, the anchor is consumed.
Create the anchor
curl -X POST "https://{ledger-host}/v2/anchors" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {your-token}" \
-H "x-ledger: {your-ledger}" \
-d '{
"data": {
"handle": "qr0000002@greatcoffee.co",
"schema": "qr-dynamic",
"target": "store1@greatcoffee.co",
"amount": 850000,
"symbol": { "handle": "cop" },
"custom": {
"reference": "ORDER-4521"
}
}
}'Five fields define the payment:
| Field | What it does |
|---|---|
| handle | The anchor's identity on the ledger — use a sequential QR identifier within the merchant's domain |
| schema | qr-dynamic tells the bridge to embed the amount in the QR payload |
| target | The store wallet where funds land — store1@greatcoffee.co |
| amount | The payment amount in base units: 850000 centavos = 8,500.00 COP |
| reference | Your order or invoice number — included so you can reconcile the payment |
When the ledger receives this anchor creation, a processing policy intercepts it and forwards the request to the QR bridge. The bridge reads the store wallet (store1@greatcoffee.co), walks up to the parent merchant wallet (main@greatcoffee.co) for the business profile — tax ID, category, country, tax regime — and generates the complete QR payload with the amount locked in (EMVco Tag 54) and the point-of-initiation set to 12 (one-time).
The bridge makes sure the generated QR is valid for the local payment network in the merchant's country. For a Colombian merchant, it produces an EMVco-compliant payload with the correct acquirer GUID, alias routing tags, MCC code, currency, and tax condition codes per the bre-b standard. For a Brazilian merchant, it would produce a PIX payload instead. The merchant never needs to know which standard applies — the bridge selects the right one from the country field on the merchant wallet.
Display the QR at checkout
Read the anchor back to get the generated QR payload:
curl "https://{ledger-host}/v2/anchors/qr0000002@greatcoffee.co" \
-H "Authorization: Bearer {your-token}" \
-H "x-ledger: {your-ledger}"The response contains:
| Field | What it is |
|---|---|
custom.qr.payload | The complete QR string — pass it to any QR image library to produce a scannable code |
custom.qr.paymentId | The network transaction ID embedded in the QR — used to route inbound payments back to this anchor |
custom.qr.generatedAt | When the bridge generated the payload |
Display the QR on the POS screen by passing the custom.qr.payload value from the response to any QR image rendering library. The customer scans, sees "8,500.00 COP to GREAT COFFEE UNICENTRO", confirms, and pays. The payload is a complete, standards-compliant string ready for encoding — no post-processing required.
What happens when a customer pays
Once the QR is live, the entire payment flow is automatic.
The customer scans and pays. Their bank sends a payment through the connected network. The payment carries the paymentId embedded in the QR code.
The ledger resolves and routes. The ledger matches the paymentId to your anchor, finds the linked wallet, and coordinates settlement using a two-phase commit — every participant confirms before any balance changes become permanent.
The merchant is credited. The bridge reads the merchant's settlement account from the wallet profile and creates a credit intent. The merchant's bank account is funded automatically.
Why this matters
One registration, any network. You register the anchor once. Payments arrive from any connected network — a national switch, a card scheme, a mobile money platform — without building a separate integration for each one. When a new network connects, existing anchors work with it automatically.
The bridge handles compliance. The QR bridge reads the merchant's country from the wallet profile and generates a payload that is valid for that country's payment network — EMVco for Colombia, PIX for Brazil, PromptPay for Thailand. Switching to a new market means updating the merchant wallet's country field and adding the country profile to the bridge. No code changes, no new integrations.
Automatic settlement. Every payment settles atomically through the two-phase commit. Both sides commit or both sides roll back. Reconciliation is built into every transaction.
What you learned
- How to generate a QR code for a specific checkout amount
- How the bridge reads the wallet hierarchy and generates a network-compliant payload
- How the ledger resolves, routes, and settles inbound payments automatically
Next steps
- Get Payment Notifications — subscribe to events when payments arrive
- Collect with a Static QR — permanent QR for store counters with the full settlement flow
- Collect with a Dynamic QR — per-transaction QR with tax overrides and amount encoding
- About Anchors — how anchors resolve identifiers to accounts across networks