Webhooks

Payment cancelled

The payment was cancelled or definitively failed before completing.

The HTTP body is this object exactly — there is no envelope and no type field. The event name is delivered in the X-Webhook-Event header. Most optional fields arrive as an explicit null; a few keys are dropped from the JSON entirely when unset, and those are marked as such below. Read values with a null-safe accessor rather than testing key presence.

postWebhookPAYMENT_CANCELLED

Payload

idstring uuid

Payment id. Present only on some cancellation paths.

txIdstring

Payment transaction id.

status'CANCELLED'

Always CANCELLED.

amountnumber

Gross amount in BRL. Present only on some cancellation paths.

reason'payment_failed' | 'payment_cancelled'

Why the payment ended. payment_failed: the payment was refused or could not be completed, for example a card that was refused. payment_cancelled: the charge was cancelled before it was paid. Absent from the JSON on the cancellation paths that carry id and amount instead. Switch on it non-exhaustively.

Response

Return a 2xx status to acknowledge receipt.

Changes

Webhooks have no change history: a webhook is keyed by its event name rather than a path and method, so no recorded change can name it.