Skip to main content

paymentContext

The original reason for a charge and how this attempt was initiated. Recovery never replaces the original reason. Context can be null when it was not captured, including retries of historical invoices.

reason

stringThe original reason, preserved across payment attempts.

paymentLinkId

string | nullThe public payment link ID, or null when the charge did not originate from a payment link. This is independent of the reason and recovery method.

recovery

object | nullNull when the charge does not recover a subscription. payment_recovery identifies a manually recovered overdue subscription, a return after cancellation for non-payment, or a retry of a failed subscription resume. Initial checkout and one-time payment retries are not recovery. dunning_retry identifies an automatic charge retry, not a webhook delivery retry.

recovery.attempt

integerThe charge retry position in the dunning schedule, starting at 1. The original failed charge is not a retry. Present only for dunning_retry.

recovery.maxAttempts

integerThe total automatic retries applicable to this charge when the attempt began. It is not the number of retries remaining. Present only for dunning_retry.

When this fires

When a charge attempt on a payment link is declined. The link stays open — a failed link is retryable, and the customer can pay it again. A later successful attempt fires payment_link.completed. failureCode is the processor’s code (for example card_declined) and failureMessage is the human-readable reason, or null when the provider gives none. The event fires the same way regardless of which payment provider processes the charge.

Body

application/json
id
string
required
event
string
required
Allowed value: "payment_link.failed"
timestamp
string
required
organizationId
string
required
mode
enum<string>
required
Available options:
live,
sandbox
apiVersion
string
required
data
object
required

Response

200

Return any 2xx status code to acknowledge receipt of the event.