This comprehensive guide demonstrates how to build a financial host system for card issuing using Formance Ledger. Learn to manage cardholder balances, process authorizations in real-time, handle holds, and settle with card schemes.
What is a Financial Host?
A Financial Host is the authoritative system for cardholder available balances when authorization requests arrive from card networks. It determines in real-time whether to approve or decline transactions based on the cardholder’s current balance and risk parameters.Evolution of Financial Hosts
- Legacy Systems
- Modern Real-Time
Batch Processing Era:
- Balances managed outside financial institutions
- Using floors and ceilings to indicate available balance to spend
- Daily or periodic synchronization with core banking
- Limited real-time capabilities
- Higher fraud risk due to stale balance data
- Still used to inform processing subsystems of balances snapshots to allow Stand-In Processing or STIP
Scope of This Guide
This guide focuses on card issuing use cases, demonstrating patterns for:- Authorization Management: Real-time approval/decline decisions with hold accounts
- Balance Tracking: Available vs. actual balance with authorization holds
- Scheme Settlement: Managing liabilities to Visa, Mastercard, and other networks
- Transaction Lifecycle: From authorization through presentment to settlement
Implementation Guide
This section demonstrates how to model financial host operations for card issuing in Formance Ledger.System Actors
- Cardholders
- Banks
- Schemes
- Platform
- Program Manager
Normal Credit Accounts - Track cardholder available balances.These are the main customers of the Financial Institution providing issuing services. The financial host manages their available balance and processes transactions they initiate.These accounts represent liabilities towards cardholders. In retail offerings to consumers, each customer has their own account with directly associated available balance. In corporate or B2B setups (e.g., managing expense cards), there might be additional accounts per card. This example focuses on retail ‘pre-paid’ card scenarios.Account structure:This can be linked to the Payment Acceptance example, where they can top-up the account, providing immediate balance available for card spending.
Balance & Available Balance
By default, Numscript applies deterministic postings and implicitly considers the available balance before bookings are accepted and registered. If you only have $20 in a user’s account, a transaction/authorization for $21 will be refused. Numscript has provisions to consider overdraft, which changes the available balance and adjusts the zero point accordingly. This enables credit-like products or authorized overdraft facilities.Transaction Patterns
Below are example Numscripts that capture the intent of the movements and bookings needed to handle typical Financial Host cases for cards. This is merely an example and your business might need different implementations, additional details, different steps and events to handle, etc.Download the T-Account Movements Excel Template to visualize all accounting entries with detailed T-account diagrams for each issuing financial host flow described in this guide.
Card Authorization (Approved for full amount)
Variables
- $asset (asset): asset in UMN
- $amount (number): Transaction amount
- $account_id (account): Account identifier
- $authorization_id (string): Unique authorization reference
- $pii_id (string): Payment instrument token
- $trx_details: JSON blob with transaction details from the processor
Accounts Used
@cardholder:account_id:hold:$authorization_idNumscript
Funds are moved from the cardholder’s main account to a hold account, making them unavailable for other transactions until the authorization is settled or reversed. The hold account uses the
authorization_id to uniquely identify this authorization, allowing for proper tracking even with multiple concurrent authorizations.Example Usage
Authorization without overdraft - Try in Playground →Card Authorization (Declined)
When an authorization is declined due to insufficient funds, fraud rules, or other reasons, no postings are created in the ledger. The decline response is sent to the processor, but no balance changes occur.Declined authorizations don’t create any ledger transactions. However, you may want to log declined authorization attempts in metadata or a separate audit system for fraud monitoring, risk analysis, and customer support purposes. The playground example below shows the numscript attempting to execute but failing due to insufficient funds (balance + overdraft < amount).
Example Usage
Authorization declined - insufficient funds - Try in Playground →Card Authorization (Approved for partial amount)
In case you would want to support Partial Authorizations, typically requested/required in deferred payments like automatic fuel dispensersVariables
- $asset (asset): asset in UMN
- $amount (number): Transaction amount
- $account_id (account): Account identifier
- $authorization_id (string): Unique authorization reference
- $pii_id (string): Payment instrument token
- $trx_details: JSON blob with transaction details from the processor
Accounts Used
@cardholder:account_id:hold:$authorization_idNumscript
Using
send [$asset *] with max [$asset $amount] from... allows the system to authorize up to the requested amount but only what’s actually available (including overdraft). The actual authorized amount may be less than requested. Your system must communicate the approved partial amount back to the terminal/merchant so they can decide whether to accept it or cancel the transaction.Example Usage
Authorization for partial amount - Try in Playground →Card Authorization (Incremental)
Incremental authorizations allow merchants to increase the authorization amount after the initial approval. Common in hospitality (adding room charges), car rentals (extending rental period), and gas stations (continued fueling) where the final amount isn’t known upfront.Variables
- $asset (asset): asset in UMN
- $amount (number): Additional authorization amount (incremental)
- $account_id (account): Account identifier
- $authorization_id (string): Original authorization reference (same for all increments)
- $pii_id (string): Payment instrument token
- $trx_details: JSON blob with transaction details from the processor
Accounts Used
@cardholder:account_id:hold:$authorization_idNumscript
Example Usage
Initial authorization for €50 - Try in Playground →The same
authorization_id is used for both the initial and incremental authorizations. The hold account accumulates all authorization amounts. In this example, after the incremental authorization, the total held amount would be €80.00 (€50 + €30).Authorization Reversal
Authorization reversals release previously authorized funds back to the cardholder. This occurs when a merchant cancels a transaction, at network request, or when the processor requires it if no presentment is received within the expected timeframe.Variables
- $asset (asset): asset in UMN
- $amount (number): Amount to reverse (can be partial or full authorization amount)
- $account_id (account): Account identifier
- $authorization_id (string): Original authorization reference to reverse
- $reversal_id (string): Unique reversal transaction reference
- $pii_id (string): Payment instrument token
- $trx_details: JSON blob with reversal details from the processor
Accounts Used
@cardholder:account_id:hold:$authorization_idNumscript
Example Usage
Full authorization reversal - Try in Playground →Authorization reversals move funds from the hold account back to the main account, making them available again to the cardholder. Full reversals release the entire authorization amount, while partial reversals release only a portion, leaving the remaining amount on hold.
Postings / Completions / Presentments
Presentment (also called clearing, posting, or completion) is when the merchant submits the transaction for final settlement. This typically happens at the end of the business day or when the merchant batches their transactions. The held funds are released and the transaction moves to settlement with the scheme.Variables
- $asset (asset): asset in UMN
- $amount (number): Final settlement amount (may differ from original authorization)
- $account_id (account): Account identifier
- $authorization_id (string): Original authorization reference
- $presentment_id (string): Unique presentment transaction reference
- $scheme_id (account): Card scheme identifier (Visa, Mastercard, etc.)
- $pii_id (string): Payment instrument token
- $trx_details: JSON blob with presentment details from the processor
Accounts Used
@cardholder:authorization_id @schemes:$scheme_id:mainNumscript
Example Usage
Presentment matching authorization amount - Try in Playground →When a presentment is received, funds move from the hold account to the scheme’s liability account. If the presentment is for less than the authorization, the remaining balance in the hold account should be released back to the cardholder’s main account via a reversal.
Presentment with Higher Amount (Tip Adjustment)
When a presentment amount exceeds the original authorization (common with restaurant tips), you need to debit the additional amount from the cardholder’s main account. This requires a multi-step transaction to handle both the authorized hold and the additional charge.Variables
- $asset (asset): asset in UMN
- $auth_amount (number): Original authorization amount held
- $additional_amount (number): Additional amount beyond authorization (e.g., tip)
- $account_id (account): Account identifier
- $authorization_id (string): Original authorization reference
- $presentment_id (string): Unique presentment transaction reference
- $scheme_id (account): Card scheme identifier
- $pii_id (string): Payment instrument token
- $trx_details: JSON blob with presentment details including tip breakdown
Accounts Used
@cardholder:account_id:hold:scheme_id:mainNumscript
Example Usage
Presentment with tip adjustment - €100 auth + €25 tip - Try in Playground →This two-step posting creates a single transaction that debits both the hold account (authorized amount) and the main account (tip), crediting the total to the scheme. The transaction metadata includes both the original authorization amount and the tip breakdown for reconciliation purposes.
Offline Transaction Presentment
Offline transactions occur when the card terminal cannot communicate with the issuer in real-time (e.g., airplane purchases, remote locations, or chip fallback). The transaction is approved by the card chip based on card risk parameters, and the presentment arrives without a prior authorization. These transactions must be debited directly from the cardholder’s main account.Variables
- $asset (asset): asset in UMN
- $amount (number): Transaction amount to debit
- $account_id (account): Account identifier
- $presentment_id (string): Unique presentment transaction reference
- $scheme_id (account): Card scheme identifier
- $pii_id (string): Payment instrument token
- $trx_details: JSON blob with offline transaction details from the processor
Accounts Used
@cardholder:scheme_id:mainNumscript
Example Usage
Offline transaction - airplane purchase - Try in Playground →Unlike online authorizations, offline transactions have no hold account - the debit is direct and final. The transaction is marked with
authorization_mode: "offline" to distinguish it from regular presentments. Some offline transactions may arrive days or even weeks after they occurred, depending on when the merchant batches them.Refund ‘Authorization’
A refund authorization occurs when a merchant initiates a credit transaction back to the cardholder (returns, cancellations after settlement, etc.). Unlike regular authorizations, the funds are not immediately available to the cardholder - they only become available after the refund is posted/settled. This requires a two-step process.Step 1: Refund Authorization (Pending)
The refund is authorized but funds are held in a pending state until settlement.Variables
- $asset (asset): asset in UMN
- $amount (number): Refund amount
- $account_id (account): Account identifier
- $refund_auth_id (string): Unique refund authorization reference
- $scheme_id (account): Card scheme identifier
- $pii_id (string): Payment instrument token
- $trx_details: JSON blob with refund authorization details
Accounts Used
@schemes:account_id:refund:pending:$refund_auth_idNumscript
Example Usage
Refund authorization - €75 return - Try in Playground →Step 2: Refund Posting/Settlement
Once the refund is settled, funds are released from the pending account to the cardholder’s main account, making them available for use.Variables
- $asset (asset): asset in UMN
- $amount (number): Refund amount to release
- $account_id (account): Account identifier
- $refund_auth_id (string): Original refund authorization reference
- $refund_posting_id (string): Unique refund posting reference
- $trx_details: JSON blob with refund posting details
Accounts Used
@cardholder:refund_auth_id @cardholder:$account_id:mainNumscript
Example Usage
Refund posting - funds released to cardholder - Try in Playground →The two-step refund process ensures proper accounting and tracking:
- Authorization: Funds move from scheme liability to a pending refund account (not yet available to spend)
- Posting: Funds move from pending to the cardholder’s main account (now available)
Authorization Hold Reversal (Partial or Expired)
An authorization hold reversal releases remaining funds from the hold account back to the cardholder’s main account. This occurs when a partial presentment leaves funds in the hold, or when an authorization expires without being presented. Using the wildcard amount[$asset *] ensures all remaining held funds are released, regardless of the exact amount.
Variables
- $asset (asset): asset in UMN
- $account_id (account): Account identifier
- $authorization_id (string): Original authorization reference
- $reversal_id (string): Unique reversal transaction reference
- $pii_id (string): Payment instrument token
- $trx_details: JSON blob with reversal details (reason: partial_presentment, expired, merchant_cancel, etc.)
Accounts Used
@cardholder:authorization_id @cardholder:$account_id:mainNumscript
Example Usage
Reversal after partial presentment - €25 remaining - Try in Playground →Using
[$asset *] allows the reversal to release all remaining funds from the hold account without needing to specify the exact amount. This is essential for:- Partial presentments: When only part of the authorization was presented, the remainder needs to be released
- Expired authorizations: When no presentment occurs within the validity period (typically 7-30 days)
- Merchant cancellations: When the merchant cancels before presentment
- Incremental authorizations: When you need to release the cumulative total regardless of how many increments occurred
* automatically calculates and releases whatever balance exists in the hold account, making the reversal logic simple and foolproof.Chargeback
A chargeback occurs when a cardholder disputes a transaction, and the issuer accepts the claim. The process involves two steps: initially crediting the cardholder from a dedicated chargeback account, then confirming the chargeback by settling with the scheme’s main settlement account.Step 1: Chargeback Acceptance
When a chargeback is accepted, the cardholder is immediately credited from a dedicated scheme chargeback account.Variables
- $asset (asset): asset in UMN
- $amount (number): Chargeback amount
- $account_id (account): Account identifier
- $chargeback_id (string): Unique chargeback reference
- $scheme_id (account): Card scheme identifier
- $original_presentment_id (string): Reference to the original transaction being disputed
- $pii_id (string): Payment instrument token
- $trx_details: JSON blob with chargeback details (reason code, dispute category, etc.)
Accounts Used
@schemes:account_id:mainNumscript
Example Usage
Chargeback acceptance - unauthorized transaction - Try in Playground →Step 2: Chargeback Confirmation
Once the chargeback is confirmed, the scheme deducts the chargeback amount from the settlement. This moves funds from the scheme’s main settlement account to cover the chargeback account.Variables
- $asset (asset): asset in UMN
- $amount (number): Chargeback amount
- $chargeback_id (string): Original chargeback reference
- $scheme_id (account): Card scheme identifier
- $settlement_ref (string): Reference to the settlement where chargeback was deducted
- $trx_details: JSON blob with settlement details
Accounts Used
@schemes:scheme_id:chargebackNumscript
Example Usage
Chargeback confirmation via settlement - Try in Playground →The two-step chargeback process ensures proper accounting:
- Acceptance: Cardholder is credited immediately from the scheme’s chargeback account (customer service)
- Confirmation: The scheme’s main settlement account covers the chargeback account when settlement is adjusted
Second Presentment (Chargeback Reversal)
A second presentment occurs when a merchant successfully contests a chargeback by providing compelling evidence. The issuer must reverse the chargeback, debiting the cardholder’s account again and crediting the scheme to re-establish the liability.Variables
- $asset (asset): asset in UMN
- $amount (number): Transaction amount (original chargeback amount)
- $account_id (account): Account identifier
- $chargeback_id (string): Original chargeback reference being reversed
- $second_presentment_id (string): Unique second presentment reference
- $scheme_id (account): Card scheme identifier
- $pii_id (string): Payment instrument token
- $trx_details: JSON blob with second presentment details (merchant evidence, arbitration result, etc.)
Accounts Used
@cardholder:scheme_id:mainNumscript
Example Usage
Second presentment - merchant wins dispute - Try in Playground →A second presentment reverses the chargeback by:
- Debiting the cardholder’s account (reversing the chargeback credit they received)
- Crediting the scheme’s liability account (re-establishing the debt to be settled)
Process STIP Advices
STIP (Stand-In Processing) advices are notifications of transactions that were approved by the processor or network when the issuer’s authorization system was unavailable (system downtime, network issues, etc.). The processor uses predefined rules to approve or decline these transactions on behalf of the issuer. When the issuer system comes back online, STIP advices must be processed as mandatory debits.Variables
- $asset (asset): asset in UMN
- $amount (number): Transaction amount
- $account_id (account): Account identifier
- $stip_advice_id (string): Unique STIP advice reference
- $scheme_id (account): Card scheme identifier
- $pii_id (string): Payment instrument token
- $trx_details: JSON blob with STIP transaction details (stand-in decision, approval reason, etc.)
Accounts Used
@cardholder:scheme_id:mainNumscript
Example Usage
STIP advice - approved during system downtime - Try in Playground →STIP advices are similar to offline transactions - both are mandatory debits that occurred without real-time issuer authorization. The key difference is that STIP transactions were approved by the processor/network based on configured parameters, while offline transactions were approved by the card chip itself. Both require unbounded overdraft to ensure successful processing.
Querying the Ledger
The Formance Ledger allows you to query aggregated account balances using powerful filtering with wildcards. The way accounts are organized enables you to track specific aspects of your issuing system.All Amounts Currently in Hold Accounts
Query all authorization hold accounts across all cardholders to see total funds pending settlement:- Total funds authorized but not yet settled
- Liquidity management and forecasting
- Monitoring authorization aging
All Hold Accounts for a Specific Cardholder
Query all authorization holds for a single cardholder:- Customer service inquiries about pending charges
- Investigating why available balance differs from account balance
- Identifying stuck or expired authorizations
Specific Authorization Hold
Query a single authorization hold:All Pending Refunds
Query all pending refunds across the system:- Tracking refund processing time
- Identifying delayed refunds
- Reconciliation with scheme settlement reports
All Scheme Liabilities
Query total liability owed to a specific scheme:- Settlement preparation and forecasting
- Liquidity management
- Multi-scheme volume analysis
All Cardholder Main Accounts
Query all cardholder main account balances:- Total cardholder liability calculation
- Regulatory reporting
- Reserve requirement calculations
Chargeback Accounts by Scheme
Query chargeback liabilities for a specific scheme:Combining Filters with Metadata
Query authorizations for a specific payment instrument with balance check:Query by Transaction Type
Find all offline transactions:These filtering patterns enable real-time monitoring of your issuing operations without needing separate tracking systems. All the information is inherently available in the ledger’s account structure, making reconciliation and operational reporting straightforward. See the Filtering Queries documentation for complete syntax reference.