Docs

Cash · Reference

Cash webhook events

Configure your webhook endpoint, pass the activation test and handle status events.

Monato sends webhooks to your endpoint when a cash operation changes status. Only one webhook can be active per client.

Note:

Webhooks are sent only for closed-reference operations. Operations with open references do not currently send status updates by webhook.

Configure your endpoint

Sign the request as described in Sign requests with HMAC. The endpoint_url must use http or https.

curl -X POST "https://dev-api.finco.lat/api/v1/cash/webhooks" \
  -H "Content-Type: application/json" \
  -H "X-Client-Id: 4a8a08f09d37b73795649038408b5f33" \
  -H "X-Signature: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" \
  -H "X-Timestamp: 1705312200" \
  -d '{
    "endpoint_url": "https://your-webhook-endpoint.com/webhooks"
  }'

Store the secret_token. It is a 64-character hexadecimal token you use to verify webhook signatures.

Creating a new webhook deactivates any existing one after the new one is activated. See Create Webhook.

Activation test

After you configure the webhook, Monato sends a test request to your endpoint. The webhook is activated only if your endpoint responds with HTTP 200 to 299.

POST https://your-webhook-endpoint.com/webhooks
Content-Type: application/json
X-Webhook-Timestamp: 1705312200
X-Webhook-Signature: a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890

{
  "event": "webhook.activation",
  "processed_at": "2025-01-15T10:30:00Z"
}

Status events

Status Event Sent when
paid webhook.paid.success The cash operation was paid
expired webhook.expired.success The cash operation expired
reversed webhook.reversed.success The cash operation was reversed
webhook.paid.success
{
  "event": "webhook.paid.success",
  "operation_id": 123,
  "external_user_id": "USER123456",
  "type": "cash_in",
  "amount": 500,
  "reference": "10511175512161627448",
  "status": "paid",
  "processed_at": "2025-01-15T10:30:00Z"
}
Field Type Description
event string webhook.paid.success, webhook.expired.success or webhook.reversed.success
operation_id integer Unique identifier for the operation
external_user_id string Your identifier for the end user
type string cash_in or cash_out
amount integer Amount in MXN
reference string 20-digit operation reference
status string New status: paid, expired or reversed
processed_at string ISO 8601 timestamp when the status was updated

Headers

Every webhook request includes:

Header Description
X-Webhook-Timestamp Unix timestamp when the webhook was sent
X-Webhook-Signature HMAC-SHA256 signature, hex-encoded

Verify the signature

Always verify the signature with your webhook’s secret_token before you trust the payload.

const crypto = require('crypto');

function verifyWebhookSignature(payload, signature, secret) {
  const expectedSignature = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');

  return crypto.timingSafeEqual(
    Buffer.from(signature, 'hex'),
    Buffer.from(expectedSignature, 'hex')
  );
}

Manage your webhook

Task Endpoint
See the active webhook Get Active Webhook. Returns 404 if none is active.
Change the endpoint URL Update Webhook. The webhook is deactivated and a new activation test is sent. It becomes active again only if the new endpoint passes the test.
Update Webhook request
{
  "id": 456,
  "endpoint_url": "https://new-webhook-endpoint.com/webhooks"
}