2xx, and does its work.
Use this page when you connect your back office, billing or onboarding system to trdrs. By the end
you have an endpoint registered, a handler that verifies every delivery, and a way to recover any
delivery your handler missed.
Before you start
- A Venue key with
venue:configureto register, test and remove endpoints, andvenue:readto list them and read deliveries. - An HTTPS endpoint reachable on the public internet. trdrs doesn’t deliver to private or reserved addresses and doesn’t follow redirects, so use its real public URL.
1
Register your endpoint
Send an The response is
https URL of at most 500 characters, and name the events you want in events. Leave
events out, or send an empty list, to receive every event type.Required scope: venue:configure.201 with the endpoint, its id and its signing secret. The secret is shown
again every time you list your endpoints, because all it does is prove a delivery came from
trdrs.The Idempotency-Key is required, but it doesn’t deduplicate this write: a retry registers a
second endpoint, so list your webhooks before you retry. Your venue holds at most five endpoints,
so a billing system and an operations dashboard can each subscribe to different events. The
endpoints belong to your venue, so every key and the back office see the same five.2
Send a test ping
Send a signed
ping to your endpoint right now. It uses the real signature, headers and network
path, so it’s the call to run while you build your handler.Required scope: venue:configure.WEBHOOK is the endpoint’s id. The response says what your endpoint answered. If it refused
the ping, the call still answers 200, with ok: false, the status your endpoint returned and
the reason: the call did its job, and your endpoint’s failure is reported rather than raised. A
test ping isn’t retried and doesn’t appear in the delivery log.3
Verify every delivery
Each delivery carries a The function returns
trdrs-signature header of the form
t=<epoch seconds>,v1=<64 hex characters>. v1 is an HMAC-SHA256 of the string
<t>.<raw request body>, keyed with your endpoint’s signing secret. Check it before you parse
the body:true only for a genuine, recent delivery. Two rules make it work. The
timestamp is part of what’s signed, so reject anything more than five minutes old and a captured
message can’t be replayed later. And verify the bytes you received: parsing the JSON and
serializing it again changes the whitespace, and the signature won’t match.4
Answer quickly, and expect repeats
Answer
2xx to accept a delivery. trdrs waits five seconds for your answer, so acknowledge first
and do the work afterwards; a handler that works before answering times out and is retried even
though it succeeded.Anything other than 2xx, including a timeout, is retried on
the retry schedule, for about nine hours. That carries your
endpoint through a deploy or a short outage, and it means the same event can arrive twice. Key
your handler on the event’s own key: referenceId for balance and reset events,
registrationId for registration events, eventId for risk events, and targetId or
intentId for hedge events.5
Read the log when something goes quiet
The delivery log for one endpoint lists, newest first, what trdrs sent, what your endpoint
answered, and what’s still waiting.Required scope:
venue:read.limit is 1 to 200 and defaults to 50. A value outside that range is refused with 400, never
quietly adjusted. Each row carries the exact message sent, so you can replay one your handler
dropped.Read the event catalog
Every delivery uses the same envelope: a
type, a createdAt, and a data object with the
event’s own fields.
eventIdnames the lock change. Every delivery of it, to each endpoint and on every retry, carries the same value.revisioncounts the account’s lock changes. Apply a risk event only when its revision is higher than the last one you applied for that account, and read what the account may do when you need the current answer.reasonnames what locked the account, and isnullonrisk.unlocked.
risk.locked for that lock.
Read a delivery row
Finished rows are kept for 60 days. A row still being retried is never removed.
Remove an endpoint
Removing an endpoint stops deliveries to it at once and deletes its delivery log, so read anything you still need first. Removing one endpoint never affects another. The call takes no body and noIdempotency-Key.
Required scope: venue:configure.
{ "id": "...", "deleted": true }.
Follow the retry schedule
That’s six attempts over about nine hours, with five seconds allowed for each.
Handle errors
Test it end to end
- Register an endpoint for every event and send it a test ping. Your handler verifies the
signature and answers
2xx. - In the sandbox, credit a test account with a new
Idempotency-Key. Your endpoint receivesbalance.recordedwith that key asreferenceId. - Halt the account, then resume it. Your endpoint receives
risk.lockedand thenrisk.unlockedwith a higherrevision. - Stop your endpoint, credit the account again, and read the delivery log: the delivery is
pending. Start your endpoint and it arrives on the next retry.
Next steps
Follow registrations
Mark onboarding complete the moment a trader links an account.
Venue accounts
See the resets, balance operations and halts that send these events.