Loading...
POST /event: Stores an event in the database generating an id to be used as idempotency key after performing the hmac validation. For now we will the typical sequential primary key from an SQL database. If it scales we can think of an ID generator with snowflake IDs.
GET /event/{id}: Returns the event by ID with its type (success, failure, chargebacks), webhook status (success, failure) and hmac validation.
Important: Cache is not needed at the beginning since the expectation is that the GET endpoint is not hit very often. If for whatever reason that changes, we can include a distributed cache whose eviction policy would be TTL (more likely that we want to know the status of recent events).