Integration flow
- Load the current bank directory from
GET /api/v1/tools/bank-qr/banks. - Let the payer select a bank and retain its
bin,code, orshortName. - Send the selected identifier and beneficiary account number to
POST /api/v1/tools/bank-qr. - Display
data.qr.image.dataUrlor storedata.qr.payloadfor another standards-compatible QR renderer. - Display any entries in
data.warnings, then ask the payer to verify the beneficiary in their banking app before confirming the transfer.
Authentication
Authenticate integrations with OAuth or a Pirehub API key. Generation requiresbank-qr:generate; reading the directory requires bank-qr:banks. Send an API key
in x-pirehub-api-key or a bearer header, and keep the credential on your server.
Invalid credentials return 401; revoked, expired, or under-scoped credentials
return 403.
Administrator-issued API keys use the key’s per-minute and monthly request limits. Inspect
X-ApiKey-* headers and honor Retry-After after a 429.
Load the bank directory
Use the directory instead of maintaining a bank list in application code. The response contains accepted identifiers, transfer-support metadata, and optional allowlisted logo URLs.count. updatedAt identifies the directory snapshot,
not the time of the client request. Cache the response according to its
Cache-Control header. A bank logo is optional, so always provide a local
fallback and do not treat an image-load failure as a directory failure.
Logo URLs point to allowlisted bank-logo asset hosts. Rendering one directly causes
the user’s browser to contact that host; cache or self-host permitted assets when
your privacy requirements prohibit that request.
transferSupported is compatibility metadata. It does not prove that a
beneficiary account exists or can currently receive a transfer.Generate a QR code
bank is case-insensitive and may be the six-digit bin, code, or
shortName returned by the directory. Keep accountNumber as a JSON string;
converting it to a number can remove leading zeroes.
Request fields
Unknown fields are rejected, and the complete JSON request body must not exceed
4 KiB.
Static and dynamic QR codes
The optional memo can be included in either type.
Successful response
data.transfer contains the normalized values actually encoded in the QR,
so use it instead of redisplaying unprocessed request input.
Assign the data URL to an image src. Do not decode the SVG and inject it into the
page as HTML.
Memo normalization and warnings
The API folds Vietnamese diacritics to ASCII, replaces unsupported characters, collapses consecutive spaces, and limits the encoded memo to 25 characters. It returnsMEMO_NORMALIZED when the encoded value differs from the submitted memo.
LIMITED_TRANSFER_SUPPORT means the institution has limited bank-transfer QR compatibility
metadata. Generation still succeeds, but you should test the QR with the intended
banking apps before publishing it.
Warnings are successful outcomes, not API errors. Handle them by code rather
than parsing the human-readable message.
Server example
Failures and safe handling
Every JSON error includes
data.requestId. Record that opaque value for support,
but branch only on error.code.
Avoid placing real account numbers or generated payloads in application logs,
analytics, URLs, or long-lived browser storage. The generation response uses
Cache-Control: no-store.
Next steps
Bank directory endpoint
Review the directory response and bank metadata schema.
Generate QR endpoint
Review the complete generation request and response schema.
Errors and retries
Handle failures safely and predictably.
Subscription-backed API keys
Paid self-service keys use shared owner credits and the plan’s per-second and concurrent-job limits. Successful results, including cache hits, consume the configured action cost; errors release the reservation. Video jobs settle at completion. InspectX-ApiKey-Credit-* and X-ApiKey-RateLimit-*.
An optional Idempotency-Key prevents repeated synchronous execution/debits;
repeated operations return 409 rather than replaying a response. Job starts use
requestId instead. See API plans and idempotency
for costs, billing periods, headers, error codes and retry rules.