Webhook Endpoints

Crear Webhook Endpoint

Changed on

Registra un webhook endpoint para la organización autenticada.

Una URL puede tener varios endpoints mientras ninguno comparta eventos con otro. Si ya existe un endpoint en la misma URL con exactamente los mismos eventos, se actualiza en lugar de crear uno nuevo; si comparte solo algunos, responde 409. Devuelve el endpoint con su ID y su secret. El estado por defecto es enabled.

post/webhook_endpoints

Request

  • Base URL
    https://api.trytoku.com
  • URL
    https://api.trytoku.com/webhook_endpoints
  • Auth
    API key in header x-api-key

Request body

custom_headersobject
enabled_eventsstring[] required

Eventos a los que se suscribe este endpoint. El nombre es siempre recurso.evento: los que terminan en .status_update avisan cualquier cambio de estado del recurso y los específicos, como invoice.paid, una transición concreta; los que llevan bulk resumen una operación masiva en un solo envío en lugar de uno por registro. Declara solo los que tu integración procesa: suscribirse a la lista completa no es lo esperable. Los eventos deprecados no se pueden declarar; un endpoint que ya los tenía los sigue recibiendo, pero mientras los conserve no admite cambios de eventos, URL ni estado.

status'enabled' | 'disabled'

Si el Webhook Endpoint está recibiendo eventos.

Un endpoint nace enabled, y ese es el único estado en que Toku le entrega los eventos a los que está suscrito. Pasarlo a disabled lo deja registrado con su configuración intacta, pero además de cortar las entregas nuevas abandona las que estaban pendientes de reintento: no se acumulan para enviarlas al volver a habilitarlo.

urlstring uri required
webhook_versionstring date

Response

Successful Response

custom_headers_keysstring[]

Nombres de los encabezados personalizados configurados; sus valores nunca se exponen.

enabled_eventsstring[] required

Tipos de evento que este endpoint recibe. El nombre es siempre recurso.evento: los que terminan en .status_update avisan cualquier cambio de estado del recurso y los específicos, como invoice.paid, una transición concreta; los que llevan bulk resumen una operación masiva en un solo envío en lugar de uno por registro.

idstring required

Identificador del Webhook Endpoint.

secretstring required

Secreto compartido con el que se firman los envíos para verificar su origen.

status'enabled' | 'disabled'

Si el Webhook Endpoint está recibiendo eventos.

Un endpoint nace enabled, y ese es el único estado en que Toku le entrega los eventos a los que está suscrito. Pasarlo a disabled lo deja registrado con su configuración intacta, pero además de cortar las entregas nuevas abandona las que estaban pendientes de reintento: no se acumulan para enviarlas al volver a habilitarlo.

urlstring uri required

URL de destino a la que se entregan los webhooks.

webhook_versionstring date

Versión del contrato de payload que usa el endpoint.

Example response

{
  "custom_headers_keys": [
    "X-Custom-Token"
  ],
  "enabled_events": [
    "transaction.success",
    "transaction.failed"
  ],
  "id": "whe_R7kPq2mNvB4xC8dF1hJ5tW9sZ3aY",
  "secret": "whesec_L6oI8uY7tR5eW3qA1sD9fG2hJ4kZ",
  "url": "https://example.com/webhooks/toku",
  "webhook_version": "2024-04-01"
}

