Événements client
Poussez depuis votre backend des événements métier (order.placed, subscription.upgraded, invoice.paid, …) qui enrichissent la timeline d’un client. Ces événements donnent un contexte précieux aux agents quand ils traitent un ticket.
Endpoint
Section intitulée « Endpoint »POST /customer-events| Champ | Type | Requis | Description |
|---|---|---|---|
customerExternalId | string | ✅ | externalId du client |
type | string | ✅ | Nom de l’événement, format snake.dot (order.placed, trial.started) — [a-z0-9_.], 100 chars max |
payload | object | — | Données libres associées à l’événement |
occurredAt | string (ISO-8601) | — | Date/heure de l’événement — défaut: now(). Permet l’antidating pour les imports historiques |
curl -X POST https://supportdesk.innovartx.com/api/v1/customer-events \ -H "X-API-Key: $SUPPORTDESK_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "customerExternalId": "user_42", "type": "order.placed", "payload": { "orderId": "ord_9001", "total": 149.9, "currency": "XOF" } }'await fetch('https://supportdesk.innovartx.com/api/v1/customer-events', { method: 'POST', headers: { 'X-API-Key': process.env.SUPPORTDESK_API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ customerExternalId: 'user_42', type: 'order.placed', payload: { orderId: 'ord_9001', total: 149.9, currency: 'XOF' }, }),});import os, requests
requests.post( 'https://supportdesk.innovartx.com/api/v1/customer-events', headers={'X-API-Key': os.environ['SUPPORTDESK_API_KEY']}, json={ 'customerExternalId': 'user_42', 'type': 'order.placed', 'payload': {'orderId': 'ord_9001', 'total': 149.9, 'currency': 'XOF'}, },)$ch = curl_init('https://supportdesk.innovartx.com/api/v1/customer-events');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode([ 'customerExternalId' => 'user_42', 'type' => 'order.placed', 'payload' => ['orderId' => 'ord_9001', 'total' => 149.9, 'currency' => 'XOF'], ]), CURLOPT_HTTPHEADER => [ 'X-API-Key: ' . getenv('SUPPORTDESK_API_KEY'), 'Content-Type: application/json', ], CURLOPT_RETURNTRANSFER => true,]);curl_exec($ch);curl_close($ch);{ "success": true, "data": { "id": "clzzzzz", "customerId": "clxxxxxx", "type": "order.placed", "payload": { "orderId": "ord_9001", "total": 149.9, "currency": "XOF" }, "occurredAt": "2026-04-18T10:00:00Z", "createdAt": "2026-04-18T10:00:00Z" }, "timestamp": "2026-04-18T10:00:00Z"}Conventions recommandées
Section intitulée « Conventions recommandées »Utiliser un format domaine.action cohérent rend la timeline lisible :
order.placed,order.shipped,order.cancelledsubscription.started,subscription.upgraded,subscription.cancelledpayment.succeeded,payment.failedauth.signup,auth.login,auth.password_changed
| Code HTTP | Code métier | Cause |
|---|---|---|
400 | VALIDATION_ERROR | type invalide (caractères interdits, trop long) ou occurredAt non-ISO |
404 | CUSTOMER_NOT_FOUND | L’externalId ne correspond à aucun client |
Voir Erreurs.