Order sync strategies
Reliable order sync is the foundation of accurate attribution and payout confidence.
Recommended Hybrid Model
Use both:
- Real-time webhook processing for low-latency updates.
- Scheduled reconciliation for recovery and completeness.
Real-Time Webhooks
Listen to order creation, payment, update, and refund events.
Benefits:
- Near real-time attribution.
- Fast affiliate visibility.
Requirements:
- Public endpoint availability.
- Signature verification.
- Retry-safe idempotent handlers.
Scheduled Reconciliation
Run daily or hourly jobs that compare source orders to attribution records.
Use reconciliation to:
- Recover from missed webhooks.
- Apply late refunds or order edits.
- Detect mismatches before payouts finalize.
State and Timing Strategy
- Create conversion in pending state when order qualifies.
- Move to approved after return/dispute window.
- Move to paid after payout execution.
Handling Refunds and Chargebacks
- Issue negative adjustments linked to original order IDs.
- Keep reason codes and timestamps for auditability.
- Notify affiliates when adjustments affect balance.
Data Integrity Checklist
- Dedupe by external order identifier.
- Store store_id, affiliate_id, and order_id together.
- Keep immutable event history for replay and audit.
Operational Recommendation
Finalize commissions only after a buffer window that reflects your refund policy.