A working Python receiver for the shape most integrations need: an inbound event must create-or-update a record in a second system, once, no matter how many times the sender retries it or when the process dies.
The HMAC runs over the raw request body. Decode the JSON first and you are verifying a re-serialised object, not the bytes the sender signed — a check that passes on payloads nobody ever signed. Stale timestamps are rejected for the same reason: a captured request replayed tomorrow should not authenticate.
expected = hmac.new(SECRET, f"{timestamp}.".encode() + raw, sha256).hexdigest()
return hmac.compare_digest(expected, signature) # constant time
Not your own request id. Not a hash of the body. Senders retry the same event id, so the claim row collapses those retries into one downstream effect. A body hash breaks the moment the sender re-serialises with different key order.
The claim row is written before the outbound call, not after. Crash between claim and commit: the retry re-reads the claim and reconciles. Crash after the call but before commit: same path, and no double-create. This is the only ordering that survives a process kill mid-request — write-after-call loses the record entirely.
A target rejecting a payload rejects it identically on attempt two. Returning 200 after recording the failure stops the retry storm and lets an alert fire once. Returning 503 on a genuine transient failure lets the sender retry safely — because of point 3.
The claim/finish skeleton stays for every later event. Only the field map and the target call
change. Adding order.refunded is a new map plus a new call, not a new service —
which is why the mapping lives in one isolated function on purpose.
$200 fixed for the first milestone, 5 days from having the payload example and API docs. Python or Node — I match your existing stack rather than adding a second runtime.
Order on Freelancer →