# Automatic top-up failed (/api/webhooks/usage-auto-top-up-failed)

Webhook event `usage:auto_top_up_failed`, sent as `POST` to your subscription's URL.

Fires once when an automatic top-up's payment failed (`outcome` `failed`) or its result is not known yet (`outcome` `unknown`). Either way automatic top-up is turned off (`auto_top_up_enabled` false) and the top-up is never retried (`automatic_retry` false); only the customer's fresh consent turns it on again. An unknown payment is never charged again: Comecero checks it hourly, for up to 30 days, and once the payment is found taken the credit is added once and `usage:auto_top_up_succeeded` follows. Until then it stays unknown (it never turns into `failed`); after 30 days it is left to staff to settle with the payment provider. The customer gets an email at the same time (notification `subscription:auto_top_up_failed`, when it is on), which for an unknown result never says the payment failed. Each event has an `occurrence_id` that stays the same if it is sent again, so drop one you have seen. The body is an event object with the top-up in `data`.

## Parameters

- `X-Comecero-Signature` (header): Proof the delivery comes from Comecero and was not changed. It is the HMAC-SHA256 of the raw request body (UTF-8), keyed with the signature key as UTF-8, written as 64 lowercase hex characters. The key is the event subscription's `signature_key`, or the account's signature key (Settings, Technical) when the subscription has none. Every account gets one when it is created, so deliveries are signed unless the key was removed. To check it, compute the HMAC over the body exactly as received, before you parse it, and compare the two strings in constant time. Reject the delivery when they differ. The signature has no timestamp, so to guard against a replayed delivery also skip any `event_id` you already handled. If you cannot check signatures, use the event only as a hint: get the object by its id from the API before you act on it.
- `User-Agent` (header): Always `Comecero-Event (+https://comecero.com)`.

Responses: 200.

Full schemas: operation `event_usage_auto_top_up_failed` in /openapi.json.