API Documentation

Référence complète de l'API publique West Afro Group.

Base URL : https://west-afro.com
POST/api/auth/signup

Créer un nouveau compte utilisateur

Body (JSON)

{
  "email": "string",
  "password": "string",
  "fullName": "string"
}

Réponse

{
  "message": "string",
  "user": "User"
}
POST/api/auth/login

Connexion à un compte existant

Body (JSON)

{
  "email": "string",
  "password": "string"
}

Réponse

{
  "message": "string",
  "user": "User",
  "role": "string"
}
POST/api/auth/logout

Déconnexion de l'utilisateur

Réponse

{
  "message": "string"
}
POST/api/contact

Envoyer un message de contact

Body (JSON)

{
  "name": "string",
  "email": "string",
  "phone": "string?",
  "company": "string?",
  "message": "string"
}

Réponse

{
  "message": "string"
}
POST/api/project

Soumettre un projet / demande de devis

Body (JSON)

{
  "name": "string",
  "email": "string",
  "phone": "string?",
  "company": "string?",
  "budget": "string?",
  "description": "string"
}

Réponse

{
  "message": "string"
}
POST/api/newsletter

S'inscrire à la newsletter

Body (JSON)

{
  "email": "string"
}

Réponse

{
  "message": "string"
}
POST/api/orders

Créer une commande

Body (JSON)

{
  "items": "CartItem[]",
  "totalFCFA": "number|null",
  "paymentMethod": "string",
  "customerName": "string",
  "customerEmail": "string",
  "customerPhone": "string"
}

Réponse

{
  "message": "string",
  "orderId": "string"
}
GET/api/referral

Obtenir les informations de parrainage de l'utilisateur connecté

Réponse

{
  "referralCode": "string",
  "referrals": "Referral[]",
  "totalReferred": "number"
}
POST/api/referral

Appliquer un code de parrainage

Body (JSON)

{
  "code": "string",
  "refereeId": "string"
}

Réponse

{
  "message": "string"
}

Authentification

L'authentification est gérée via des cookies Supabase. Après un appel à /api/auth/login, le cookie de session est automatiquement attaché aux requêtes suivantes. Les endpoints admin requièrent un rôle admin dans la table profiles.