Payouts API
This document covers user payout requests, processing statuses, and fee/tax breakdowns.
Enums
- ProcessingStatus:
NOT_REQUESTED | REQUESTED | PROCESSING | COMPLETED | FAILED - PayoutStatus:
PENDING | PAID | FAILED
Model: Payout
Fields (selected):
seller(string): User ID requesting payout.fulfillment(ObjectId | null): Linked fulfillment for tournament product payouts (optional).tournament(ObjectId | null): Linked tournament (optional).product(ObjectId | null): Linked product (optional).currency(string): e.g.,INR.grossAmount(number): Requested amount.platformFeePercent(number): Platform fee percentage (from business config).processingFeeFlat(number): Flat processing fee (INR).platformFeeAmount(number): Computed fee from percentage.gstPercent(number): GST percent applied to platform fee.gstAmount(number): GST amount computed from platform fee.totalFees(number): Sum of applicable fees.netAmount(number):grossAmount - totalFees(not negative).status(PayoutStatus): Logical payout status.processingStatus(ProcessingStatus): Operational processing state.invoice(optional): Generated by admin on completion.
User Endpoints
- POST
/api/v1/payouts/request
- Auth: Bearer required.
- Body options:
- Direct withdrawal:
\{ amount: number \} - Tournament payout (legacy):
\{ fulfillmentId: string \}
- Direct withdrawal:
- Behavior:
- Validates amount > 0 for direct withdrawals.
- Uses BusinessConfig (
platformRate,gstRate) to compute fees; includes a flat processing fee of ₹99. - Creates a
Payoutwithstatus='PENDING'andprocessingStatus='REQUESTED'. - For fulfillment-based requests, requires receiver confirmation and links the Payout to the fulfillment.
- Response: Created payout document.
- GET
/api/v1/payouts/taxes?amount=1234
- Auth: Public.
- Query:
amount(number, required) - Response: Array of fee items with shape
\{ cut, name, amount \}where:cut:PERCENTorFLATname: label (e.g.,Platform Fee (15%))amount: computed fee in INR
Example response:
[
{ "cut": "PERCENT", "name": "Platform Fee (15%)", "amount": 150 },
{ "cut": "PERCENT", "name": "GST on Platform (18%)", "amount": 27 },
{ "cut": "FLAT", "name": "Processing Fee", "amount": 99 }
]
Admin Processing
- Admin processes payout from Order Details or Payouts list.
- When processed, the system:
- Finalizes amounts, generates invoice, and sets
status='PAID'andprocessingStatus='COMPLETED'. - Links payout to fulfillment if applicable.
- Finalizes amounts, generates invoice, and sets
Notes
- Platform fee percentage and GST come from
BusinessConfigand can be updated via Admin. fulfillment,tournament, andproductare optional to support direct withdrawals.- Admin UI shows both
statusandprocessingStatus.