Webhooks

How Webhooks Work

How Tonder delivers webhooks, what the payload contains, and why you confirm server-side.

Webhooks are automated messages Tonder sends when transaction events occur. Instead of repeatedly polling the API for status changes, webhooks notify you in real time the moment something happens — a payment completing, failing, or requiring additional authentication.

Key events

Event typeDescriptionExample flow
Payment status changesReal-time updates as the payment progressespendingauthorizedsuccess
Payment failuresWhen a payment is declined or failspendingdeclined or failed
3DS authenticationWhen the user completes the 3D Secure challengepending_3dssuccess or failed
Cash payment confirmationsWhen the customer pays an OXXO voucherpendingsuccess (when paid at store)
Withdrawal updatesStatus changes for payout transactionsprocessingsuccess or failed

Payload structure (API Direct)

API Direct webhooks use a flat payload — all fields are at the top level, with no data wrapper. Key fields:

FieldTypeDescription
idstringUnique webhook event identifier.
operation_typestringOperation type (e.g. payment).
amountstringTransaction amount (as a string).
currencystringISO 4217 code (e.g. MXN).
client_referencestringYour transaction reference.
statusstringCurrent status (Success, Pending, Failed).
providerstringProcessor that handled the transaction.
transaction_idstringTonder's internal identifier.
payment_method_typestringMethod used (SPEI, CARD, OXXO).
createdstringISO 8601 timestamp.
metadataobjectKey-value pairs sent when creating the payment.
event_typestringEvent that triggered the notification (payment_Success, payment_Pending).
actionstringAction associated with the event (e.g. MODIFY).
{
  "id": "fc38522e-3e5d-45b8-ba6a-ece72caee71f",
  "operation_type": "payment",
  "amount": "70",
  "currency": "MXN",
  "client_reference": "ORD-001",
  "status": "Success",
  "provider": "tonder",
  "transaction_id": "e9340a04-6d68-4afc-86c5-79f8b7c87de4",
  "payment_method_type": "SPEI",
  "created": "2026-05-21T19:15:32.029134Z",
  "metadata": {
    "order_id": "ORD-001",
    "external_id": "ORD-001",
    "transaction_type": "deposit"
  },
  "event_type": "payment_Success",
  "action": "MODIFY"
}

Two webhook formats exist — Short (API Direct, Lite SDK 2.0) and Long (Hosted Checkout, mobile SDKs) — depending on your integration mode. See the Webhooks model.

Getting started with webhooks

  1. Create a public HTTPS URL that receives POST requests.
  2. Secure your endpoint to verify requests come from Tonder.
  3. Register your endpoint — see Set up webhooks.
  4. Process the notifications in your application.

Endpoint requirements: use HTTPS (not HTTP), respond within 30 seconds, return a 2xx code to acknowledge receipt, and authenticate requests to verify they come from Tonder (see Set up webhooks for the BEARER, API_TOKEN, and BASIC_AUTH methods).

Common use cases

Reliability and delivery

MechanismDetail
Automatic retriesUp to 3 delivery attempts, with 60-second intervals.
Response timeout30 seconds per attempt.
Dead Letter QueueFailed events stored for 30 days for manual reprocessing.
Success criteriaAny 2xx HTTP code within the timeout.

Full details in Delivery and retry.

Next steps

Was this page helpful?

On this page