## Statistiques de parrainage ```http GET /v1/referral/stats Authorization: Bearer kh_live_xxxx ``` ### Réponse ```json { "success": true, "data": { "balance": 0, "referral_code": "ABC123", "referral_link": "https://kennhosting.com/register?ref=ABC123", "total_referrals": 0, "active_referrals": 0, "total_earned": 0, "total_withdrawn": 0 } } ``` ## Historique des commissions ```http GET /v1/referral/earnings ``` ### Paramètres | Paramètre | Type | Description | |-----------|------|-------------| | `page` | integer | Pagination Laravel | ### Réponse ```json { "success": true, "data": [ { "id": 3, "amount": 500, "referral_name": "Marie D.", "earned_at": "2026-04-01T10:00:00+00:00" } ], "meta": { "total": 1, "per_page": 20, "current_page": 1 } } ``` ## Demander un retrait ```http POST /v1/referral/withdrawals Content-Type: application/json ``` ```json { "amount": 20000, "payment_method": "mtn_mobile_money", "payment_details": "677123456", "payment_name": "Jean Dupont" } ``` | Champ | Type | Requis | Description | |-------|------|--------|-------------| | `amount` | number | Oui | Montant à retirer (min: 5 000) | | `payment_method` | string | Oui | `mtn_mobile_money`, `orange_money`, `bank_transfer` | | `payment_details` | string | Oui | Détails de paiement (numéro, RIB, etc.) | | `payment_name` | string | Non | Nom du bénéficiaire | ### Réponse ```json { "success": true, "data": { "withdrawal_id": 12, "amount": 20000, "status": "pending" } } ``` ## Historique des retraits ```http GET /v1/referral/withdrawals ``` ```json { "success": true, "data": [ { "id": 12, "amount": 20000, "status": "approved", "payment_method": "mtn_mobile_money", "requested_at": "2026-04-12T08:00:00+00:00", "processed_at": null } ], "meta": { "total": 1, "per_page": 20, "current_page": 1 } } ``` ### Statuts de retrait | Statut | Description | |--------|-------------| | `pending` | En attente de traitement par KennHosting | | `approved` | Approuvé et paiement effectué | | `rejected` | Refusé — voir `admin_note` pour la raison | ## Permissions requises `referral:read`, `referral:withdraw`