
Maker-Checker Workflow for Vendor Bank Details: A Build Guide
A maker-checker workflow is the standard answer when one person should never be able to move money alone: one user proposes a change, a different user approves it, and the system refuses to let those roles collapse. Changes to vendor bank details are where this pattern matters most. Business email compromise, the family of scams that includes fake "please update our bank account" requests, accounted for $2,770,151,146 in reported losses in the FBI IC3 2024 Internet Crime Report. Our main article covers the business side, with red flags and seven accounts payable controls against vendor bank account change fraud. This one is for the people who build the system: the data model, the state machine, the verification step, the payment-time guard, and the mistakes that quietly turn "dual approval" into a checkbox.
Threat model first: what the workflow has to stop
Before writing a table, list who can change a bank account and how. In most AP systems the honest answer is "more paths than anyone thinks":
- A compromised vendor mailbox sends a convincing request to an AP clerk, who types the new details in.
- A compromised internal account (or a malicious insider) edits the vendor record directly.
- A side door: a CSV import, an ERP sync job, an admin API, or a support tool that writes to the same table without going through the UI.
- A vendor self-service portal where the attacker has taken over the vendor's login.
- A race: the account changes after a payment run was approved but before the file goes to the bank.
A design that only adds an "approved" column to the vendor form handles the first case and none of the others. The goal is an architecture where every path that changes where money goes ends in the same workflow, and where the payment engine refuses to pay an account that did not come out of that workflow.
Designing the maker-checker workflow: the data model
Three decisions do most of the work:
- Bank accounts are versioned rows, never updated in place. A change creates a new
pendingrow; approval flips it toactiveand retires the previous one. You keep history for free and payments can reference an exact version. - Change requests are their own entity with a state, a channel, a maker and a checker.
- The database enforces the invariants, not only the application. Application code has side doors; constraints do not.
Here is a PostgreSQL sketch:
CREATE TABLE vendor_bank_accounts (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
vendor_id uuid NOT NULL REFERENCES vendors(id),
version int NOT NULL,
country char(2) NOT NULL,
holder_name text NOT NULL,
account_ciphertext bytea NOT NULL, -- encrypted with a KMS-managed key
account_last4 text NOT NULL, -- for display only
account_fingerprint text NOT NULL, -- HMAC of the normalized account number
status text NOT NULL
CHECK (status IN ('pending', 'active', 'retired', 'rejected')),
activated_at timestamptz,
first_payment_cleared_at timestamptz,
UNIQUE (vendor_id, version)
);
-- At most one active account per vendor
CREATE UNIQUE INDEX one_active_account_per_vendor
ON vendor_bank_accounts (vendor_id) WHERE status = 'active';
CREATE TABLE bank_change_requests (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
vendor_id uuid NOT NULL REFERENCES vendors(id),
proposed_account_id uuid NOT NULL REFERENCES vendor_bank_accounts(id),
channel text NOT NULL, -- portal, email, phone, import, api
requested_by uuid NOT NULL,
approved_by uuid,
state text NOT NULL CHECK (state IN
('submitted', 'verifying', 'awaiting_approval', 'approved', 'rejected', 'expired')),
verification jsonb NOT NULL DEFAULT '{}',
created_at timestamptz NOT NULL DEFAULT now(),
decided_at timestamptz,
CHECK (approved_by IS NULL OR approved_by <> requested_by)
);
-- Only one open request per vendor: no racing parallel changes
CREATE UNIQUE INDEX one_open_request_per_vendor
ON bank_change_requests (vendor_id)
WHERE state IN ('submitted', 'verifying', 'awaiting_approval');
A few details worth defending in code review:
- The fingerprint is a keyed hash (HMAC with a secret kept outside the database) of the normalized account number. It lets you ask "is this account already on file for another vendor, or for an employee in payroll?" without decrypting anything. The same account appearing under two unrelated payees is one of the cheapest, strongest signals you can compute.
- The
CHECK (approved_by <> requested_by)constraint means that even a buggy admin endpoint cannot record a self-approval. - The partial unique index on open requests prevents an attacker (or a confused clerk) from opening a second request to overwrite the first while it is being verified.
- Encrypt the account number at the application layer, and give the AP UI only
last4. Most screens never need the full number; the payment file generator does.
The state machine and its invariants
Model the request as an explicit state machine and reject every transition that is not listed:
submitted -> verifying -> awaiting_approval -> approved
| | |
+------------+---------------+--> rejected | expired
The invariants that make it a real maker-checker workflow rather than a formality:
- The checker is not the maker, and not anyone who edited this vendor's contact data (email, phone, address) within a window you define. Otherwise an attacker changes the phone number on Monday and the bank account on Tuesday, and "verifies" the change against their own number.
- The checker holds a specific permission (
vendor_bank:approve) that is separate from vendor editing permissions. - Approval requires fresh step-up authentication, so a stolen session cookie is not enough.
- The request cannot reach
awaiting_approvalwithout structured verification evidence. - Requests expire. A request sitting open for weeks is a request nobody verified properly.
The approval itself should be one transaction that locks the request row:
async function approveBankChange(requestId: string, approver: User) {
await requireStepUpAuth(approver); // fresh MFA, before touching data
await db.tx(async (tx) => {
const req = await tx.one(
`SELECT * FROM bank_change_requests WHERE id = $1 FOR UPDATE`,
[requestId]
);
if (req.state !== 'awaiting_approval') throw new Conflict('Not awaiting approval');
if (req.requested_by === approver.id) throw new Forbidden('Maker cannot approve');
if (!approver.can('vendor_bank:approve')) throw new Forbidden('Missing permission');
if (await editedVendorContactsRecently(tx, req.vendor_id, approver.id))
throw new Forbidden('Approver recently edited this vendor');
if (req.verification?.callback?.result !== 'confirmed')
throw new Conflict('Out-of-band verification missing');
await tx.none(
`UPDATE vendor_bank_accounts SET status = 'retired'
WHERE vendor_id = $1 AND status = 'active'`, [req.vendor_id]);
await tx.none(
`UPDATE vendor_bank_accounts SET status = 'active', activated_at = now()
WHERE id = $1 AND status = 'pending'`, [req.proposed_account_id]);
await tx.none(
`UPDATE bank_change_requests
SET state = 'approved', approved_by = $2, decided_at = now()
WHERE id = $1`, [requestId, approver.id]);
await appendAuditEvent(tx, requestId, approver.id, 'approved');
await enqueueOutbox(tx, 'vendor.bank_account.changed', {
vendorId: req.vendor_id,
notify: 'previous_contacts' // tell the vendor's known contacts, not the requester
});
});
}
The outbox write matters: notifying the vendor's previously known contacts that their bank details changed is one of the few controls that can catch a fraud the internal team missed, and it must not be lost if the email service is down.
Out-of-band verification as a first-class step
Verification is where most implementations go soft. "Called vendor, OK" in a free-text notes field is not evidence. Treat it as a task with a schema:
{
"callback": {
"phone_dialed": "+52 55 ....",
"phone_source_version": 14,
"contact_name": "Accounts receivable lead",
"performed_by": "user_123",
"performed_at": "2026-01-15T16:02:00Z",
"result": "confirmed"
},
"name_check": { "provider": "bank_or_psp", "result": "partial", "raw_ref": "..." },
"fingerprint_hits": []
}
The key field is phone_source_version. The callback number must come from the vendor record as it was before the request, never from the request, the email signature or a document attached to it. Store which version you used so an auditor can prove it.
Automated name checks are a useful extra signal where they exist. In the euro area, Verification of Payee has been mandatory since 9 October 2025 for instant and standard transfers alike; the scheme checks whether a payee's name aligns with their IBAN before a transaction. Coverage, providers and response formats differ by country, which is why it pays to normalize every provider's answer into your own small enum (for example match, partial, no_match, unavailable) and keep the raw response for audit.
Two rules for failure handling:
- Fail closed. If the name-check provider times out, the result is
unavailableand the request goes to the manual path. It never auto-advances. - Make verification idempotent. Retries of the provider call should reuse a request key so a flaky network does not create duplicate checks or conflicting results.
Enforce at payment time, not only at edit time
An approved change is not the end. The payment engine is the last line, and it should re-check at execution, because approval of a payment run and generation of the bank file can be hours apart (a classic time-of-check to time-of-use gap).
function guardPaymentLine(line: PaymentLine, account: BankAccount, now: Date): Decision {
if (line.bankAccountId !== account.id)
return hold('Account changed after the run was approved');
if (account.status !== 'active')
return hold('Account is not active');
if (!account.firstPaymentClearedAt)
return requireApproval('First payment to a new account');
if (now.getTime() - account.activatedAt.getTime() < COOLING_PERIOD_MS)
return hold('Inside cooling period after a bank change');
return allow();
}
Payment lines should store the bank_account_id (the version) they were approved against, and the file generator should compare it against the active version right before writing the file. The cooling period and first-payment rule are policy parameters your finance team sets; the system's job is to make them impossible to skip.
An audit trail you can actually trust
Every transition, verification and approval goes into an append-only event table. Enforce append-only in the database and in permissions:
CREATE TABLE bank_change_events (
id bigserial PRIMARY KEY,
request_id uuid NOT NULL REFERENCES bank_change_requests(id),
actor_id uuid NOT NULL,
event_type text NOT NULL,
payload jsonb NOT NULL,
prev_hash bytea,
hash bytea NOT NULL, -- hash(prev_hash || payload)
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE FUNCTION forbid_mutation() RETURNS trigger AS $$
BEGIN
RAISE EXCEPTION 'bank_change_events is append-only';
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER bank_change_events_append_only
BEFORE UPDATE OR DELETE ON bank_change_events
FOR EACH ROW EXECUTE FUNCTION forbid_mutation();
REVOKE UPDATE, DELETE ON bank_change_events FROM app_role;
A database owner can still drop a trigger, so the hash chain plus shipping events to an external log store you do not administer from the same credentials is what makes tampering detectable.
Trade-offs between approaches
- ERP configuration vs. a dedicated service. Many ERPs offer some form of dual control on vendor master data. Use it if it covers every path, including imports and integrations. If side doors exist, a small dedicated service that owns bank details (and exposes only "propose" and "approve") is easier to reason about than patching every integration. This is the kind of focused custom software that sits next to your ERP rather than replacing it.
- State table vs. event sourcing. A state table plus an append-only event log, as above, is enough for most teams. Full event sourcing gives you perfect replay but adds projection and versioning complexity that rarely pays off for a workflow this small.
- Hard holds vs. risk scoring. Scoring (new account + recent contact change + foreign country + fingerprint hit) helps prioritize, but should add friction, not remove it. Do not let a low score skip the callback.
- Vendor self-service vs. AP-entered changes. A portal removes email from the loop, which helps, but it moves the attack to the vendor's login. Require MFA on the portal and keep the internal checker step regardless of channel.
Common mistakes
- Updating the bank account row in place, so payments cannot prove which account they were approved against.
- Enforcing "maker is not checker" only in the UI, while imports and admin APIs write directly.
- Verifying with contact details taken from the change request itself.
- Letting a verification provider outage default to "pass".
- Allowing the same person to change a vendor's phone and then approve its bank change.
- Logging full account numbers in application logs, error trackers or analytics events.
- Sending the "your bank details changed" notice to the address that requested the change.
Checklist
- Bank accounts are versioned; one active version per vendor, enforced by a unique index.
- Every write path (UI, import, sync, API, support tools) goes through the change-request service.
approved_by <> requested_byenforced by a database constraint.- Separate approval permission and step-up MFA for approvers.
- Structured callback evidence using the pre-change contact version.
- Name-check results normalized, raw responses stored, failures fail closed.
- Fingerprint check across vendors and payroll.
- Payment lines pinned to an account version; re-checked at file generation.
- Cooling period and first-payment approval configurable by finance.
- Append-only, hash-chained audit events shipped off the primary database.
- Change notifications via an outbox to the vendor's previously known contacts.
Frequently asked questions
What is a maker-checker workflow?
It is a control in which one user (the maker) proposes a change and a different, authorized user (the checker) must approve it before it takes effect. In software, the important part is that the system, not just policy, prevents one person from playing both roles.
Should the maker-checker rule live in the application or the database?
Both. The application gives good error messages and handles step-up authentication; database constraints and permissions catch the paths that bypass the application, such as imports, scripts and admin tools.
Does Verification of Payee replace a callback to the vendor?
No. A name check confirms that a name matches an account where the service is available; it does not confirm that your vendor actually asked for the change. Treat it as one signal alongside the out-of-band callback.
Comments
No comments yet. Be the first to share what you think.


