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.These templates use Yuno’s payment orchestration engine. Ensure your account has orchestration enabled in Dashboard > Settings > Features.
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
Create seller accounts in Dashboard > Payouts > Recipients with bank account details and KYC verification.
Configure split rules
Define default commission rates in Dashboard > Orchestration > Split Rules or pass them per transaction via the API.
Set payout schedules
Configure payout frequency per recipient (daily, weekly, on-demand) in Dashboard > Payouts > Schedules.
Escrow and Release Patterns
For marketplaces that require delivery confirmation before releasing funds:| Escrow Event | Trigger | Action |
|---|---|---|
| Hold | Payment approved | Funds held in escrow |
| Partial release | Partial delivery confirmed | Release portion to seller |
| Full release | Full delivery confirmed | Release remaining funds |
| Refund | Dispute or cancellation | Return funds to buyer |
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
| Event | Timing | Channel | Content |
|---|---|---|---|
| Payment failed | Immediately | ”Payment failed, we’ll retry automatically” | |
| Retry 1 failed | +24h | ”Second attempt failed, updating card may help” | |
| Retry 2 failed | +72h | Email + SMS | ”Action required: update payment method” |
| All retries failed | +144h | ”Last chance: update payment within 7 days” | |
| Grace period ending | +312h | Email + SMS | ”Subscription will cancel in 24 hours” |
| Subscription cancelled | +336h | ”Subscription cancelled, reactivate anytime” |
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
| Rule | Description |
|---|---|
| Maximum hold period | Funds auto-release to provider after max_hold_days if no action taken |
| Dispute window | Customer can open a dispute within 14 days of a milestone release |
| Auto-release | Configure automatic release based on time or customer confirmation |
| Partial refund | Unreleased escrow funds can be refunded to the customer |
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
Navigate to Dashboard > Settings > Settlement and add your preferred settlement currencies.
Configure provider priority per currency
In Dashboard > Orchestration > Currency Rules, set provider rankings based on FX rates and reliability.
Set FX markup thresholds
Define maximum acceptable markup percentages. Transactions exceeding the threshold route to alternative providers.
Yuno’s smart routing engine caches FX rates from providers and updates them periodically. The routing decision uses the most recent cached rate. Actual settlement rates may vary slightly due to rate fluctuations between authorization and settlement.
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
Integrate your metering system to track usage events. Send usage records to your billing engine with timestamps, quantities, and unit types.
Configure credit tiers
Define prepaid credit tiers in your billing system. Map each tier to a Yuno payment amount for the upfront purchase (e.g., 10,000 credits = $99).
Define overage pricing
Set per-unit overage rates in your billing engine. At period end, calculate total overage charges and create a single Yuno payment for the invoice total (base + overages).
Enable automated invoicing
Schedule end-of-period invoice generation. Use Yuno’s recurring payment API with vaulted tokens to charge automatically. Attach the dunning retry rule from Template 2 for failed charges.
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
| Tier | Role | Commission Rate | Payout Schedule | Minimum Payout |
|---|---|---|---|---|
| L1 | Direct referrer | 10% of sale | Weekly | $50 |
| L2 | Referrer of L1 | 3% of sale | Bi-weekly | $100 |
| L3 | Referrer of L2 | 1% of sale | Monthly | $200 |
| Platform | Operator | Remainder after commissions | Real-time | N/A |
Code Example
Configuration Steps
Register affiliate recipients
Create affiliate accounts in Dashboard > Payouts > Recipients. Each affiliate requires KYC verification and bank account or wallet details for payouts.
Define commission tiers
Configure commission rates per tier in your affiliate management system. Pass calculated split amounts to Yuno’s
split_rules at payment time.Set payout schedules by tier
In Dashboard > Payouts > Schedules, create separate schedules per affiliate tier. L1 affiliates typically receive weekly payouts; L2 and L3 on longer cycles. Set minimum payout thresholds to reduce transaction costs.
Track referral attribution
Include
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.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
Choosing a Template
Marketplace Checkout
Multi-seller payments with commission splits and optional escrow.
Subscription with Dunning
Recurring payments with smart retry logic and customer recovery flows.
Split Payment with Escrow
Milestone-based fund release for services and project-based platforms.
Cross-Border with FX
Multi-currency acceptance with optimized foreign exchange routing.
SaaS Usage-Based Billing
Metered billing with prepaid credits, overage invoicing, and automated collection.
Affiliate/Commission Network
Multi-tier commission splits with referral tracking and scheduled batch payouts.
Templates can be combined. For example, a marketplace with international sellers can use both the Marketplace Checkout and Cross-Border FX templates together.