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.
The original charge attempt, before recovery.
Initial attempt
The customer recovers an overdue subscription. The original charge reason is preserved.
Manual recovery
The second automatic retry of a subscription resume charge, out of four allowed retries. The reason remains subscription_resume.
Dunning retries
The charge context was not captured. Do not infer the original reason from the subscription’s current state.
No context

Body

application/json
id
string
required
event
string
required
Allowed value: "payment.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.