TL;DR
- A refund approval workflow separates the support request from the financial mutation. A second authorized person reviews higher-risk requests before they are sent to the payment provider.
- Keep approval, provider submission, and provider settlement as separate states. An approved refund can still fail, remain pending, or need reconciliation.
- Enforce separation of duties on the server by comparing stable actor identities, locking the refund request, and recording every decision in an append-only audit trail.
- Use integer minor units, a versioned policy snapshot, cumulative refund limits, and a stable idempotency key per provider mutation.
- Thresholds are a risk control, not a compliance certification. Set them from your risk assessment and applicable obligations.
Why refunds need a reviewable control path
Refunds are legitimate customer support actions, but they also move money and change financial records. A support agent may need to reverse a duplicate charge, resolve a service issue, or follow a published return policy. If one compromised or over-privileged account can both request and issue any refund, a routine support capability becomes a high-impact financial permission.
A dual-control refund approval workflow splits that authority. One actor submits a request with a reason and supporting context. Policy decides whether it can proceed directly or needs a second authorized approver. Once approved, a separate worker submits the refund to the payment processor and records the resulting provider state. The reviewer authorizes a specific immutable request rather than granting the requester broad new powers.
Separation of duties is a recognized access-control principle. NIST SP 800-53 control AC-5 calls for organizations to identify duties that require separation and define access authorizations to support it. The control does not prescribe a particular refund threshold or claim that a two-person rule alone meets every regulatory obligation. NIST SP 800-53 Rev. 5, AC-5 Separation of Duties
This article describes an engineering pattern. Payment-provider behavior, consumer protection requirements, accounting policy, and evidence requirements vary by product, jurisdiction, and payment method. Have the responsible finance, security, and legal teams define the policy before setting production limits.
Model approval as a state machine
Do not compress the workflow into a boolean such as approved = true. A request can be awaiting review, rejected, approved, queued for submission, accepted by a provider, pending, succeeded, failed, or under reconciliation. Those states matter operationally because an approval is not the same event as money moving.
requested
├── policy permits direct path ──> approved
└── review required ─────────────> under_review
├── approver accepts ──> approved
└── approver rejects ──> rejected
approved ──> submission_pending ──> provider_pending
├──> succeeded
├──> failed
└──> reconciliation_required
Store a refund request as a durable business object. Useful fields include the original payment ID, requested amount in integer minor units, currency, reason code, free-text rationale, requester actor ID, customer or tenant scope, policy version, review requirement, approval actor ID, provider idempotency key, provider refund ID, and timestamps for each transition. Keep the provider response separate from the decision record.
Reject invalid transitions. For example, an already rejected request should not become approved by a stale browser tab. An approver should not edit the amount while approving. If the amount or destination changes, create a new request or explicitly invalidate the previous decision and require a new review.
Payment providers can return a refund object whose status later changes. Stripe documents partial refunds, balance constraints, and pending or failed outcomes. Use the provider's current status events as input to your local state machine rather than marking a refund complete merely because the API accepted a submission. Stripe refund and cancel payment behavior
Define policy with explicit limits
A threshold policy can permit low-risk requests to be submitted immediately and route larger or unusual requests to review. The threshold itself should be configurable and versioned. A value copied from an example, another company, or a planning document is not a universal safe limit.
Evaluate more than one amount. Consider the individual refund, cumulative refunds against a payment, cumulative refunds by requester over a time window, customer history, reason code, payment age, currency, chargeback or dispute state, and whether the refund would exceed the remaining refundable amount. A malicious user might split one intended large refund into several smaller requests, so individual thresholds alone can be bypassed.
Use integer minor units and currency-aware comparisons. Do not compare decimal strings or convert every currency by multiplying by 100. Currency exponent rules vary. Store the original currency and the amount in its smallest provider-supported unit, and use a maintained currency mapping where display or conversion is required. Stripe's Refund API accepts an optional positive integer amount in the smallest currency unit and prevents refunding more than the unrefunded balance. Stripe Create Refund API
Snapshot the decision inputs at request time. A policy edit between request and approval should not silently change what the approver is reviewing. You can require reassessment when a policy version changes or preserve the original policy version with an explicit rule for grandfathering pending requests. Make that behavior visible in the approval interface.
Risk signals should increase scrutiny without becoming unexplained denial rules. For example, a new device or an unusual refund velocity can route an item for review. Keep a human-readable reason code so an approver knows why the request was escalated and a later auditor can reconstruct which rule applied.
Enforce separation of duties in the transaction
The core invariant is that the requester cannot approve their own refund. Check it on the server using immutable actor identifiers. Display names and email addresses can change and are not reliable identity keys. If the organization requires separation by role, team, or tenant, evaluate those constraints in the same authorization decision.
Lock the refund row or use a conditional update so two approvers cannot both decide at the same time. In PostgreSQL, the decision can be made through one transaction that validates the current state, checks the actor and policy conditions, appends an approval event, and changes the current state.
BEGIN;
SELECT id, state, requester_actor_id, amount_minor, currency
FROM refund_request
WHERE id = :request_id
FOR UPDATE;
-- Application checks:
-- state = 'under_review'
-- current_actor_id <> requester_actor_id
-- current_actor has refund.approve for this tenant
-- request is still within the reviewed policy bounds
INSERT INTO refund_event (
refund_request_id, event_type, actor_id, recorded_at, details
) VALUES (
:request_id, 'approved', :approver_actor_id, now(), :decision_snapshot
);
UPDATE refund_request
SET state = 'approved',
approver_actor_id = :approver_actor_id,
approved_at = now()
WHERE id = :request_id
AND state = 'under_review';
COMMIT;
The sample omits table definitions, permission joins, and error handling. In production, verify the conditional update affected exactly one row and reject stale decisions. Restrict direct table writes so the application cannot bypass the state transition. Use database constraints for invariants that can be expressed locally, and audit the authorization code path as well.
Decide how you handle service accounts, break-glass accounts, delegated approvals, and administrators. If a support agent can impersonate another user, compare the authenticated principal that performed the action, not the impersonated subject alone. Record both identities. If a break-glass action is permitted, require a reason, alert the appropriate team, and review it after use.
Make provider submission idempotent and recoverable
After approval, a background worker submits the provider request. The worker may time out after the provider creates a refund but before your service saves the response. Retrying with a new key could create a second refund or trigger an over-refund rejection. Generate a stable idempotency key from the refund request ID and use it for every retry of that same provider operation.
Persist a submission attempt before the network call, then record the provider response and identifier after it returns. If the outcome is unknown, query the provider or wait for its event before deciding whether a new submission is safe. Keep provider retries separate from approval retries. An approver clicking twice must not create a second local decision or provider mutation.
Use an outbox if an approval transaction also needs to enqueue submission. Insert an outbox command in the same database transaction that changes the request to approved. A worker claims the command, calls the provider with a stable key, and records the result. This avoids a database commit succeeding while the queue publish is lost. Consumers still need to be idempotent because delivery can repeat. See our payment idempotency guide and our transactional outbox guide.
Stripe supports idempotency keys for API requests, but provider behavior and key-retention windows are provider-specific. Do not treat an idempotency key as a permanent financial ledger or as proof that a request succeeded. Store your own stable refund operation ID and reconcile ambiguous outcomes with the provider. Stripe idempotent requests
Keep an audit trail that answers who did what
Record the original request, every policy evaluation, each approval or rejection, the identity and role used, the reason supplied, the request and response identifiers, and all provider state updates. Include timestamps from a consistent clock and retain the policy version and relevant decision inputs. Do not overwrite the original request payload when a reviewer adds a note.
An append-only event table is a practical foundation. Limit permissions so regular application roles can insert events but cannot rewrite history. For stronger tamper evidence, export events to a separately controlled system or use a cryptographic integrity mechanism designed for the organization's threat model. Hash chaining alone does not prevent a privileged administrator from rewriting an entire chain unless an external checkpoint exists.
Minimize personal and payment data in logs. Store provider identifiers and the minimum masked context necessary for investigation. Never record card security codes, full card data, authentication secrets, or webhook signing secrets in the audit event. Apply retention and access controls that fit the information's sensitivity.
Notify the requester and reviewer when a request changes state, but do not include sensitive payment details in email or chat notifications. Use links to an authenticated interface. Alert separately on repeated approvals, unusual cumulative volume, failed provider submissions, and refunds stuck in a pending or reconciliation state.
Test the workflow as a money-moving control
Test policy and concurrency invariants, not just the happy path. A useful test matrix includes:
- The requester cannot approve their own request, including through an alternate browser session.
- Two approvers racing to decide the same request result in one accepted transition.
- Changing the amount or currency after approval invalidates or reopens the decision.
- Multiple partial refunds cannot exceed the original refundable balance.
- Several small requests cannot evade a cumulative requester or payment limit.
- A worker crash before the provider call and a timeout after provider acceptance both recover safely.
- Duplicate provider webhooks do not create duplicate local accounting effects.
- Provider-pending, failed, and insufficient-balance outcomes remain distinct from approval.
- Revoking an approver's permission while a browser form is open prevents stale authorization from succeeding.
Use a sandbox and synthetic payment objects for provider integration tests. A successful mock response does not test the provider's actual pending, failure, or webhook sequence. Keep a reconciliation job that compares local refund requests with provider records and flags unexplained differences.
Monitor requests awaiting review, approval age, rejection rate, submission latency, provider-pending duration, failed refunds, reconciliation queue age, duplicate attempts, and amounts by reason code. Restrict dashboard access because these metrics can expose customer and employee activity.
Frequently asked questions
Should every refund require a second approver?
That depends on the organization's risk assessment, business policy, and applicable obligations. A tiered policy can allow bounded routine refunds while routing higher-risk requests to a second person. Define cumulative limits and exception handling so splitting a request does not bypass review.
Does an approved refund mean the customer has received the money?
No. Approval authorizes the system to submit a refund. The provider may accept it as pending, later report success, or report failure. Track local approval separately from provider submission and final provider status, then reconcile ambiguous outcomes.
Can the same support agent request and approve a refund if a manager is unavailable?
That weakens the separation-of-duties control. If policy allows an emergency path, make it a narrowly scoped break-glass action with a reason, alert, audit event, and follow-up review. The ordinary approval route should still prevent self-approval.
Are approval thresholds a substitute for fraud monitoring?
No. Thresholds limit or route certain actions, but they do not detect every compromised account, colluding actors, repeated small refunds, or provider-side anomalies. Combine them with authentication, least privilege, velocity monitoring, reconciliation, and a response process.
Build the control around a specific financial action
A useful refund approval design makes one request immutable, routes it by explicit policy, prevents the requester from approving it, and submits it through an idempotent worker. The audit trail explains both the human decision and the provider outcome. Thresholds should be treated as versioned risk controls, not as a guarantee of compliance or fraud prevention.
If your billing or support platform needs dual control, refund limits, or provider reconciliation, talk with our engineering team about modeling the policy, authorization boundary, and operational recovery path.
