ApiError

@Serializable(with = ApiErrorSerializer::class)
data class ApiError(error: InnerError)

An ApiError is an object representing a Stripe API error object.

For more information, see the official Stripe docs: Errors

Use of this SDK is subject to the Stripe Terminal Terms: https://stripe.com/terminal/legal

Constructors

Link copied to clipboard
constructor(error: InnerError)

Types

Link copied to clipboard
@Serializable
data class LocalizationResult(val requestedLocale: String, val resolvedLocale: String)

Reports the outcome of localizing an ApiError.message.

Properties

Link copied to clipboard
val adviceCode: String?

For card errors resulting from a card issuer decline, a short string indicating how to proceed with an error if they provide one.

Link copied to clipboard
val charge: String?

For card errors, the ID of the failed charge

Link copied to clipboard
val code: String?

The code specific to this error type

Link copied to clipboard
val declineCode: String?

If this error results from a declined card (type = CARD_ERROR), this field will provide more details

Link copied to clipboard
val docUrl: String?

A URL to learn more about the error reported

Link copied to clipboard

Reports the outcome of localizing message.

Link copied to clipboard
val message: String

A human-readable message providing more details about the error. For card errors (type == ApiErrorType.CARD_ERROR), these messages can be shown to your users.

Link copied to clipboard
val networkAdviceCode: String?

For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error.

Link copied to clipboard
val networkDeclineCode: String?

For payments declined by the network, an alphanumeric code which indicates the reason the payment failed.

Link copied to clipboard
val param: String?

If the error is parameter-specific, this returns the parameter related to the error

Link copied to clipboard

If the error is related to a PaymentIntent, this returns the payment intent.

Link copied to clipboard

If the error is related to a Refund, this returns the refund.

Link copied to clipboard
val requestLogUrl: String?

A URL to the request log entry in your dashboard.

Link copied to clipboard

If the error is related to a SetupIntent, this returns the setup intent.

Link copied to clipboard

The type of error returned