Values

API_VERSION

API_VERSION: Str "2026-10-28.endive"

The Stripe API version this package is written against, sent as the Stripe-Version header on every request so responses never depend on the account's default version. Override per project with the stripe.api.version context variable, or per call with RequestOptions({stripe_version: ...}).

See https://docs.stripe.com/upgrades and https://docs.stripe.com/changelog.

BASE_URL

BASE_URL: Str "https://api.stripe.com"

Base URL for all Stripe API requests (no trailing slash). Endpoint URLs are built as ${::stripe/BASE_URL}/v1/....

Types

ApiErrors

ApiErrors type {
    advice_code: Str?,
    charge: Str?,
    code: Str?,
    decline_code: Str?,
    doc_url: Str?,
    message: Str?,
    param: Str?,
    payment_intent: Any?,
    payment_method: Any?,
    payment_method_type: Str?,
    request_log_url: Str?,
    setup_intent: Any?,
    source: Any?,
    type: Str?
}

Structured error details returned by the Stripe API inside an Error response body. Contains machine-readable codes and a human-readable message describing what went wrong.

See https://docs.stripe.com/api/errors for field descriptions.

Example

response ::stripe::api/request("GET", `${::stripe/BASE_URL}/v1/charges/ch_invalid`)
error ::stripe/Error(response.body)
error.error.type     // => "invalid_request_error"
error.error.message  // => "No such charge: ch_invalid"
error.error.code     // => "resource_missing"

Error

Error type {
    error: ApiErrors
}

Top-level error wrapper returned by the Stripe API when a request fails. Contains an error field with detailed ApiErrors information.