Overview
The payment system consists of two main components:Income Transactions
Track all financial transactions for guides
Withdrawal Requests
Manage guide payout requests and processing
Income Transactions
Income transactions record all financial activity related to a guide’s earnings.Data Model
Transaction Types
BOOKING_INCOME
BOOKING_INCOME
When: A tourist completes a booked tour.Sign:
POSITIVE (increases guide balance)Fields:tripId: The completed triptourId: The tour that was bookedamount: Tour pricedescription: e.g., “Income from Tokyo Food Tour”
WITHDRAWAL
WITHDRAWAL
When: A guide requests and receives a payout.Sign:
NEGATIVE (decreases guide balance)Fields:tripId: nulltourId: nullamount: Withdrawal amountdescription: e.g., “Withdrawal to bank account”
REFUND
REFUND
When: A booking is cancelled and money is returned to the tourist.Sign:
NEGATIVE (decreases guide balance)Fields:tripId: The cancelled triptourId: The cancelled touramount: Refund amount (may be partial)description: Reason for refund
ADJUSTMENT
ADJUSTMENT
When: Manual corrections, platform fees, bonuses, or other adjustments.Sign: Can be
POSITIVE or NEGATIVEFields:tripId: null (usually)tourId: null (usually)amount: Adjustment amountdescription: Explanation of adjustment
Transaction Sign
POSITIVE Transactions
- Booking income
- Bonuses
- Credit adjustments
NEGATIVE Transactions
- Withdrawals
- Refunds
- Fees and deductions
Transaction Status
Withdrawal Requests
Guides request payouts through the withdrawal system.Data Model
Withdrawal Status
Withdrawal Flow
API Endpoints
Income Transactions
?guideId={id}- Get transactions for a guide?txnType={type}- Filter by transaction type?status={status}- Filter by status?startDate={date}&endDate={date}- Date range filter
Withdrawal Requests
?guideId={id}- Get requests for a guide?status={status}- Filter by status
Usage Examples
Recording Booking Income
Creating a Withdrawal Request
Approving and Processing Withdrawal
Calculating Guide Balance
Integration with Bookings
When a trip is completed:Financial Reporting
Guides can view their financial data:Available Balance
Sum of all completed positive minus negative transactions
Pending Income
Sum of transactions with
status=PENDINGTotal Earnings
Sum of all completed
BOOKING_INCOME transactionsTotal Withdrawals
Sum of all completed
WITHDRAWAL transactionsTransaction History
Display transaction list with:- Date and time
- Transaction type
- Amount with sign (+/-)
- Description
- Associated trip/tour (if applicable)
- Current status
Best Practices
Audit trail: The transaction system provides a complete financial audit trail. Never delete transactions; use
CANCELLED status instead.Security Considerations
- Authorization: Only guides can view their own transactions
- Admin Access: Only admins can approve/reject withdrawal requests
- Validation: Verify guide has sufficient balance before withdrawal
- Idempotency: Prevent duplicate transactions from being created
Common Questions
When is booking income credited to the guide?
When is booking income credited to the guide?
Income is typically credited when the trip status changes to
COMPLETED. Some platforms may hold funds for a period to allow for dispute resolution.What if a booking is cancelled after payment?
What if a booking is cancelled after payment?
A
REFUND transaction with sign=NEGATIVE is created, reducing the guide’s balance. The refund policy (full vs. partial) depends on business rules.How long do withdrawal requests take to process?
How long do withdrawal requests take to process?
This depends on the admin review process and payment method. Typical flow: Guide requests → Admin reviews within 24-48 hours → Payment processed within 3-5 business days.
Can guides see their transaction history?
Can guides see their transaction history?
Yes, guides can view all their transactions through the API endpoint filtered by their
guideId. This provides complete transparency.How are platform fees handled?
How are platform fees handled?
Platform fees are recorded as
ADJUSTMENT transactions with sign=NEGATIVE. These are typically created automatically when booking income is recorded.Related Features
Trip Bookings
Learn how bookings generate income transactions
Guide Profiles
See how income data appears on guide profiles