Événements webhook

Liste complète des événements disponibles et leurs payloads.

Événements disponibles

Événement Description
booking.created Nouvelle réservation créée
booking.updated Réservation modifiée
booking.cancelled Réservation annulée
booking.completed Réservation terminée (service effectué)
booking.no_show Client absent
payment.completed Paiement effectué
payment.failed Paiement échoué
payment.refunded Paiement remboursé
customer.created Nouveau client inscrit
customer.updated Client mis à jour
order.created Nouvelle commande créée
order.shipped Commande expédiée
order.delivered Commande livrée

booking.created

Se déclenche lors de la création d'une nouvelle réservation.

JSON Payload
{
    "id": "evt_abc123",
    "type": "booking.created",
    "created": "2024-01-20T10:30:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "booking": {
            "id": 12345,
            "codigo": "ABC123XY",
            "fecha": "2024-01-25",
            "hora_inicio": "10:30",
            "hora_fin": "11:00",
            "servicios": [
                {
                    "id": 15,
                    "nombre": "Corte Clásico",
                    "precio": 25.00,
                    "duracion_minutos": 30
                }
            ],
            "profesional": {
                "id": 5,
                "nombre": "Carlos García"
            },
            "cliente": {
                "id": 456,
                "nombre": "Juan Pérez",
                "email": "juan@email.com",
                "telefono": "+34612345678"
            },
            "total": 25.00,
            "estado": "confirmada",
            "notas": "Primera visita",
            "created_at": "2024-01-20T10:30:00Z"
        }
    }
}

booking.updated

Se déclenche lors de la modification d'une réservation (changement de date, heure, professionnel, etc).

JSON Payload
{
    "id": "evt_def456",
    "type": "booking.updated",
    "created": "2024-01-20T11:00:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "booking": {
            "id": 12345,
            "codigo": "ABC123XY",
            "fecha": "2024-01-26",
            "hora_inicio": "11:00",
            "hora_fin": "11:30"
            // ... données complètes de la réservation
        },
        "changes": {
            "fecha": {
                "old": "2024-01-25",
                "new": "2024-01-26"
            },
            "hora_inicio": {
                "old": "10:30",
                "new": "11:00"
            }
        }
    }
}

booking.cancelled

Se déclenche lors de l'annulation d'une réservation.

JSON Payload
{
    "id": "evt_ghi789",
    "type": "booking.cancelled",
    "created": "2024-01-20T12:00:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "booking": {
            "id": 12345,
            "codigo": "ABC123XY",
            "estado": "cancelada"
            // ... données complètes
        },
        "cancellation": {
            "cancelled_by": "cliente",
            "reason": "Cambio de planes",
            "cancelled_at": "2024-01-20T12:00:00Z"
        },
        "refund": {
            "applicable": true,
            "amount": 25.00,
            "status": "pending"
        }
    }
}

booking.completed

Se déclenche lorsque le service a été effectué et la réservation est marquée comme terminée.

JSON Payload
{
    "id": "evt_jkl012",
    "type": "booking.completed",
    "created": "2024-01-25T11:05:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "booking": {
            "id": 12345,
            "estado": "completada",
            "completed_at": "2024-01-25T11:05:00Z"
            // ... données complètes
        },
        "points_earned": 25
    }
}

booking.no_show

Se déclenche lorsque le client ne se présente pas au rendez-vous.

JSON Payload
{
    "id": "evt_mno345",
    "type": "booking.no_show",
    "created": "2024-01-25T11:30:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "booking": {
            "id": 12345,
            "estado": "no_show",
            "marked_at": "2024-01-25T11:30:00Z"
        }
    }
}

payment.completed

Se déclenche lorsqu'un paiement est effectué avec succès.

