Advanced Fintech & PaymentsAI, Fraud, Identity & Financial CrimeTopic 36

Refunds, Reversals, Voids and Partial-Capture Payment Workflows

Architecture for refund processing, reversals, voids, and partial-capture payment workflows

Quick Answer

Refunds return funds from a captured payment to the customer. Reversals cancel a transaction before settlement. Voids cancel an authorized but not captured payment. Partial capture captures less than the authorized amount. Key workflows: full refund, partial refund, void (before capture), reversal (before settlement), and partial capture. Each has different timing, state transitions, and settlement implications. Architecture requires idempotent APIs, state machine management, and reconciliation across gateway, bank, and ledger.

Learning Objectives
1Design refund, reversal, void, and partial-capture workflows
2Implement idempotent payment modification APIs
3Handle state transitions for each workflow
4Design reconciliation for modified transactions
5Handle timing and settlement implications
Executive Summary

Payment modifications (refunds, reversals, voids, partial captures) are essential workflows for any payment system. Each modification has different timing requirements, state transitions, and settlement implications.

Refunds return funds from captured payments (full or partial). Voids cancel authorized but not captured payments. Reversals cancel transactions before settlement. Partial captures capture less than the authorized amount. Each requires careful state management and reconciliation.

This topic covers payment modification workflows, state machine design, and reconciliation for modified transactions.

What Is Refunds, Reversals, Voids and Partial-Capture Payment Workflows?

A refund is the return of funds from a captured payment to the customer. A reversal cancels a transaction before it settles. A void cancels an authorized but not captured payment. A partial capture captures less than the authorized amount. Each modification has different timing requirements, state transitions, and settlement implications.

Why This Topic Matters

Payment modifications are a critical part of customer service and operations. Customers expect fast refunds for returns. Merchants need void and partial capture for order modifications. Incorrect handling leads to financial discrepancies and customer disputes.

For payment platforms, modification workflows must be idempotent, reliable, and properly reconciled. Failed or duplicate modifications lead to financial losses and customer complaints.

Why It Matters in 2026+

In 2026, instant refunds are becoming the standard, with real-time payment rails enabling immediate fund return. AI-driven refund automation handles common refund scenarios without manual intervention.

The rise of real-time payments (UPI, FedNow) makes reversals more complex, as real-time transactions are irrevocable once completed.

Architecture Overview

Payment modification workflows:

Reference Architecture

Original Transaction
↓
Modification Request
↓
State Validation
↓
Processing
↓
State Transition
↓
Settlement Impact
↓
Reconciliation

A modification request is received. The system validates the current state allows the modification. The modification is processed. The state transitions. Settlement impact is calculated. Reconciliation updates all systems.

Core Components
ModificationWhenState Transition
VoidAfter auth, before captureauthorized → voided
CaptureAfter authauthorized → captured
Partial CaptureAfter authauthorized → partially_captured
Full RefundAfter capturecaptured → refunded
Partial RefundAfter capturecaptured → partially_refunded
ReversalBefore settlementcaptured → reversed
Detailed Technical Architecture

Payment modification technical architecture:

State Machine

Payment state machine with all valid states and transitions. Invalid transitions rejected. State stored in database with optimistic locking.

Idempotency

All modification APIs require idempotency keys. Prevents duplicate modifications on retries.

Refund Processing

Full refund: refund entire captured amount. Partial refund: refund portion. Multiple partial refunds allowed up to captured amount. Refund status tracked.

Void Processing

Cancel authorized but not captured payment. Releases hold on customer funds. Only possible before capture.

Partial Capture

Capture less than authorized amount. Useful for partial order fulfillment. Remaining authorization may be voided or captured later.

Reversal

Cancel transaction before settlement. Rare, used for error correction. May require network support.

APIs and Integration Patterns

Payment modification APIs:

Full Refund

POST /payments/{id}/refund with full amount.

Partial Refund

POST /payments/{id}/refund with partial amount.

Void

POST /payments/{id}/void to cancel authorized payment.

Partial Capture

POST /payments/{id}/capture with partial amount.

POST/v1/payments/{id}/refund

Process a partial refund

Request

POST /v1/payments/pay_001/refund
Idempotency-Key: refund_001
Authorization: Bearer sk_live_xxx

{
  "amount": 1000,
  "reason": "customer_returned_item"
}

Response

{
  "id": "re_26JAnRef",
  "payment_id": "pay_001",
  "status": "processed",
  "amount": 1000,
  "refund_type": "partial",
  "remaining_captured_amount": 3999
}
POST/v1/payments/{id}/void

Void an authorized payment

Request

POST /v1/payments/pay_002/void
Idempotency-Key: void_001
Authorization: Bearer sk_live_xxx

Response

