- Outgoing webhooks — the plugin POSTs a notification payload to an external URL whenever a product order reaches a configured status (completed, processing, refunded, etc.).
- Inbound REST API — the plugin exposes a
GET /wp-json/utb/v1/ordersendpoint that external systems can query at any time to fetch complete order data.
Navigating to webhooks
In the WordPress admin sidebar, click UTB Builder, then click Webhooks. The page opens on the Configuración tab and shows summary statistics for the last 24 hours:| Stat | Description |
|---|---|
| Exitosos (24h) | Webhook deliveries that received a 2xx HTTP response |
| Fallidos (24h) | Deliveries that timed out or received a non-2xx response |
| Total Enviados | All-time total webhook deliveries |
| Productos Activos | Number of products with webhook delivery enabled |
Configuring outgoing webhooks per product
Each WooCommerce product has its own webhook configuration row on the Configuración tab.Enable the webhook toggle
Find the product in the list. Click the toggle switch on the left side of its row to turn webhook delivery ON. The row gains a green left border indicating it is active.
Select trigger events
Check the order status events that should trigger a delivery:
| Event | WooCommerce status |
|---|---|
| Orden Completada | completed |
| Orden Procesando | processing |
| Orden Pendiente | pending |
| Orden Reembolsada | refunded |
| Orden Cancelada | cancelled |
| Orden Fallida | failed |
Orden Completada is selected by default.Enter the destination URL
Type the full HTTPS URL of the external endpoint in the URL del Webhook field:
Enter a notification email (optional)
If you want an email alert on each delivery, enter an address in the Email de Notificación field.
Configure authentication (if required)
Under Autenticación de API, select the auth type your destination endpoint expects:
- Ninguna — no authorization header
- Bearer Token — sends
Authorization: Bearer <token>; enter the token in the field that appears - Basic Auth — sends
Authorization: Basic <base64>; enterusuario:passwordin the token field - OAuth 2.0 (Client Credentials) — enter the token endpoint URL, credentials (
client_id:secretor pre-encoded Base64), and optional scope; the plugin fetches a token before each delivery
Enable a custom JSON payload (optional)
By default, the plugin sends the full order data object. To send a smaller, custom-shaped payload, check Usar JSON Personalizado and write a template in the text area:Available template variables:
String variables must be wrapped in double quotes in your template. Numeric variables (
| Variable | Value |
|---|---|
{order_id} | WooCommerce order ID |
{order_key} | Unique order key |
{order_status} | Order status string |
{order_total} | Order total amount |
{order_currency} | Currency code (COP, USD, etc.) |
{date_iso} | Current date in ISO 8601 format |
{date_mysql} | Current date in MySQL format (Y-m-d H:i:s) |
{customer_id} | WordPress user ID |
{customer_email} | Billing email address |
{customer_name} | Full billing name |
{product_id} | WooCommerce product ID |
{product_name} | Product name |
{product_sku} | Product SKU |
{flow_id} | Assigned flow ID (utb_cep_programs, certificados_academicos, etc.) |
{order_id}, {order_total}, {customer_id}, {product_id}) do not need quotes.Webhook payload structure
When no custom JSON template is configured, the plugin sends the full order data object built byOrderDataBuilder::build_complete_order_data(). The payload is a JSON object with at minimum:
HMAC signature validation
Every webhook delivery includes anX-UTB-Webhook-Signature header containing an HMAC-SHA256 signature of the payload:
UTB_WEBHOOK_SECRET defined in wp-config.php. If that constant is not defined, the plugin falls back to the WordPress auth salt.
Set a dedicated secret in wp-config.php:
Retry logic
If a delivery fails (network error, timeout, or a 5xx HTTP response), the plugin schedules automatic retries using WordPress Cron (wp_schedule_single_event):
| Attempt | Delay after previous attempt |
|---|---|
| 1 | Immediate (on order status change) |
| 2 | 5 seconds |
| 3 | 15 seconds |
| 4 (final) | 60 seconds |
Retry scheduling depends on WordPress Cron running. If your site uses a real system cron (
DISABLE_WP_CRON = true) instead of the default WordPress pseudo-cron, ensure your cron daemon calls wp-cron.php on a regular interval (every 1–2 minutes) so retries fire on schedule.Viewing webhook logs
Click the Logs (últimos 100) tab on the Webhooks page to see recent delivery history.Log filters
Filter entries by status:- Todos — all entries
- Exitosos — successful deliveries (HTTP 2xx)
- Fallidos — failed deliveries
- Rastreo — internal debug trace entries
Log columns
| Column | Description |
|---|---|
| Orden | WooCommerce order ID, linked to its edit page |
| Estado | success, failed, or debug |
| Intento | Attempt number out of 3 |
| HTTP Code | Response code received from the destination |
| URL Destino | The endpoint the plugin sent the request to |
| Fecha | Timestamp and relative time (“2 minutes ago”) |
| Acciones | View full payload details; resend button for failed entries |
Database table
All log entries are written to thewp_utb_webhook_logs table with these columns:
REST API info panel per product
Each product row on the Configuración tab has a collapsible Consultar REST API panel. Expand it to find:- The GET endpoint URL pre-filled with this product’s ID:
- The configured API Key (masked, with a copy button)
- Available query filter parameters:
?status=completed— filter by order status?date_from=2026-01-01— orders from this date?per_page=50— results per page
Configuring the REST API key
Click the Configurar API Key tab to manage theUTB_API_KEY constant used to authenticate REST API requests.
The REST API accepts the key via either:
wp-config.php before the /* That's all, stop editing! */ line: