Rule 1
Store, then answer
The endpoint checks the signature, writes the event, and only then answers 200. Kinde retries until it gets that 200, so no event is lost between the two systems.
INSERT INTO inbox_events (source, dedupe_key, ...) ON CONFLICT (source, dedupe_key) DO UPDATE SET seen_count = inbox_events.seen_count + 1