Create a new earning when a referred customer spends money on your platform
ref_123abcNote: The referral must exist in your system and typically should have a status of converted.550.Example: 1000 (represents $10.00)Important: Always specify amounts in the smallest currency unit (cents for USD).USD, EUR, GBP, CADNote: Ensure the currency matches your program’s payout currency.purchase - One-time purchase commissionsubscription - Subscription-based commissionrecurring - Recurring payment commissionbonus - Bonus or special promotionpurchaseCommission from customer purchase - Order #12345idempotency_key within a short time window, the API will return the same earning instead of creating a duplicate. This is essential for retry logic and webhook processing.Example: earn_20240115_order12345Best Practice: Use a combination of order/transaction ID and timestamp to ensure uniqueness.pending.converted before creating earningspending → Ready for processingprocessing → Payout initiatedpaid → Commission paid to ambassadorBearer authentication header of the form Bearer <token>, where <token> is your auth token.
The referral ID that this earning is associated with
Amount in cents (e.g., 1000 = $10.00)
Currency code (ISO 4217)
Type of earning (e.g., "purchase", "subscription", "recurring")
Description of the earning
Additional metadata about the earning
A unique key for idempotent requests
Earning created successfully