{
  "id": "pay_002",
  "status": "voided",
  "voided_at": "2026-01-01T10:00:00Z"
}
Data Architecture

Modification data architecture:

DataPurposeStorage
Payment StateCurrent state of paymentPostgreSQL (ACID)
Modification RecordsRefund, void, capture recordsPostgreSQL
Settlement ImpactAdjustments to settlementSettlement DB
ReconciliationMatch modifications across systemsReconciliation DB
Real Enterprise Case Studies

Payment modification implementations:

StripeUSA · Fintech

Context: Payment modification APIs.

Problem: Provide clean APIs for refunds, voids, and partial captures.

Architecture: REST APIs with idempotency, state machine, and automatic reconciliation.

Technology: Ruby, Go, PostgreSQL

Outcomes: Millions of modifications processed reliably.

Lessons: Idempotency is critical for modifications. State machine prevents invalid transitions.

Common Architecture Mistakes
Storing Raw Card Data

Storing PAN or CVV in databases creates massive PCI DSS scope and security risk. Always use tokenization.

No Idempotency on Payment APIs

Missing idempotency keys on payment endpoints causes duplicate charges on retries. Every payment API must support idempotency.

Synchronous Processing of Async Operations

Treating inherently asynchronous payment operations as synchronous causes timeouts and poor UX. Use webhooks and async patterns.

No Webhook Retry Logic

Failing to retry failed webhook deliveries causes merchants to miss critical payment status updates. Implement exponential backoff retry.

No Reconciliation Automation

Manual reconciliation at scale is error-prone and slow. Automate reconciliation from day one.

Single-Rail Dependency

Depending on a single payment rail creates a single point of failure. Implement multi-rail architecture with failover.

No Fraud Monitoring

Launching without fraud monitoring leads to chargebacks and losses. Implement real-time fraud detection from day one.

Payment Database as Financial Ledger

Using the transaction database as the financial ledger leads to accuracy and audit issues. Maintain a separate double-entry ledger.

KPIs
KPIDescriptionTarget
Authorization RatePercentage of payment attempts that receive authorization> 95%
Payment Success RatePercentage of initiated payments that complete successfully> 97%
API Latency (p99)99th percentile API response time< 500ms
TPS CapacityTransactions per second the system can handleBased on peak demand
Fraud RateFraudulent transactions as percentage of total< 0.1%
Chargeback RateChargebacks as percentage of transactions< 0.75%
UptimeSystem availability99.99%
Reconciliation AccuracyPercentage of transactions successfully reconciled> 99.5%
Practical Project

Build Payment Modification APIs

Objective: Design and implement refund, void, and partial capture APIs.

Scenario: Build modification APIs for a payment gateway with proper state management and reconciliation.

Tasks:
  1. Design payment state machine with all states
  2. Implement full and partial refund APIs
  3. Implement void API
  4. Implement partial capture API
  5. Design reconciliation for modifications

Deliverables: Modification APIs, state machine, reconciliation.

Validation: Process refund. Process partial refund. Void authorized payment. Partial capture. Verify state transitions. Verify reconciliation.

Interview Questions

What is the difference between void and refund?

Void cancels an authorized but not captured payment, releasing the hold on customer funds. Refund returns funds from a captured payment. Void is before settlement; refund is after settlement.

Can you refund more than the captured amount?

No, refunds cannot exceed the captured amount. Multiple partial refunds are allowed up to the total captured amount. The system must track remaining refundable amount.

What is a partial capture?

Partial capture captures less than the authorized amount. Useful when the actual charge is less than authorized (e.g., some items out of stock, restaurant tip adjustment). The remaining authorization can be voided or captured separately.

Frequently Asked Questions (53)
Glossary
PSP

Payment Service Provider: entity that enables merchants to accept payments through multiple payment methods via a single integration.

PayFac

Payment Facilitator: entity that enables sub-merchants to accept payments under the PayFac master merchant account.

Acquirer

Bank or financial institution that processes card transactions on behalf of merchants.

Issuer

Bank or financial institution that issues payment cards to consumers.

Interchange

Fee paid between the acquiring bank and the issuing bank for card transactions, set by card networks.

MID

Merchant ID: unique identifier assigned to a merchant by the acquirer.

PAN

Primary Account Number: the 14-19 digit number on a payment card, considered sensitive cardholder data under PCI DSS.

Tokenization

Process of replacing sensitive card data with a non-sensitive token.

Authorization

Process of verifying that a payment account has sufficient funds and is valid for a transaction.

Capture

Process of finalizing a previously authorized transaction, triggering the transfer of funds.

Clearing

Process of exchanging transaction details between acquiring and issuing banks.

Settlement

Actual transfer of funds between banks to complete a payment transaction.

Chargeback

Transaction dispute initiated by a cardholder through their issuing bank.

MCC

