Skip to main content

invoice.failed

Fired when an invoice reaches a non-recoverable failure state. The data.failure_reason field tells you exactly what happened. Today this event fires for wrong-token deposit resolutions — when a customer paid the deposit address using a different token than the invoice expected, and a Settlx admin processes the resolution. Future failure modes will also use this event with new failure_reason values, so handle the field as an extensible enum.

Failure reasons

For wrong_token_forwarded, the funds in your wallet are in the wrong currency — not your usual settlement currency. Your accounting must handle this case explicitly.

What to do

Branch on data.failure_reason:

wrong_token_refunded

  • Mark the order as failed in your system
  • Notify the customer that their payment was returned
  • Release any reserved inventory
  • Do not fulfil the order — no funds arrived

wrong_token_forwarded

  • The funds did arrive in your merchant wallet, in whatever asset the customer actually sent
  • Decide whether you accept this as fulfilment of the order
  • Use data.withdrawalAmount and data.withdrawalCurrency to record what was received

Payload


Handler example

Node.js

Future failure reasons

failure_reason is designed as an extensible enum. New values may be added over time without introducing new event types. Always handle unknown values gracefully — log them and either treat as a generic failure or escalate to manual review.
  • invoice.settled — The happy path. If you receive invoice.failed you will not receive invoice.settled for the same invoice.
  • invoice.expired — Different failure mode (timeout, no wrong-token involved).