Skip to Content
API reference · Webhooks

Webhooks

Altruon sends signed events to your server when subscriptions, invoices, payments and sessions change. Set up an endpoint and handle deliveries.

Altruon webhooks notify your server when something happens on your account: a subscription is created, an invoice is paid, a payment fails, a session completes. Each webhook is an HTTPS POST with a JSON payload, signed with a secret that belongs to the endpoint.

These are the webhooks Altruon sends to you

The webhooks you set up on your billing platform and your acquirers are events that Altruon receives. They are a different thing. See The two webhook directions.

Webhook delivery
AcquirerAltruonYour server01 Payment result02 POST payment.succeeded, signed03 2xx within 10 seconds04 GET current state
No 2xx response within 10 seconds: Altruon retries, up to 4 attempts in total.

How it works

  1. You register an endpoint, an HTTPS URL on your server, in the backoffice and choose which events it receives.
  2. Altruon generates a signing secret for the endpoint. It is shown once.
  3. When a subscribed event occurs, Altruon sends a signed JSON event to your URL.
  4. Your server verifies the signature, responds with a 2xx status and processes the event asynchronously.
  5. Failed deliveries are retried with increasing delays. Every attempt is listed in the delivery log in the backoffice.

Payloads are thin on purpose: they say what happened and to which resource. Fetch the current state from the API, for example with Get transaction details, instead of relying on payload contents that may be stale by the time you process the event.

Create an endpoint

You can have up to 2 active endpoints per site. Use the second one for a staging consumer or during a migration.

Open the webhook settings

In the backoffice, go to Settings > Webhooks and click Add endpoint.

The Webhooks list with delivery analytics and the Add endpoint button
Settings > Webhooks

Enter the endpoint details

FieldRequiredDescription
Endpoint URLYesYour HTTPS URL, for example https://api.example.com/webhooks/altruon. Plain http://, credentials in the URL, and private or loopback addresses are rejected.
DescriptionNoA label for your team, for example Production billing sync.

Click Send test event to check the URL before you save. Altruon sends an unsigned webhook.ping and expects a 2xx response. It is unsigned because the endpoint has no secret yet.

The create endpoint dialog with the URL, the description and the Send test event button

Select events

Pick at least one event. Events are grouped by resource (subscription, invoice, payment and so on) and you can search them. See Event types for the full list.

The event selection step with events grouped by resource

Copy the signing secret

After you confirm, Altruon shows the signing secret of the endpoint. It starts with whsec_. Store it in your secret manager.

The secret is shown once

Copy it now. Afterwards the backoffice only shows its last 4 characters.

The signing secret shown once after the endpoint is created

Event payload

Every event is delivered in the same JSON envelope.

idstring

Unique event ID with the evt_ prefix. Retries of the same event reuse the same ID, so use it to deduplicate.

typestring

One of the event types, for example payment.succeeded.

created_atstring

ISO 8601 timestamp of when the event occurred.

domainstring

Your tenant domain. "test" for test events sent from the backoffice.

livemodeboolean

true for production events, false for sandbox and test events.

dataobject

What the event is about.

objectobject

The affected resource.

resourceTypestring

One of SUBSCRIPTION, PAYMENT, CUSTOMER, INVOICE, REFUND, ORDER.

sourcestring

Where the event came from. gateway in the example below.

providerRefobject

Reference to the resource at the provider.

providerstring

Name of the provider, for example PAGBRASIL.

resourceIdstring

ID of the resource at the provider.

connectionIdstring

UUID of the Altruon connection to that provider.

fetchHintstring

A plain-text hint on how to fetch the resource.

previous_attributesobject | null

On update events, the fields that changed, with their previous values. null otherwise.

truncatedboolean

true if the payload exceeded the 256 KB limit and was truncated.

{
  "id": "evt_7f3c2a1b-8d4e-4f6a-9b2c-1e5d7a8f9c0b",
  "type": "payment.succeeded",
  "created_at": "2026-07-14T13:07:00.000Z",
  "domain": "your-tenant.altruon.io",
  "livemode": false,
  "data": {
    "object": {
      "resourceType": "PAYMENT",
      "source": "gateway",
      "providerRef": {
        "provider": "PAGBRASIL",
        "resourceId": "ORD123456",
        "connectionId": "550e8400-e29b-41d4-a716-446655440000"
      },
      "fetchHint": "Use providerRef.resourceId to query platform or Altruon"
    },
    "previous_attributes": null,
    "truncated": false
  }
}

Delivery and retries

MethodPOST with Content-Type: application/json
User agentAltruon-Webhook/1.0
SignatureAltruon-Signature header. See Verify signatures.
Timeout10 seconds. Respond within this window.
SuccessAny 2xx response status
RetriesFailed deliveries are retried with increasing delays, roughly 2 hours, 12 hours, then 24 hours after each failure. At most 4 attempts in total.
OrderingDeliveries to an endpoint are sent in order, but retries mean events can arrive out of order.
IdempotencyRetries reuse the same event id.

What is retried: timeouts, connection errors, HTTP 5xx, 429, and a few transient 4xx statuses such as 408 and 409. Most other 4xx responses, such as 400 and 401, count as permanent failures and are not retried.

Automatic disabling: Altruon disables an endpoint after 50 consecutive failures, or when its failure rate stays at 95% or more over 3 days. A disabled endpoint receives no deliveries until you enable it again in the backoffice.

Manage and monitor endpoints

The list under Settings > Webhooks shows for each endpoint its status (Active or Inactive), the number of subscribed events, the last delivery and the success rate, with aggregate analytics cards on top. You can enable or disable an endpoint from the list at any time.

Click an endpoint to open its detail page:

  • Deliveries: every attempt with its event type, status, response code, duration and the full payload sent. You can resend a failed delivery manually.
  • Events: the events the endpoint is subscribed to. You can edit them at any time.
  • Settings: the URL, the description, the status and a preview of the signing secret (its last 4 characters).

Send Test on the detail page sends a signed webhook.ping. Use it to check your signature verification end to end.

Best practices

  • Verify every request. Check the Altruon-Signature header and reject anything invalid with a 400.
  • Respond with a 2xx within 10 seconds. Return 200 straight away and process the event on a queue or a worker. A slow handler hits the timeout and triggers a retry.
  • Deduplicate on the event id. You will occasionally receive the same event more than once.
  • Treat events as triggers and fetch the state. Read the current resource from the Altruon API instead of trusting the payload as a snapshot.
  • Do not rely on ordering. A retried payment.succeeded can arrive after a later invoice.paid. Compare created_at.
  • Check livemode. It keeps sandbox and production events from crossing environments.

Next steps