alerts.<alert_type>
Alerts are the most common source for webhook notifications. See our alerts documentation for more on how to set these up.
invoice.billing_provider_error
Billing provider error webhooks only apply to Stripe and are triggered any time there is an error in sending an invoice to Stripe (for example, the customer does not exist within Stripe or the customer does not have a valid payment method). No additional configuration is needed for this webhook; notifications are automatically sent when a webhook destination is set up and the Stripe integration is enabled on the account. Note that no Metronome webhook is triggered for errors residing entirely within Stripe (such as payment failures).
invoice.finalized
(beta)
Triggered whenever an invoice is finalized (happens after the 24 hour grace period).
invoice.finalized
notifications.marketplaces.aws_metering_disabled
Triggered when an AWS marketplace customer is disabled.
marketplaces.azure_metering_disabled
Triggered when an Azure marketplace customer is disabled.
threshold_amount
for Threshold Billing.
Payment gate status
After a payment is attempted for a payment gate workflow, this webhook returns the status. It includes relevant metadata from the gateway, such as error codes, if applicable.
Payment gate action required
This webhook is fired if an additional action is required to complete payment. It includes relevant metadata to identify the associated payment in the gateway, if applicable.
External workflow initiated
If processing payment via an external gateway outside of a native Metronome integration, this webhook will provide you the information to process that transaction. The workflow_id
provided is used to release or cancel the balance, pending payment outcome.
Payment gate status
Payment gate action required
Threshold reached
External workflow initiated
200 OK
. If Metronome receives a status code >299
, notification retries are attempted until a successful status code is returned.
If your webhook endpoint does not properly acknowledge the notification, Metronome continuously retries it with exponential backoff until it hits a 15-minute retry cadence. Once the retry process hits 15 minutes, Metronome repeats the notification until it is either accepted or two days have passed since the initial notification attempt (~200 retries).
It is recommended that you process webhooks asynchronously: store the webhook payload in a queue, return a 200
response code, and only then validate or process the payload. Removing webhook processing from the receiving path reduces the likelihood of your systems getting blocked.
id
field to deduplicate./customers/{customer_id}/invoices/{invoice_id}
endpoint to fetch the details of the invoice mentioned in the notification. In this way, the notification serves as a hint that something has changed, but your code relies only on data obtained directly from the Metronome API.
Metronome-Webhook-Signature
HTTP header. The value of this header is a cryptographic signature of the HTTP request, using a secret key set up when you configure your webhook.
Date
header and the exact bytes of the request body, separated by a newline character (\n
). Then compute the HMAC-SHA256 of the resulting string, keyed by the webhook’s secret key. Finally, compare the hexadecimal representation of the HMAC you computed with the one found in the Metronome-Webhook-Signature
header. If they don’t match, the webhook notification did not come from Metronome.
Date
header is included to aid in deduplication. You should ignore webhook requests that are older than five minutes, which means your webhook handler only needs to store recent notification IDs to prevent duplicates.
correct-horse-battery-staple
:
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX