Payments Documentation


Transfers can either be:
  • - Single-Phase, where they are executed immediately or
  • - Two-Phase, where they are first put in a Pending state and then either Accepted or Rejected / Perfect primitive for atomic transfers across different systems.

Let`s enhance our Income Tracking recipe to use Two-Phase transfer by managing the inflight balance / Distinguish between inflight reserved amounts and accepted/commited amounts to control inflight liquidity.

Two-Phase Transfer is used to place the payment in a Pending state, ensuring that the transaction is only finalized once the payment provider confirms success.

Account CodeAccount NameAccount TypeDescription
4000Services RevenueIncomeRevenue from selling IT services.
1100Accounts Receivable – Client XAssetAmounts owed by Client X for provided services or subscriptions.
1000Cashe/BankAssetCash in hand or bank balances.
2400Sales Tax/VATLiabilityTaxes collected from the customers that you owe to tax authorities.
6500Payment Provider FeesExpensePayment providers like Stripe or PayPal charge fees for processing transactions.

Example Transaction Flow: Recording Services Revenue (Two-Phase)

Step 1: Issuing an Invoice for Services Rendered

IT consultancy completes a service for Client X and issues an invoice for $2,000 in services, plus a 10% sales tax ($200), for a total of $2,200.

In this step, the Accounts Receivable account is increased by the full invoice amount ($2,200), and the Sales Tax Payable account reflects the tax liability, which you will later remit to the tax authority.

AccountDebitCredit
Accounts Receivable – Client X (1100)$2,200
Sales Tax Payable (2400)$200
Services Revenue (4000)$2,000

Step 2: Receiving Payment for the Invoice (over Stripe payment provider)

2A - When Client X pays the $2,200 invoice, and the payment is processed through a payment provider that charges a 3% fee (total fee: $66), you record the payment minus the fee. The payment is not yet finalized but is authorized and held by Stripe (PENDING)!

AccountDebit PendingDebitCredit PendingCredit
Cash/Bank (1000)$2,134
Payment Provider Fees (6500)$66
Accounts Receivable – Client X (1100)$2,200

2B - Once the payment is finalized and Stripe transfers the funds to your Cash/Bank account, the pending entry is cleared, and the funds become available.

AccountDebit PendingDebitCredit PendingCredit
Cash/Bank (1000)$2,134
Payment Provider Fees (6500)$66
Accounts Receivable – Client X (1100)$2,200

Summary of Payments and Two-Phase Transfers:

  • This approach leverages two-phase transfers to manage inflight balances, providing clear visibility into payments as they move from pending to final status, while keeping your accounting books accurate and synchronized with the payment provider's flow.