Merchant Category Code: 4-digit code classifying the type of goods or services a merchant sells.

3DS

3-D Secure: authentication protocol for card-not-present transactions.

PCI DSS

Payment Card Industry Data Security Standard: security standard for organizations handling cardholder data.

HSM

Hardware Security Module: physical computing device that safeguards and manages digital keys.

Idempotency

Property of an API where making the same request multiple times produces the same result as making it once.

Webhook

HTTP callback triggered by an event, used in payments for asynchronous notifications.

UPI

Unified Payments Interface: India real-time payment system developed by NPCI.

NPCI

National Payments Corporation of India: umbrella organization for retail payment systems in India.

RBI

Reserve Bank of India: India central bank and regulatory authority for payment systems.

ISO 20022

International standard for electronic data interchange between financial institutions.

ACH

Automated Clearing House: US electronic payment network for batch-processed bank-to-bank transfers.

FedNow

US Federal Reserve instant payment service launched in 2023.

SEPA

Single Euro Payments Area: EU payment integration initiative.

RTP

Real-Time Payments: payment infrastructure enabling instant, irrevocable payments 24/7.

Ledger

Financial record-keeping system using double-entry accounting.

Reconciliation

Process of matching transaction records across different systems to ensure consistency.

Escrow

Financial arrangement where a third party holds funds until conditions are met.

BNPL

Buy Now Pay Later: short-term financing allowing consumers to pay in installments.

BaaS

Banking-as-a-Service: model where licensed banks provide banking infrastructure via APIs.

Open Banking

Practice of providing secure API access to bank account data and payment initiation.

Embedded Finance

Integration of financial services into non-financial platforms via APIs.

Stablecoin

Cryptocurrency designed to maintain stable value by pegging to a reference asset.

Refund

Return of funds from a captured payment to the customer.

Void

Cancellation of an authorized but not captured payment.

Partial Capture

Capturing less than the authorized amount.

Reversal

Cancellation of a transaction before settlement.

Implementation Checklist
  • Architecture designed and reviewed
  • API contracts defined with idempotency
  • Authentication and authorization implemented
  • PCI DSS scope assessed and minimized via tokenization
  • Error handling and retry logic designed
  • Webhook delivery and retry implemented
  • Security review completed (encryption, HSM, key management)
  • Regulatory requirements identified (RBI, PCI DSS, AML)
  • Data model defined (transactions, ledger, reconciliation)
  • Observability implemented (metrics, logs, traces, alerts)
  • Testing completed (unit, integration, load, chaos)
  • Disaster recovery designed and tested
  • Reconciliation process validated
  • Fraud detection deployed and tuned
  • Production readiness assessed and approved
Career & Enterprise Skills
Payment Architect

Designs end-to-end payment architecture including gateways, orchestration, rails, security, and compliance.

Fintech Architect

Designs comprehensive fintech platform architecture including payments, banking, ledgers, risk, and compliance.

API Architect

Designs API-first payment platforms including REST APIs, webhooks, SDKs, developer portals, and API governance.

Payment Engineer

Implements and operates payment infrastructure including gateway, routing, processing, reconciliation, and settlement.

Platform Engineer

Builds internal developer platforms for payment integration, providing self-service APIs, SDKs, and golden paths.

SRE Engineer

Applies software engineering to payment operations, managing SLI/SLO/error budgets and incident response.

Fraud Analyst

Monitors transaction patterns, investigates suspicious activity, tunes fraud rules, and manages chargeback disputes.

Fintech Product Manager

Defines payment product strategy, manages roadmap, balances user experience with compliance, and drives payment metrics.

Compliance Specialist

Ensures payment systems meet PCI DSS, RBI, AML, and other regulatory requirements.

Treasury Technology Specialist

Implements and operates treasury management systems including liquidity management, settlement, FX, and bank connectivity.

Future Outlook

2027: Refunds and Reversals will see increased AI integration with AI agents handling routine payment decisions, intelligent routing optimization, and predictive fraud prevention becoming standard capabilities.

2028: Autonomous payment systems will mature with self-healing infrastructure, AI-driven reconciliation, and cross-border real-time payments reducing settlement time from days to seconds.

2029: Programmable money and tokenized deposits will enable new payment models with conditional settlement, smart contract-based escrow, and machine-to-machine payments becoming practical.

2030: The convergence of AI, blockchain, and real-time payments will be complete. Refunds and Reversals will be managed through AI agents with humans governing policy, security, and business alignment. Payments will be invisible, instant, and intelligent.

Key Takeaways
  • Payment modifications include refunds, voids, partial captures, and reversals.
  • Each modification has specific timing and state transition requirements.
  • Idempotency is critical for safe modification processing.
  • State machine prevents invalid modifications.
  • Reconciliation must account for all modifications.