Creates a new payout user or adds funds to an existing payout user. The amount is automatically debited from your business payout balance and allocated to the user. This endpoint uses atomic operations to prevent race conditions and ensure data consistency.
Payouts must be enabled for your business in the dashboard settings before using this endpoint.
This endpoint requires a secure API key. The operation debits your business payout balance atomically, so ensure you have sufficient funds before calling this endpoint.
This endpoint uses MongoDB atomic operations to ensure data consistency:
Business Balance Debit: The amount is atomically debited from your business payout_balance. If insufficient funds exist, the operation fails immediately.
User Creation/Update: The payout user is created (if new) or updated (if existing) with the amount added to their balance.
Transaction History: A history record is created to track the transaction.
Check Balance First: Before creating payout users, verify your business has sufficient payout_balance to avoid failed requests.
Idempotency: This endpoint is idempotent for existing users - calling it multiple times with the same email will add the amount each time. Ensure you don’t accidentally duplicate allocations.
Error Handling: Always handle the insufficient balance error gracefully and inform users when funds are not available.
Concurrent Requests: The endpoint uses atomic operations, so concurrent requests for the same user are safe. However, ensure your business balance can cover all concurrent allocations.