JSON Payload
{
    "id": "evt_pqr678",
    "type": "payment.completed",
    "created": "2024-01-20T10:35:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "payment": {
            "id": 789,
            "amount": 25.00,
            "currency": "EUR",
            "method": "card",
            "stripe_payment_intent_id": "pi_abc123",
            "status": "succeeded"
        },
        "booking": {
            "id": 12345,
            "codigo": "ABC123XY"
        },
        "cliente": {
            "id": 456,
            "nombre": "Juan Pérez",
            "email": "juan@email.com"
        }
    }
}

payment.failed

Se déclenche lorsqu'une tentative de paiement échoue.

JSON Payload
{
    "id": "evt_stu901",
    "type": "payment.failed",
    "created": "2024-01-20T10:35:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "payment": {
            "id": 790,
            "amount": 25.00,
            "currency": "EUR",
            "status": "failed",
            "error_code": "card_declined",
            "error_message": "Tu tarjeta fue rechazada"
        },
        "booking": {
            "id": 12346
        }
    }
}

payment.refunded

Se déclenche lors d'un remboursement.

JSON Payload
{
    "id": "evt_vwx234",
    "type": "payment.refunded",
    "created": "2024-01-21T09:00:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "refund": {
            "id": 100,
            "amount": 25.00,
            "currency": "EUR",
            "reason": "Cancelación por cliente",
            "stripe_refund_id": "re_abc123"
        },
        "original_payment": {
            "id": 789,
            "amount": 25.00
        },
        "booking": {
            "id": 12345
        }
    }
}

customer.created

Se déclenche lors de l'inscription d'un nouveau client.

JSON Payload
{
    "id": "evt_yza567",
    "type": "customer.created",
    "created": "2024-01-20T10:25:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "customer": {
            "id": 456,
            "nombre": "Juan Pérez",
            "email": "juan@email.com",
            "telefono": "+34612345678",
            "source": "widget",
            "created_at": "2024-01-20T10:25:00Z"
        }
    }
}

customer.updated

Se déclenche lorsqu'un client met à jour son profil.

JSON Payload
{
    "id": "evt_bcd890",
    "type": "customer.updated",
    "created": "2024-01-22T15:00:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "customer": {
            "id": 456,
            "nombre": "Juan Pérez García",
            "email": "juan@email.com",
            "telefono": "+34612345678"
        },
        "changes": {
            "nombre": {
                "old": "Juan Pérez",
                "new": "Juan Pérez García"
            }
        }
    }
}

order.created

Se déclenche lors de la création d'une nouvelle commande de produits.

JSON Payload
{
    "id": "evt_ord123",
    "type": "order.created",
    "created": "2024-01-20T14:30:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "order": {
            "id": 789,
            "numero": "PED-2024-0789",
            "cliente": {
                "id": 456,
                "nombre": "Juan Pérez",
                "email": "juan@email.com"
            },
            "items": [
                {
                    "producto_id": 12,
                    "nombre": "Shampoo Profesional",
                    "cantidad": 2,
                    "precio_unitario": 15.00,
                    "subtotal": 30.00
                }
            ],
            "subtotal": 30.00,
            "envio": 5.00,
            "total": 35.00,
            "estado": "pending",
            "created_at": "2024-01-20T14:30:00Z"
        }
    }
}

order.shipped

Se déclenche lors de l'expédition d'une commande.

JSON Payload
{
    "id": "evt_ord456",
    "type": "order.shipped",
    "created": "2024-01-21T10:00:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "order": {
            "id": 789,
            "numero": "PED-2024-0789",
            "estado": "shipped",
            "tracking_number": "1Z999AA10123456784",
            "tracking_url": "https://tracking.example.com/1Z999AA10123456784",
            "shipped_at": "2024-01-21T10:00:00Z"
        }
    }
}

order.delivered

Se déclenche lors de la livraison d'une commande.

JSON Payload
{
    "id": "evt_ord789",
    "type": "order.delivered",
    "created": "2024-01-23T16:45:00Z",
    "tenant_id": "uuid-tenant",
    "data": {
        "order": {
            "id": 789,
            "numero": "PED-2024-0789",
            "estado": "delivered",
            "delivered_at": "2024-01-23T16:45:00Z"
        }
    }
}