Events
tiun sends a webhook event to your endpoints whenever one of the events below happens. Events are deliberately small: they tell you what happened and to whom, using IDs only. To get the current details — email, product access — your backend calls the tiun API with those IDs.
For setup and a full handler example, see receiving webhooks. For retries and timeouts, see Webhook delivery.
Event types
user.create
A user signs up with you.
user.revoke_consent
A user withdraws their consent to your terms.
product_access.add
A user gains access to a product.
product_access.remove
A user loses access to a product.
You choose which of these each endpoint receives when you add or edit it in the dashboard.
The event envelope
Every event has the same shape. Only payload changes between event types.
{
"id": "b0c22a9741be458fa36e742d3d3bb0e8",
"type": "product_access.add",
"version": 1,
"occurred_at": "2026-10-30T14:45:50.6090416+00:00",
"payload": {
"user_id": "user-sample-0001",
"product_id": "product-sample-0001",
"reference": null
}
}id
string
Unique ID of the event. It stays the same across retries and resends, so use it to skip events you've already handled.
type
string
The event type, for example product_access.add.
version
number
Version of the event's format. Currently always 1.
occurred_at
string
When the event happened, as an ISO 8601 timestamp in UTC.
payload
object
The IDs involved. Depends on type — see below.
IDs in the payload belong to the environment the endpoint is set up in: a sandbox endpoint only receives sandbox users and products, and a live endpoint only live ones.
User events
user.create
Sent when a user signs up with you, usually at sign-in or checkout.
payload.user_id
string
The tiun user ID of the user who signed up.
Use it to create the matching record in your own database, or to send a welcome email. Fetch the user's email and access with the UserInfo API.
user.revoke_consent
Sent when a user withdraws their consent to your terms.
payload.user_id
string
The tiun user ID of the user who withdrew consent.
When you receive it, remove or anonymize the data you hold about that user in your own systems, in line with your privacy obligations.
Product access events
These events follow the same productAccess array the SDK and the UserInfo API expose. See Product access for when access changes.
product_access.add
Sent when a user gains access to a product — for example after a completed one-time purchase, each purchase of a repeatable product, or when a subscription starts. Subscription renewals don't send it again: the user already has access.
This example is a repeatable product, so reference carries the referenceId your app passed to checkout. For regular products it's null.
product_access.remove
Sent when a user loses access to a product — for example when a subscription ends after a cancellation or a permanent payment failure, or when a one-time product with limited access reaches its end date.
Both events share the same payload:
payload.user_id
string
The tiun user ID whose access changed.
payload.product_id
string
The product the access is for.
payload.reference
string | null
For repeatable products, the referenceId the purchase was made with. null for every other product.
When either event arrives, confirm the change with the API before you update your own records — don't add or remove access based on the event alone:
referenceisnull— re-read the user'sproductAccesswith the UserInfo API.referenceis set — check that one purchase withGET /live_api/s2s/v1/users/{userId}/product_access/{productId}?referenceId={reference}. See verifying repeatable purchases server-side.
Where to go next
Webhook delivery — retries, timeouts, and delivery statuses.
Receiving webhooks — set up an endpoint and handle events end to end.
User object — the fields behind
user_idandproductAccess.
Last updated
Was this helpful?

