How online card payments work
When your customer makes a purchase with a card, the process unfolds in two stages: authorization and settlement.1
Authorization
The card network requests confirmation that the customer has sufficient funds.
2
Settlement
Hours or days later, the payment processor sends the final confirmation.
Prerequisites
Before starting, ensure you have:- A running Blnk Core instance (e.g. at
http://localhost:5001). - An API key for Blnk (replace
YOUR_API_KEYin the code examples). Required for authenticated requests. - Optionally, you can connect your Blnk Core to your Blnk Cloud workspace to view your ledger data.
1: Create card account
Each card account will be represented with a ledger. The card balance will be created under this ledger.Create a ledger
Create a ledger for the card account. This groups all of the balances for that customer in one place:
Save the
ledger_id from the response. You’ll need it to create balances for the card account.
Create customer identity
Create a customer identity to link all balances to the same customer identity:
Save the
identity_id from the response. You’ll use this ID to link all balances to this customer.
Create card balance
Create a balance for the card account. This balance will track all card transactions:

Save the
balance_id from the response. You’ll need it for creating transactions throughout this tutorial.2: Authorization
Authorizing a card transaction means telling the processor that the customer has enough funds to cover the transaction, and they can proceed with the transaction. You can model this in Blnk with inflight transactions.1
Money movement map
When a card transaction is authorized, money moves from the customer’s card balance to 
Explore the map yourself hereThe transaction is created with
@World-USD (representing the external merchant):
inflight: true, so it remains pending until the payment processor clears it (or the transaction is voided).2
Create an inflight transaction
Create an inflight transaction to authorize the payment. Setting 
inflight = true puts the transaction in a pending state until it’s settled or voided.@World-USD is an internal balance that represents money leaving and coming into your system (like payments to merchants or payments from customers). Internal balances use the @ prefix and don’t require a balance ID.
3
Confirm authorization
- Using the queue
- Skipping the queue
If you use the queue, Blnk returns a
QUEUED status in the API response, processes the transaction asynchronously, and emits a webhook event when complete.To confirm authorization, listen for these events:4
Handling fund reservation
When a transaction is 
INFLIGHT, the amount is reserved and unavailable until the transaction settles or is voided.Blnk handles this automatically. Each inflight transaction reduces the customer’s available balance. If the available balance is insufficient to cover a new transaction, that transaction is rejected.Any new transaction over $3,000 will be rejected. This prevents spending funds already reserved for pending card payments.

3: Settlement
Once a transaction is settled by the payment processor, it means the money has finally been transferred to the recipient. Now, you can commit the inflight transaction. This moves the transaction fromINFLIGHT (pending) to APPLIED (completed).
If it was rejected or cancelled, you can void the transaction instead.
1
Money movement map
When you commit the inflight transaction, it finalizes the money movement that was authorized:
The transaction status changes from

INFLIGHT to APPLIED, completing the transfer.2
Update the inflight transaction
Once clearing is received, update the inflight transaction from the authorization step depending on the outcome.
This approach allows your ledger to cleanly track when the transaction was initiated, and when it was completed based on your business requirements.
- Settlement successful
- Payment reversed or cancelled
Commit the inflight transaction. This turns the transaction from
INFLIGHT (pending) to APPLIED (completed).Conclusion
You now have a fully functional card payment system built with Blnk Finance. This system can:- Create and manage card accounts with a ledger and card balance
- Authorize card transactions using inflight transactions to reserve funds
- Commit or void inflight transactions when they’re settled or rejected