Skip to main content
The widget notifies your backend of two things: a buy asks for your approval before it executes, and every operation reports its result once it’s done. Both are POST requests to the webhook URL configured on your account.
This is a separate contract from the Crypto as a Service webhooks used by the core API — the widget’s events use their own envelope and their own HMAC signature, documented below.

Envelope

Every message shares the same envelope:

Verifying the signature

Every request carries an Http-X-Bff-Signature-256 header: an HMAC-SHA256 signature of the raw request body, computed with the signing key issued alongside your client_id/client_secret.
Python
Node.js
Always compare signatures with a constant-time comparison (hmac.compare_digest, crypto.timingSafeEqual) — a naive == leaks timing information an attacker can use to forge a signature byte by byte.

transaction_approval_request

Sent before a buy executes. Your endpoint must respond within a few seconds; if it doesn’t respond, or responds with anything other than {"approved": true}, the operation is denied — this request is fail-closed.
To approve, respond HTTP 200 with:
Any other response — a different status code, a body without "approved": true, or no response before the timeout — denies the operation.

transaction_result

Sent once an operation — buy or sell — finishes, so you can update your own record of the user’s balance. Delivered at least once, with retries on failure; use event_id to discard duplicates. On success:
On failure:
For a buy, persisting id is generally enough to reference the operation later if you need to reach out to Ripio about it.

Configuring your endpoint

Your webhook URL and signing key are set on your account during onboarding — reach out to your Ripio contact to configure or change them. Key considerations for your endpoint:
  • HTTPS. Your endpoint URL must use HTTPS.
  • Respond quickly. For transaction_approval_request, respond within the timeout window — the operation is fail-closed, so a slow response is the same as a denial.
  • Idempotency. Design your handler around event_id: processing the same event twice must not double-count anything on your side.