API Documentation
Référence complète de l'API publique West Afro Group.
Base URL : https://west-afro.com
POST
/api/auth/signupCréer un nouveau compte utilisateur
Body (JSON)
{
"email": "string",
"password": "string",
"fullName": "string"
}Réponse
{
"message": "string",
"user": "User"
}POST
/api/auth/loginConnexion à un compte existant
Body (JSON)
{
"email": "string",
"password": "string"
}Réponse
{
"message": "string",
"user": "User",
"role": "string"
}POST
/api/auth/logoutDéconnexion de l'utilisateur
Réponse
{
"message": "string"
}POST
/api/contactEnvoyer un message de contact
Body (JSON)
{
"name": "string",
"email": "string",
"phone": "string?",
"company": "string?",
"message": "string"
}Réponse
{
"message": "string"
}POST
/api/projectSoumettre 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/newsletterS'inscrire à la newsletter
Body (JSON)
{
"email": "string"
}Réponse
{
"message": "string"
}POST
/api/ordersCré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/referralObtenir les informations de parrainage de l'utilisateur connecté
Réponse
{
"referralCode": "string",
"referrals": "Referral[]",
"totalReferred": "number"
}POST
/api/referralAppliquer 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.
