Embed secure bank account and routing number fields and tokenize for ACH using OzVault.
Bank elements let you collect account numbers and routing numbers in your own form without those values ever appearing in your JavaScript or reaching your server. Each field is an isolated iframe; Ozura handles tokenization securely.
OzuraPay does not currently support bank account payments. The bank token is for use with your own ACH-capable payment processor via the Proxy.
Call createBankToken() after the user has filled both fields. firstName and lastName are required — they are included in the vault record alongside the account data.
document.getElementById('submit-btn').addEventListener('click', async (e) => { e.preventDefault(); const firstName = document.getElementById('first-name').value.trim(); const lastName = document.getElementById('last-name').value.trim(); try { const { token, bank } = await vault.createBankToken({ firstName, lastName }); // token — vault token, pass to your backend // bank.last4 — last 4 digits of account number (safe to display) // bank.routingNumberLast4 — last 4 digits of routing number (safe to display) await fetch('/api/ach', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ token }), }); } catch (err) { if (err instanceof OzError) { console.error(err.message, err.errorCode); } }});
{ token: string; // vault token — pass to your backend bank?: { last4: string; // last 4 digits of account number routingNumberLast4: string; // last 4 digits of routing number };}
bank.routingNumberLast4 is the last 4 digits of the routing number — sufficient for display and reconciliation. The full routing number is never exposed to your JavaScript.