Overview
The Booking Transaction Processed trigger starts a workflow when a payment transaction is processed for a booking in your CaptainBook system.
When It Triggers
A payment transaction is successfully processed
Refunds are processed
Partial payments are completed
Transaction status changes to processed
Use Cases
Send payment confirmation emails
Generate receipts
Update accounting systems
Process commission payments
Notify partners about transactions
Track payment analytics
Handle refund notifications
Configuration
This trigger requires no additional configuration. It automatically triggers when any booking transaction is processed.
Available Data
When this trigger fires, it provides a transaction object with comprehensive transaction information, plus access to the related booking.
Transaction Object Structure
Basic Information
id- Transaction IDbooking_id- Related booking IDcustomer_id- Customer IDamount- Transaction amountcurrency- Currency code
Payment Details
payment_method- Payment method usedcharge_id- Payment processor charge IDpayment_provider_id- Payment provider IDpayment_provider_metadata- Provider-specific metadatapayment_provider_fee- Provider fees
Financial Information
fx_rate- Foreign exchange rate (if applicable)tips- Tips amountorigin- Transaction origin
Refund Information
refund_for- Original transaction ID (if this is a refund)refund_user_id- User who processed refund
Timestamps
created_at- Transaction creation dateupdated_at- Last update datedeleted_at- Deletion date (if soft-deleted)
Booking Context
The trigger also provides access to the related booking through transaction.booking_id. You can use the "Get Booking" action to retrieve full booking details.
Accessing Transaction Data
{transaction.id}
{transaction.amount}
{transaction.currency}
{transaction.payment_method}
{transaction.charge_id}Example Workflows
1. Send Payment Confirmation
Workflow Steps:
Trigger: Booking Transaction Processed
Action: Get Booking (using
{transaction.booking_id})Action: Send Notification
To:
{booking.customer.email}Subject: "Payment Received"
Body: Include transaction and booking details
2. Generate Receipt
Workflow Steps:
Trigger: Booking Transaction Processed
Condition: If
{transaction.refund_for}is empty (not a refund)Action (True): Get Booking
Action: Send Webhook (generate receipt PDF)
Action: Send Notification (send receipt url)
3. Update Accounting System
Workflow Steps:
Trigger: Booking Transaction Processed
Action: Get Booking
Action: Get Customer
Action: Send Webhook
URL: Accounting system endpoint
Payload: Transaction, customer and booking data
4. Process Refund Notification
Workflow Steps:
Trigger: Booking Transaction Processed
Condition: If
{transaction.refund_for}is not emptyAction (True): Get Booking
Action: Send Notification (refund confirmation)
5. Commission Calculation
Workflow Steps:
Trigger: Booking Transaction Processed
Action: Get Booking
Condition: If
{booking.reseller_id}is not emptyAction (True): Calculate commission
Action: Send Webhook (notify reseller)
Testing
When testing this trigger:
Select a processed transaction from your system
The workflow will use that transaction's data
Review execution logs to see transaction details
Test Data
The trigger provides access to the last 20 processed transactions for testing.
Best Practices
Get booking details - Use "Get Booking" action to access full booking context
Handle refunds - Check
refund_forto distinguish payments from refundsValidate amounts - Verify transaction amounts match expectations
Secure webhooks - Use authentication for external system integrations
Log transactions - Keep records of all processed transactions
Handle errors - Set up error notifications for failed webhooks
