List webhook endpoints
Page number for pagination.
Response
Get webhook endpoint
The webhook endpoint’s ID (e.g.,
we_xxx).Response
Create webhook endpoint
The URL where webhook events will be sent via HTTP POST. Must use HTTPS.
Event types to subscribe to. Use
["*"] for all events, or specify individual events like ["invoice.created", "invoice.paid"].Whether the endpoint is active.
Optional description for the endpoint.
signing_secret (returned as 201 Created).
Update webhook endpoint
The webhook endpoint’s ID.
The endpoint URL.
Event types to subscribe to.
Whether the endpoint is active.
Optional description.
Delete webhook endpoint
The webhook endpoint’s ID.
204 No Content.
Regenerate signing secret
The webhook endpoint’s ID.
signing_secret.
Webhook security
TRXN signs all webhook requests with HMAC-SHA256 signatures, allowing you to verify that webhooks are genuinely from TRXN.Signature header format
Every webhook request includes anX-Trxn-Signature header:
Signing secret format
Signing secrets use the formatwhsec_<64_hex_chars>:
Verifying signatures
To verify a webhook signature:- Extract the timestamp (
t) and signature (v1) from the header. - Check the timestamp is within 5 minutes of current time (prevents replay attacks).
- Compute the expected signature:
HMAC-SHA256(secret, "<timestamp>.<raw_body>"). - Compare signatures using constant-time comparison.
Use the full signing secret (including the
whsec_ prefix) as the HMAC key. This matches Stripe’s implementation.Available events
Customer events
Customer events
| Event | Description |
|---|---|
customer.created | A new customer has been created. |
customer.updated | A customer has been updated. |
customer.deleted | A customer has been deleted. |
Product events
Product events
| Event | Description |
|---|---|
product.created | A new product has been created. |
product.updated | A product has been updated. |
product.deleted | A product has been deleted. |
Price events
Price events
| Event | Description |
|---|---|
price.created | A new price has been created. |
price.updated | A price has been updated. |
price.deleted | A price has been deleted. |
Invoice events
Invoice events
| Event | Description |
|---|---|
invoice.created | A new invoice has been created. |
invoice.updated | An invoice has been updated. |
invoice.paid | An invoice has been marked as paid. |
invoice.overdue | An invoice has become overdue. |
Subscription events
Subscription events
| Event | Description |
|---|---|
subscription.created | A new subscription has been created. |
subscription.activated | A subscription has become active. |
subscription.canceled | A subscription has been canceled. |
subscription.renewed | A subscription has been renewed. |
Subscription phase events
Subscription phase events
| Event | Description |
|---|---|
subscription_phase.created | A new subscription phase has been created. |
subscription_phase.updated | A subscription phase has been updated. |
subscription_phase.deleted | A subscription phase has been deleted. |
Wallet events
Wallet events
| Event | Description |
|---|---|
wallet.created | A new wallet has been created. |
Crypto address events
Crypto address events
| Event | Description |
|---|---|
crypto_address.created | A new crypto address has been added to a wallet. |
crypto_address.deleted | A crypto address has been deleted. |
Payment claim events
Payment claim events
| Event | Description |
|---|---|
payment_claim.submitted | A customer has submitted a payment claim. |
payment_claim.approved | A payment claim has been approved. |
payment_claim.rejected | A payment claim has been rejected. |
Crypto transaction events
Crypto transaction events
| Event | Description |
|---|---|
crypto_transaction.received | A crypto transaction has been received. |
crypto_transaction.allocated | A transaction has been allocated to an invoice. |
Transaction allocation events
Transaction allocation events
| Event | Description |
|---|---|
transaction_allocation.created | A new transaction allocation has been created. |
Webhook payload format
When an event occurs, TRXN sends a POST request to your endpoint with the following format:Subscription phase payload example
Response handling
Your endpoint should respond with a 2xx status code to indicate successful receipt. If your endpoint returns a non-2xx status code, TRXN will retry the delivery with exponential backoff (up to 11 attempts).Error handling
If your endpoint cannot be reached, TRXN will:- Connection error: Disable the endpoint to prevent further delivery attempts.
- Timeout error: Retry with exponential backoff.
- TLS error: Retry with exponential backoff.
- Non-2xx response: Retry with exponential backoff.
Event retention
TRXN retains webhook events for 30 days.Best practices
- Respond quickly: Return a 2xx response before any complex logic that could cause a timeout. Process the event asynchronously after responding.
- Handle duplicates: Webhook endpoints may occasionally receive the same event more than once. Make your event processing idempotent by tracking the
idfrom the payload. If you have already processed an event for that resource, skip it and return a 2xx response. - Handle out-of-order delivery: Events may not arrive in chronological order. Use the
timestampfield to determine the sequence of events rather than assuming arrival order. - Always verify signatures: Use the
X-Trxn-Signatureheader to verify all incoming webhooks. Reject any webhook that fails signature verification. - Use HTTPS: Always use HTTPS endpoints for security.
- Store secrets securely: Store your signing secrets in environment variables or a secrets manager, never in source code.
- Monitor failures: Check webhook events in the dashboard to monitor delivery status.
- Regenerate compromised secrets: If you suspect your signing secret has been compromised, regenerate it immediately.