Overview
Orchestration templates are pre-built workflow patterns for common payment scenarios. Each template includes an architecture diagram, code examples, configuration steps, and monitoring recommendations. Use these as starting points and customize for your specific requirements.Template 1: Marketplace Checkout
Use Case
A marketplace where buyers purchase from multiple sellers through a single checkout. The platform collects payment, takes a commission, and distributes funds to sellers.Architecture
Code Example
Configuration Steps
Register recipients
Configure split rules
Set payout schedules
Enable escrow (optional)
Escrow and Release Patterns
For marketplaces that require delivery confirmation before releasing funds:Monitoring
- Dashboard > Payments: Track split payment status and individual recipient payouts
- Dashboard > Payouts: Monitor payout execution and settlement times
- Webhook: Listen for
payout.completedandpayout.failedevents
Template 2: Subscription with Dunning
Use Case
A SaaS platform that charges customers on a recurring basis. When a payment fails, a smart retry cascade attempts to recover the payment before cancelling the subscription.Architecture
Smart Retry Configuration
Configure retry logic in Dashboard > Orchestration > Retry Rules:Customer Notification Touchpoints
Code Example: Creating a Recurring Payment
Monitoring
- Dashboard > Payments > Recurring: Track retry attempts and outcomes
- Webhook: Listen for
payment.retry.scheduled,payment.retry.succeeded,payment.retry.exhausted - Metrics to track: Recovery rate (successful retries / total retries), involuntary churn rate
Template 3: Split Payment with Escrow
Use Case
A services platform where payments are held in escrow and released to service providers based on milestone completion. Supports partial releases as milestones are achieved.Architecture
Escrow Configuration
Releasing Escrow Funds
Escrow Timing and Rules
Monitoring
- Dashboard > Payments > Escrow: View active escrows, balances, and release history
- Webhook: Listen for
escrow.funded,escrow.released,escrow.expired,escrow.disputed - Alerts: Configure alerts for escrows approaching their maximum hold period
Template 4: Cross-Border with FX Optimization
Use Case
An international merchant that accepts payments in local currencies and settles in their preferred currency. The orchestration engine routes transactions to providers offering the best foreign exchange rates.Architecture
Multi-Currency Settlement Configuration
Configure currency routing in Dashboard > Orchestration > Currency Rules:Code Example: Cross-Border Payment
FX Rate Comparison Response
When orchestration selects a provider, the response includes FX details:Configuration Steps
Enable multi-currency settlement
Configure provider priority per currency
Set FX markup thresholds
Enable FX rate monitoring
Monitoring
- Dashboard > Analytics > FX Rates: Compare provider rates by currency pair
- Dashboard > Payments: Filter by settlement currency to track cross-border transactions
- Webhook: Listen for
payment.settledevents with FX details - Metrics to track: Average FX markup by provider, settlement timing, provider failover frequency
Template 5: SaaS with Usage-Based Billing
Use Case
A SaaS platform that combines a base subscription fee with metered usage charges. Customers prepay credits or are invoiced for overages at the end of each billing period. Common for API platforms, cloud infrastructure, and communication services.Architecture
Code Example
Configuration Steps
Set up usage tracking
Configure credit tiers
Define overage pricing
Enable automated invoicing
Configure credit purchase flow
Monitoring
- Dashboard > Payments > Recurring: Track invoice payment success rates per billing cycle
- Webhook: Listen for
payment.approvedto confirm balance credit or invoice payment, andpayment.retry.exhaustedto trigger account suspension - Metrics to track: Invoice collection rate, average days to collect, prepaid vs. postpaid revenue split, overage revenue as percentage of total
Template 6: Affiliate/Commission Network
Use Case
A platform with multi-tier affiliate or commission structures where referrals generate payouts across multiple levels. Supports referral tracking, tiered commission rates, and scheduled batch payouts to affiliates.Architecture
Commission Tier Configuration
Code Example
Configuration Steps
Register affiliate recipients
Define commission tiers
split_rules at payment time.Set payout schedules by tier
Track referral attribution
affiliate_l1_id, affiliate_l2_id, and referral_code in payment metadata for attribution reporting. Use Dashboard > Payments filtered by metadata to generate commission reports.Handle refunds and clawbacks
Monitoring
- Dashboard > Payments: Filter by metadata
affiliate_l1_idto view sales attributed to each affiliate - Dashboard > Payouts: Monitor batch payout execution, failed payouts, and pending balances per affiliate
- Webhook: Listen for
payout.completed,payout.failed, andpayment.refundedevents to update commission ledgers - Metrics to track: Revenue per affiliate, commission payout ratio, refund/clawback rate, affiliate activation rate