POST an event to the webhook_url of the payment, or of its service.
Payload
data is the same object as GET /collections/{code}.
Headers
Verify the signature
The signature is an HMAC-SHA256 of"<timestamp>.<raw body>" with the webhook_secret of the service. Always verify it, on the raw body, before you trust the event.
Respond fast, process once
- Answer
2xxwithin 15 seconds, then do the slow work in the background. - Process each event once: store the event
id(also inX-KemyCard-Idempotency-Key) and ignore it if you see it again. - Any other response, or a timeout, triggers a retry: immediately, then after 1 minute, 5 minutes, 30 minutes, 2 hours, 8 hours and 24 hours. After that, the event is dropped: you can still read the payment with
GET /collections/{code}.