Changes

    • breaking

      request body became required

    • breaking

      request property / was restricted to a list of enum values

    • breaking

      request property was restricted to a list of enum values

    • breaking

      the request property's minLength was increased from 0 to 1

    • breaking

      the request property type changed from string to object, and format from json to no format

    • breaking

      the request property format changed from no format to uri

    • breaking

      removed the media type application/json for the response with the status

    • breaking

      removed the media type application/json for the response with the status

    • breaking

      the response's property type changed from string to no type for status

    • warning

      the request property's maxLength was set to 2083

    • warning

      added the new activation.created enum value to the / response property for the response status

    • warning

      added the new bank_account_verification.result enum value to the / response property for the response status

    • warning

      added the new billing_document.created enum value to the / response property for the response status

    • warning

      added the new chargeback.status_update enum value to the / response property for the response status

    • warning

      added the new checkout_session.accessed enum value to the / response property for the response status

    • warning

      added the new checkout_session.expired enum value to the / response property for the response status

    • warning

      added the new client_bank_movements.bulk_created enum value to the / response property for the response status

    • warning

      added the new customer.created enum value to the / response property for the response status

    • warning

      added the new customer.deleted enum value to the / response property for the response status

    • warning

      added the new customer.updated enum value to the / response property for the response status

    • warning

      added the new debt_reconciliation.reconciled enum value to the / response property for the response status

    • warning

      added the new document.canceled enum value to the / response property for the response status

    • warning

      added the new document.failed enum value to the / response property for the response status

    • warning

      added the new document.signed enum value to the / response property for the response status

    • warning

      added the new interaction.incoming enum value to the / response property for the response status

    • warning

      added the new invoice.created enum value to the / response property for the response status

    • warning

      added the new invoice.paid enum value to the / response property for the response status

    • warning

      added the new invoice.refund enum value to the / response property for the response status

    • warning

      added the new invoice.updated enum value to the / response property for the response status

    • warning

      added the new invoice.voided enum value to the / response property for the response status

    • warning

      added the new invoice_restructuring.completed enum value to the / response property for the response status

    • warning

      added the new operation_receipt.created enum value to the / response property for the response status

    • warning

      added the new payment_instrument.created enum value to the / response property for the response status

    • warning

      added the new payment_instrument.updated enum value to the / response property for the response status

    • warning

      added the new payment_method.attached_products enum value to the / response property for the response status

    • warning

      added the new payment_method.deleted enum value to the / response property for the response status

    • warning

      added the new payment_method.status_update enum value to the / response property for the response status

    • warning

      added the new payment_method.updated enum value to the / response property for the response status

    • warning

      added the new payment_method_inscription_intent.failed enum value to the / response property for the response status

    • warning

      added the new payout.done enum value to the / response property for the response status

    • warning

      added the new payout_br.success enum value to the / response property for the response status

    • warning

      added the new payout_cl.success enum value to the / response property for the response status

    • warning

      added the new payout_mx.success enum value to the / response property for the response status

    • warning

      added the new rendition_file.created enum value to the / response property for the response status

    • warning

      added the new rendition_file.success enum value to the / response property for the response status

    • warning

      added the new rendition_file.uploaded enum value to the / response property for the response status

    • warning

      added the new subscription.created enum value to the / response property for the response status

    • warning

      added the new subscription.deleted enum value to the / response property for the response status

    • warning

      added the new subscription.updated enum value to the / response property for the response status

    • warning

      added the new transaction.bulk_failed enum value to the / response property for the response status

    • warning

      added the new transaction.bulk_success enum value to the / response property for the response status

    • warning

      added the new transaction.capture_pending enum value to the / response property for the response status

    • warning

      added the new transaction.failed enum value to the / response property for the response status

    • warning

      added the new transaction.refund enum value to the / response property for the response status

    • warning

      added the new transaction.renewed enum value to the / response property for the response status

    • warning

      added the new transaction.status_update enum value to the / response property for the response status

    • warning

      added the new transaction.success enum value to the / response property for the response status

    • warning

      added the new transaction_external.success enum value to the / response property for the response status

    • warning

      added the new validator_execution.result enum value to the / response property for the response status

    • info

      api operation id crear-webhook-endpoint removed and replaced with create_webhook_endpoint

    • info

      api tag Webhook Endpoints added

    • info

      added the new optional request property

    • info

      added the new activation.created enum value to the request property /

    • info

      added the new bank_account_verification.result enum value to the request property /

    • info

      added the new billing_document.created enum value to the request property /

    • info

      added the new chargeback.status_update enum value to the request property /

    • info

      added the new checkout_session.accessed enum value to the request property /

    • info

      added the new checkout_session.expired enum value to the request property /

    • info

      added the new client_bank_movements.bulk_created enum value to the request property /

    • info

      added the new customer.created enum value to the request property /

    • info

      added the new customer.deleted enum value to the request property /

    • info

      added the new customer.updated enum value to the request property /

    • info

      added the new debt_reconciliation.reconciled enum value to the request property /

    • info

      added the new disabled enum value to the request property

    • info

      added the new document.canceled enum value to the request property /

    • info

      added the new document.failed enum value to the request property /

    • info

      added the new document.signed enum value to the request property /

    • info

      added the new enabled enum value to the request property

    • info

      added the new interaction.incoming enum value to the request property /

    • info

      added the new invoice.created enum value to the request property /

    • info

      added the new invoice.paid enum value to the request property /

    • info

      added the new invoice.refund enum value to the request property /

    • info

      added the new invoice.updated enum value to the request property /

    • info

      added the new invoice.voided enum value to the request property /

    • info

      added the new invoice_restructuring.completed enum value to the request property /

    • info

      added the new operation_receipt.created enum value to the request property /

    • info

      added the new payment_instrument.created enum value to the request property /

    • info

      added the new payment_instrument.updated enum value to the request property /

    • info

      added the new payment_method.attached_products enum value to the request property /

    • info

      added the new payment_method.deleted enum value to the request property /

    • info

      added the new payment_method.status_update enum value to the request property /

    • info

      added the new payment_method.updated enum value to the request property /

    • info

      added the new payment_method_inscription_intent.failed enum value to the request property /

    • info

      added the new payout.done enum value to the request property /

    • info

      added the new payout_br.success enum value to the request property /

    • info

      added the new payout_cl.success enum value to the request property /

    • info

      added the new payout_mx.success enum value to the request property /

    • info

      added the new rendition_file.created enum value to the request property /

    • info

      added the new rendition_file.success enum value to the request property /

    • info

      added the new rendition_file.uploaded enum value to the request property /

    • info

      added the new subscription.created enum value to the request property /

    • info

      added the new subscription.deleted enum value to the request property /

    • info

      added the new subscription.updated enum value to the request property /

    • info

      added the new transaction.bulk_failed enum value to the request property /

    • info

      added the new transaction.bulk_success enum value to the request property /

    • info

      added the new transaction.capture_pending enum value to the request property /

    • info

      added the new transaction.failed enum value to the request property /

    • info

      added the new transaction.refund enum value to the request property /

    • info

      added the new transaction.renewed enum value to the request property /

    • info

      added the new transaction.status_update enum value to the request property /

    • info

      added the new transaction.success enum value to the request property /

    • info

      added the new transaction_external.success enum value to the request property /

    • info

      added the new validator_execution.result enum value to the request property /

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added to the response property allOf list for the response status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status

    • info

      the response property became required for the status