Endpoints Disponibles
GET
/v1/productsListe tous les produitsGET
/v1/products/:idRécupère un produitPOST
/v1/productsCrée un produitPATCH
/v1/products/:idMet à jour un produitDELETE
/v1/products/:idSupprime un produitCréer un Produit
// Create Product
const response = await fetch('https://api.luneo.app/v1/products', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'T-Shirt Premium',
category: 'apparel',
price: 29.99,
customizable: true,
image_url: 'https://...',
description: 'T-shirt 100% coton'
})
});
const product = await response.json();
logger.info('Created:', product.id);Lister les Produits
// List Products
const response = await fetch('https://api.luneo.app/v1/products?limit=20&offset=0', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});
const { data, total } = await response.json();
logger.info(`Found ${total} products`);Mettre à Jour
// Update Product
await fetch('https://api.luneo.app/v1/products/prod_xxx', {
method: 'PATCH',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
price: 24.99,
stock: 150
})
});Paramètres
| Param | Type | Description |
|---|---|---|
name | string | Nom du produit |
category | string | Catégorie |
price | number | Prix en € |
customizable | boolean | Personnalisable |
image_url | string | URL image |