API Reference
API Prix & Repricing
Endpoints pour la veille concurrentielle, les alertes prix, le MAP monitoring et le moteur de repricing.
Base URL
https://api.productsmanager.app/api/v1/prices
Dashboard
| Methode | Endpoint | Description |
|---|---|---|
| GET | /dashboard | KPIs (produits suivis, concurrents, competitivite) |
Exemple de reponse
{
"monitored_products": 342,
"active_competitors": 1285,
"competitivity_score": 78.5,
"alerts_triggered_24h": 12,
"average_price_gap_percent": -3.2
}
Produits suivis
| Methode | Endpoint | Description |
|---|---|---|
| GET | /monitored | Liste paginee des produits monitored |
| PATCH | /monitored/{product_id} | Modifier tier/actif |
| POST | /monitored/bulk | Activer monitoring en masse |
Activer le monitoring en masse
curl -X POST "https://api.productsmanager.app/api/v1/prices/monitored/bulk" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"product_ids": ["uuid-1", "uuid-2", "uuid-3"],
"tier": "standard",
"enabled": true
}'
Tiers disponibles : realtime (4h), standard (24h), weekly (7j).
Alertes prix
| Methode | Endpoint | Description |
|---|---|---|
| GET | /alerts | Liste alertes (filtre product_id, type, is_active) |
| POST | /alerts | Creer alerte (above/below/change_pct) |
| PATCH | /alerts/{id} | Modifier alerte |
| DELETE | /alerts/{id} | Supprimer alerte |
| GET | /alerts/{id}/history | Historique declenchements |
| GET | /alerts/triggered | Alertes recentes declenchees |
Creer une alerte
POST /api/v1/prices/alerts
{
"product_id": "uuid",
"alert_type": "above",
"threshold": 50.00,
"channels": ["in_app", "email"],
"cooldown_minutes": 60
}
Types d'alertes : above (seuil max), below (seuil min), change_pct (variation %).
Le cooldown_minutes empeche le declenchement repetitif. Une alerte declenchee ne sera pas re-declenchee avant expiration du cooldown.
MAP Monitoring
Le MAP (Minimum Advertised Price) permet de surveiller que les revendeurs respectent les prix planchers.
| Methode | Endpoint | Description |
|---|---|---|
| GET | /map/violations | Violations MAP paginees |
| GET | /map/stats | Statistiques MAP |
| GET | /map/export | Export CSV violations |
| PATCH | /map/{product_id} | Definir prix MAP |
| POST | /map/bulk | Definir MAP en masse |
Definir un prix MAP
curl -X PATCH "https://api.productsmanager.app/api/v1/prices/map/UUID_PRODUIT" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"map_price": 39.99, "enforce": true}'
Repricing
| Methode | Endpoint | Description |
|---|---|---|
| GET | /repricing/rules | Liste regles |
| POST | /repricing/rules | Creer regle |
| PATCH | /repricing/rules/{id} | Modifier regle |
| DELETE | /repricing/rules/{id} | Supprimer regle |
| POST | /repricing/rules/{id}/simulate | Simulation dry-run |
| GET | /repricing/history | Historique repricing |
| POST | /repricing/run | Execution manuelle |
Creer une regle de repricing
POST /api/v1/prices/repricing/rules
{
"name": "Aligner sur le concurrent le moins cher +2%",
"conditions": [
{"field": "competitor_price", "operator": "lt", "value": 95, "value_type": "our_price_percent"},
{"field": "stock", "operator": "gt", "value": 10},
{"field": "margin_percent", "operator": "gt", "value": 20}
],
"action_type": "match_lowest_plus",
"action_value": 2.00,
"min_price": 10.00,
"max_price": 500.00,
"min_margin_percent": 15.00,
"priority": 10
}
Simulation dry-run
Testez l'impact d'une regle avant de l'activer :
curl -X POST "https://api.productsmanager.app/api/v1/prices/repricing/rules/UUID/simulate" \
-H "Authorization: Bearer YOUR_TOKEN"
La reponse indique le nombre de produits affectes, le delta de marge moyen et les cas limites (produits au min_price ou max_price).
Les regles de repricing sont evaluees par ordre de priority (plus petit = plus prioritaire). En cas de conflit, seule la premiere regle applicable est executee.
Sources de donnees
La collecte de prix concurrents utilise deux sources configurables :
| Source | Usage | Configuration |
|---|---|---|
| SerpAPI | Google Shopping + Amazon (primaire) | Env SERPAPI_API_KEY ou DB AI Providers |
| SearXNG | Fallback auto-heberge | Instance SearXNG locale |
La collecte s'execute automatiquement via Celery Beat (tiers 4h/24h/7j).