Payments Documentation
- - 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 Code | Account Name | Account Type | Description |
---|---|---|---|
4000 | Services Revenue | Income | Revenue from selling IT services. |
1100 | Accounts Receivable – Client X | Asset | Amounts owed by Client X for provided services or subscriptions. |
1000 | Cashe/Bank | Asset | Cash in hand or bank balances. |
2400 | Sales Tax/VAT | Liability | Taxes collected from the customers that you owe to tax authorities. |
6500 | Payment Provider Fees | Expense | Payment 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.
Account | Debit | Credit |
---|---|---|
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)!
Account | Debit Pending | Debit | Credit Pending | Credit |
---|---|---|---|---|
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.
Account | Debit Pending | Debit | Credit Pending | Credit |
---|---|---|---|---|
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.