Transaction Kinds
The Gnosis Pay API returns three distinct types of transaction events, each with different behaviors and timing:Payment
Regular card transactions including purchases, ATM withdrawals, and other card usage. Key Characteristics:- Immediate visibility: Appears in the API immediately after authorization
- Status tracking: Has a
status
field indicating approval, decline reasons, or reversals - Pending behavior: Shows
isPending: true
when authorized but not yet settled - Settlement timing: Usually settles within 24 hours, but can take up to a month for certain merchants (hotels, car rentals)
- Point-of-sale purchases
- ATM cash withdrawals
- Online purchases
- Hotel pre-authorizations
Refund
Money being returned to the cardholder’s account, typically from product returns or service cancellations. Key Characteristics:- Delayed visibility: Only appears after both authorization AND clearing are processed
- No status field: Unlike payments, refunds don’t have approval/decline status
- Amount fields: Includes
refundAmount
andrefundCurrency
fields - Pending behavior: Can still show
isPending: true
if additional clearing steps are required
- Product returns to merchants
- Service cancellations
- Merchant-initiated refunds
- Dispute resolutions
Reversal
Cancellation or reversal of previous transactions, often due to technical issues or merchant corrections. Key Characteristics:- Variable timing: Can appear immediately (authorization-level) or after clearing
- Amount fields: Includes
reversalAmount
andreversalCurrency
fields - Quick processing: Usually processed faster than refunds
- No status field: Similar to refunds, no approval/decline status
- Duplicate transaction corrections
- Technical payment processing errors
- Merchant-initiated transaction cancellations
- Partial transaction reversals
Transaction Lifecycle
Understanding the transaction lifecycle is crucial for proper integration:Authorization Phase
- Card Usage: Customer uses card at merchant
- Authorization Request: Merchant requests payment authorization
- Real-time Processing: Gnosis Pay validates funds, limits, and fraud checks
- Response: Authorization approved or declined
- API Visibility:
- Payments: Immediately visible with
isPending: true
- Refunds: Not yet visible (requires clearing)
- Reversals: May be visible if authorization-level reversal
- Payments: Immediately visible with
Clearing Phase
- Settlement Processing: Usually within 24 hours (can be longer for certain MCCs)
- Final Amount: May differ from authorization amount
- API Updates:
- Payments:
isPending
becomesfalse
,clearedAt
is set - Refunds: Now become visible in the API
- Reversals: Update with final amounts and timing
- Payments:
Integration Best Practices
Handling Different Transaction Kinds
Monitoring Transaction Status
Error Handling
Different transaction kinds may have different error scenarios:- Payments: Can be declined for various reasons (insufficient funds, incorrect PIN, etc.)
- Refunds: Usually appear only when successfully processed
- Reversals: Indicate correction of previous errors
Common Integration Patterns
Real-time Balance Updates
- Payments: Money is immediately deducted from user account and moved to hold account on chain when
isPending: true
- Refunds: Add to balance when transaction appears (usually already cleared)
- Reversals: Adjust balance based on reversal type and amount
User Notifications
- Payments: Notify immediately for both pending and completed
- Refunds: Notify when refund appears (money is being returned)
- Reversals: Notify about transaction corrections
Transaction History Display
- Show transaction kind clearly in the UI
- Use
isPending
status for appropriate visual indicators - Handle currency conversions (billing vs transaction currency)
- Display appropriate amounts based on transaction kind
Next Steps
- Transaction Lifecycle Details - Deep dive into authorization and clearing
- API Integration Guide - Complete integration examples
- API Reference - Full API documentation