# `Stripe.SetupIntent`
[🔗](https://github.com/code-corps/stripity_stripe/blob/v3.3.3/lib/generated/setup_intent.ex#L1)

A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.
For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment.
Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow.

Create a SetupIntent when you're ready to collect your customer's payment credentials.
Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid.
The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides
you through the setup process.

Successful SetupIntents result in payment credentials that are optimized for future payments.
For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through
[Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection
to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents).
If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer),
it automatically attaches the resulting payment method to that Customer after successful setup.
We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on
PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods.

By using SetupIntents, you can reduce friction for your customers, even as regulations change over time.

Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents)

# `acss_debit`

```elixir
@type acss_debit() :: %{
  optional(:currency) =&gt; :cad | :usd,
  optional(:mandate_options) =&gt; mandate_options(),
  optional(:verification_method) =&gt; :automatic | :instant | :microdeposits
}
```

If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.

# `address`

```elixir
@type address() :: %{
  optional(:city) =&gt; binary(),
  optional(:country) =&gt; binary(),
  optional(:line1) =&gt; binary(),
  optional(:line2) =&gt; binary(),
  optional(:postal_code) =&gt; binary(),
  optional(:state) =&gt; binary()
}
```

# `au_becs_debit`

```elixir
@type au_becs_debit() :: %{
  optional(:account_number) =&gt; binary(),
  optional(:bsb_number) =&gt; binary()
}
```

If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.

# `automatic_payment_methods`

```elixir
@type automatic_payment_methods() :: %{
  optional(:allow_redirects) =&gt; :always | :never,
  optional(:enabled) =&gt; boolean()
}
```

When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters.

# `bacs_debit`

```elixir
@type bacs_debit() :: %{
  optional(:account_number) =&gt; binary(),
  optional(:sort_code) =&gt; binary()
}
```

If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.

# `billing_details`

```elixir
@type billing_details() :: %{
  optional(:address) =&gt; address() | binary(),
  optional(:email) =&gt; binary() | binary(),
  optional(:name) =&gt; binary() | binary(),
  optional(:phone) =&gt; binary() | binary(),
  optional(:tax_id) =&gt; binary()
}
```

Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.

# `boleto`

```elixir
@type boleto() :: %{optional(:tax_id) =&gt; binary()}
```

If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.

# `card`

```elixir
@type card() :: %{
  optional(:mandate_options) =&gt; mandate_options(),
  optional(:moto) =&gt; boolean(),
  optional(:network) =&gt;
    :amex
    | :cartes_bancaires
    | :diners
    | :discover
    | :eftpos_au
    | :girocard
    | :interac
    | :jcb
    | :link
    | :mastercard
    | :unionpay
    | :unknown
    | :visa,
  optional(:request_three_d_secure) =&gt; :any | :automatic | :challenge,
  optional(:three_d_secure) =&gt; three_d_secure()
}
```

Configuration for any card setup attempted on this SetupIntent.

# `cartes_bancaires`

```elixir
@type cartes_bancaires() :: %{
  optional(:cb_avalgo) =&gt; :&quot;0&quot; | :&quot;1&quot; | :&quot;2&quot; | :&quot;3&quot; | :&quot;4&quot; | :A,
  optional(:cb_exemption) =&gt; binary(),
  optional(:cb_score) =&gt; integer()
}
```

Cartes Bancaires-specific 3DS fields.

# `created`

```elixir
@type created() :: %{
  optional(:gt) =&gt; integer(),
  optional(:gte) =&gt; integer(),
  optional(:lt) =&gt; integer(),
  optional(:lte) =&gt; integer()
}
```

# `customer_acceptance`

```elixir
@type customer_acceptance() :: %{
  optional(:accepted_at) =&gt; integer(),
  optional(:offline) =&gt; map(),
  optional(:online) =&gt; online(),
  optional(:type) =&gt; :offline | :online
}
```

This hash contains details about the customer acceptance of the Mandate.

# `dob`

```elixir
@type dob() :: %{
  optional(:day) =&gt; integer(),
  optional(:month) =&gt; integer(),
  optional(:year) =&gt; integer()
}
```

Customer's date of birth

# `eps`

```elixir
@type eps() :: %{
  optional(:bank) =&gt;
    :arzte_und_apotheker_bank
    | :austrian_anadi_bank_ag
    | :bank_austria
    | :bankhaus_carl_spangler
    | :bankhaus_schelhammer_und_schattera_ag
    | :bawag_psk_ag
    | :bks_bank_ag
    | :brull_kallmus_bank_ag
    | :btv_vier_lander_bank
    | :capital_bank_grawe_gruppe_ag
    | :deutsche_bank_ag
    | :dolomitenbank
    | :easybank_ag
    | :erste_bank_und_sparkassen
    | :hypo_alpeadriabank_international_ag
    | :hypo_bank_burgenland_aktiengesellschaft
    | :hypo_noe_lb_fur_niederosterreich_u_wien
    | :hypo_oberosterreich_salzburg_steiermark
    | :hypo_tirol_bank_ag
    | :hypo_vorarlberg_bank_ag
    | :marchfelder_bank
    | :oberbank_ag
    | :raiffeisen_bankengruppe_osterreich
    | :schoellerbank_ag
    | :sparda_bank_wien
    | :volksbank_gruppe
    | :volkskreditbank_ag
    | :vr_bank_braunau
}
```

If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.

# `filters`

```elixir
@type filters() :: %{optional(:account_subcategories) =&gt; [:checking | :savings]}
```

Provide filters for the linked accounts that the customer can select for the payment method.

# `financial_connections`

```elixir
@type financial_connections() :: %{
  optional(:filters) =&gt; filters(),
  optional(:permissions) =&gt; [
    :balances | :ownership | :payment_method | :transactions
  ],
  optional(:prefetch) =&gt; [:balances | :ownership | :transactions],
  optional(:return_url) =&gt; binary()
}
```

Additional fields for Financial Connections Session creation

# `fpx`

```elixir
@type fpx() :: %{
  optional(:account_holder_type) =&gt; :company | :individual,
  optional(:bank) =&gt;
    :affin_bank
    | :agrobank
    | :alliance_bank
    | :ambank
    | :bank_islam
    | :bank_muamalat
    | :bank_of_china
    | :bank_rakyat
    | :bsn
    | :cimb
    | :deutsche_bank
    | :hong_leong_bank
    | :hsbc
    | :kfh
    | :maybank2e
    | :maybank2u
    | :ocbc
    | :pb_enterprise
    | :public_bank
    | :rhb
    | :standard_chartered
    | :uob
}
```

If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.

# `ideal`

```elixir
@type ideal() :: %{
  optional(:bank) =&gt;
    :abn_amro
    | :asn_bank
    | :bunq
    | :buut
    | :finom
    | :handelsbanken
    | :ing
    | :knab
    | :moneyou
    | :n26
    | :nn
    | :rabobank
    | :regiobank
    | :revolut
    | :sns_bank
    | :triodos_bank
    | :van_lanschot
    | :yoursafe
}
```

If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.

# `klarna`

```elixir
@type klarna() :: %{
  optional(:currency) =&gt; binary(),
  optional(:on_demand) =&gt; on_demand(),
  optional(:preferred_locale) =&gt;
    :&quot;cs-CZ&quot;
    | :&quot;da-DK&quot;
    | :&quot;de-AT&quot;
    | :&quot;de-CH&quot;
    | :&quot;de-DE&quot;
    | :&quot;el-GR&quot;
    | :&quot;en-AT&quot;
    | :&quot;en-AU&quot;
    | :&quot;en-BE&quot;
    | :&quot;en-CA&quot;
    | :&quot;en-CH&quot;
    | :&quot;en-CZ&quot;
    | :&quot;en-DE&quot;
    | :&quot;en-DK&quot;
    | :&quot;en-ES&quot;
    | :&quot;en-FI&quot;
    | :&quot;en-FR&quot;
    | :&quot;en-GB&quot;
    | :&quot;en-GR&quot;
    | :&quot;en-IE&quot;
    | :&quot;en-IT&quot;
    | :&quot;en-NL&quot;
    | :&quot;en-NO&quot;
    | :&quot;en-NZ&quot;
    | :&quot;en-PL&quot;
    | :&quot;en-PT&quot;
    | :&quot;en-RO&quot;
    | :&quot;en-SE&quot;
    | :&quot;en-US&quot;
    | :&quot;es-ES&quot;
    | :&quot;es-US&quot;
    | :&quot;fi-FI&quot;
    | :&quot;fr-BE&quot;
    | :&quot;fr-CA&quot;
    | :&quot;fr-CH&quot;
    | :&quot;fr-FR&quot;
    | :&quot;it-CH&quot;
    | :&quot;it-IT&quot;
    | :&quot;nb-NO&quot;
    | :&quot;nl-BE&quot;
    | :&quot;nl-NL&quot;
    | :&quot;pl-PL&quot;
    | :&quot;pt-PT&quot;
    | :&quot;ro-RO&quot;
    | :&quot;sv-FI&quot;
    | :&quot;sv-SE&quot;,
  optional(:subscriptions) =&gt; [subscriptions()] | binary()
}
```

If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options.

# `link`

```elixir
@type link() :: %{optional(:persistent_token) =&gt; binary()}
```

If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.

# `mandate_data`

```elixir
@type mandate_data() :: %{optional(:customer_acceptance) =&gt; customer_acceptance()}
```

# `mandate_options`

```elixir
@type mandate_options() :: %{
  optional(:amount) =&gt; integer(),
  optional(:amount_type) =&gt; :fixed | :maximum,
  optional(:currency) =&gt; binary(),
  optional(:description) =&gt; binary(),
  optional(:end_date) =&gt; integer(),
  optional(:interval) =&gt; :day | :month | :sporadic | :week | :year,
  optional(:interval_count) =&gt; integer(),
  optional(:reference) =&gt; binary(),
  optional(:start_date) =&gt; integer(),
  optional(:supported_types) =&gt; [:india]
}
```

Configuration options for setting up an eMandate for cards issued in India.

# `naver_pay`

```elixir
@type naver_pay() :: %{optional(:funding) =&gt; :card | :points}
```

If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.

# `network_options`

```elixir
@type network_options() :: %{optional(:cartes_bancaires) =&gt; cartes_bancaires()}
```

Network specific 3DS fields. Network specific arguments require an
explicit card brand choice. The parameter `payment_method_options.card.network``
must be populated accordingly

# `networks`

```elixir
@type networks() :: %{optional(:requested) =&gt; [:ach | :us_domestic_wire]}
```

Additional fields for network related functions

# `next_billing`

```elixir
@type next_billing() :: %{optional(:amount) =&gt; integer(), optional(:date) =&gt; binary()}
```

Describes the upcoming charge for this subscription.

# `nz_bank_account`

```elixir
@type nz_bank_account() :: %{
  optional(:account_holder_name) =&gt; binary(),
  optional(:account_number) =&gt; binary(),
  optional(:bank_code) =&gt; binary(),
  optional(:branch_code) =&gt; binary(),
  optional(:reference) =&gt; binary(),
  optional(:suffix) =&gt; binary()
}
```

If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.

# `on_demand`

```elixir
@type on_demand() :: %{
  optional(:average_amount) =&gt; integer(),
  optional(:maximum_amount) =&gt; integer(),
  optional(:minimum_amount) =&gt; integer(),
  optional(:purchase_interval) =&gt; :day | :month | :week | :year,
  optional(:purchase_interval_count) =&gt; integer()
}
```

On-demand details if setting up a payment method for on-demand payments.

# `online`

```elixir
@type online() :: %{
  optional(:ip_address) =&gt; binary(),
  optional(:user_agent) =&gt; binary()
}
```

If this is a Mandate accepted online, this hash contains details about the online acceptance.

# `p24`

```elixir
@type p24() :: %{
  optional(:bank) =&gt;
    :alior_bank
    | :bank_millennium
    | :bank_nowy_bfg_sa
    | :bank_pekao_sa
    | :banki_spbdzielcze
    | :blik
    | :bnp_paribas
    | :boz
    | :citi_handlowy
    | :credit_agricole
    | :envelobank
    | :etransfer_pocztowy24
    | :getin_bank
    | :ideabank
    | :ing
    | :inteligo
    | :mbank_mtransfer
    | :nest_przelew
    | :noble_pay
    | :pbac_z_ipko
    | :plus_bank
    | :santander_przelew24
    | :tmobile_usbugi_bankowe
    | :toyota_bank
    | :velobank
    | :volkswagen_bank
}
```

If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.

# `payment_method_data`

```elixir
@type payment_method_data() :: %{
  optional(:sofort) =&gt; sofort(),
  optional(:customer_balance) =&gt; map(),
  optional(:satispay) =&gt; map(),
  optional(:boleto) =&gt; boleto(),
  optional(:alipay) =&gt; map(),
  optional(:au_becs_debit) =&gt; au_becs_debit(),
  optional(:amazon_pay) =&gt; map(),
  optional(:metadata) =&gt; %{optional(binary()) =&gt; binary()},
  optional(:bancontact) =&gt; map(),
  optional(:interac_present) =&gt; map(),
  optional(:bacs_debit) =&gt; bacs_debit(),
  optional(:affirm) =&gt; map(),
  optional(:billing_details) =&gt; billing_details(),
  optional(:mobilepay) =&gt; map(),
  optional(:pay_by_bank) =&gt; map(),
  optional(:nz_bank_account) =&gt; nz_bank_account(),
  optional(:grabpay) =&gt; map(),
  optional(:eps) =&gt; eps(),
  optional(:billie) =&gt; map(),
  optional(:ideal) =&gt; ideal(),
  optional(:pix) =&gt; map(),
  optional(:giropay) =&gt; map(),
  optional(:multibanco) =&gt; map(),
  optional(:revolut_pay) =&gt; map(),
  optional(:klarna) =&gt; klarna(),
  optional(:mb_way) =&gt; map(),
  optional(:twint) =&gt; map(),
  optional(:naver_pay) =&gt; naver_pay(),
  optional(:crypto) =&gt; map(),
  optional(:acss_debit) =&gt; acss_debit(),
  optional(:link) =&gt; map(),
  optional(:kr_card) =&gt; map(),
  optional(:konbini) =&gt; map(),
  optional(:blik) =&gt; map(),
  optional(:p24) =&gt; p24(),
  optional(:paypal) =&gt; map(),
  optional(:fpx) =&gt; fpx(),
  optional(:oxxo) =&gt; map(),
  optional(:paynow) =&gt; map(),
  optional(:alma) =&gt; map(),
  optional(:wechat_pay) =&gt; map(),
  optional(:promptpay) =&gt; map(),
  optional(:type) =&gt;
    :acss_debit
    | :affirm
    | :afterpay_clearpay
    | :alipay
    | :alma
    | :amazon_pay
    | :au_becs_debit
    | :bacs_debit
    | :bancontact
    | :billie
    | :blik
    | :boleto
    | :cashapp
    | :crypto
    | :customer_balance
    | :eps
    | :fpx
    | :giropay
    | :grabpay
    | :ideal
    | :kakao_pay
    | :klarna
    | :konbini
    | :kr_card
    | :link
    | :mb_way
    | :mobilepay
    | :multibanco
    | :naver_pay
    | :nz_bank_account
    | :oxxo
    | :p24
    | :pay_by_bank
    | :payco
    | :paynow
    | :paypal
    | :pix
    | :promptpay
    | :revolut_pay
    | :samsung_pay
    | :satispay
    | :sepa_debit
    | :sofort
    | :swish
    | :twint
    | :us_bank_account
    | :wechat_pay
    | :zip,
  optional(:samsung_pay) =&gt; map(),
  optional(:kakao_pay) =&gt; map(),
  optional(:radar_options) =&gt; radar_options(),
  optional(:cashapp) =&gt; map(),
  optional(:sepa_debit) =&gt; sepa_debit(),
  optional(:afterpay_clearpay) =&gt; map(),
  optional(:payco) =&gt; map(),
  optional(:allow_redisplay) =&gt; :always | :limited | :unspecified,
  optional(:us_bank_account) =&gt; us_bank_account(),
  optional(:swish) =&gt; map(),
  optional(:zip) =&gt; map()
}
```

When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method)
value in the SetupIntent.

# `payment_method_options`

```elixir
@type payment_method_options() :: %{
  optional(:acss_debit) =&gt; acss_debit(),
  optional(:amazon_pay) =&gt; map(),
  optional(:bacs_debit) =&gt; bacs_debit(),
  optional(:card) =&gt; card(),
  optional(:card_present) =&gt; map(),
  optional(:klarna) =&gt; klarna(),
  optional(:link) =&gt; link(),
  optional(:paypal) =&gt; paypal(),
  optional(:sepa_debit) =&gt; sepa_debit(),
  optional(:us_bank_account) =&gt; us_bank_account()
}
```

Payment method-specific configuration for this SetupIntent.

# `paypal`

```elixir
@type paypal() :: %{optional(:billing_agreement_id) =&gt; binary()}
```

If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options.

# `radar_options`

```elixir
@type radar_options() :: %{optional(:session) =&gt; binary()}
```

Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.

# `sepa_debit`

```elixir
@type sepa_debit() :: %{optional(:mandate_options) =&gt; mandate_options()}
```

If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.

# `single_use`

```elixir
@type single_use() :: %{
  optional(:amount) =&gt; integer(),
  optional(:currency) =&gt; binary()
}
```

If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion.

Single-use mandates are only valid for the following payment methods: `acss_debit`, `alipay`, `au_becs_debit`, `bacs_debit`, `bancontact`, `boleto`, `ideal`, `link`, `sepa_debit`, and `us_bank_account`.

# `sofort`

```elixir
@type sofort() :: %{optional(:country) =&gt; :AT | :BE | :DE | :ES | :IT | :NL}
```

If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.

# `subscriptions`

```elixir
@type subscriptions() :: %{
  optional(:interval) =&gt; :day | :month | :week | :year,
  optional(:interval_count) =&gt; integer(),
  optional(:name) =&gt; binary(),
  optional(:next_billing) =&gt; next_billing(),
  optional(:reference) =&gt; binary()
}
```

# `t`

```elixir
@type t() :: %Stripe.SetupIntent{
  application: (binary() | term()) | nil,
  attach_to_self: boolean(),
  automatic_payment_methods: term() | nil,
  cancellation_reason: binary() | nil,
  client_secret: binary() | nil,
  created: integer(),
  customer: (binary() | Stripe.Customer.t() | Stripe.DeletedCustomer.t()) | nil,
  description: binary() | nil,
  excluded_payment_method_types: term() | nil,
  flow_directions: term() | nil,
  id: binary(),
  last_setup_error: Stripe.ApiErrors.t() | nil,
  latest_attempt: (binary() | Stripe.SetupAttempt.t()) | nil,
  livemode: boolean(),
  mandate: (binary() | Stripe.Mandate.t()) | nil,
  metadata: term() | nil,
  next_action: term() | nil,
  object: binary(),
  on_behalf_of: (binary() | Stripe.Account.t()) | nil,
  payment_method: (binary() | Stripe.PaymentMethod.t()) | nil,
  payment_method_configuration_details: term() | nil,
  payment_method_options: term() | nil,
  payment_method_types: term(),
  single_use_mandate: (binary() | Stripe.Mandate.t()) | nil,
  status: binary(),
  usage: binary()
}
```

The `setup_intent` type.

  * `application` ID of the Connect application that created the SetupIntent.
  * `attach_to_self` If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.

It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.
  * `automatic_payment_methods` Settings for dynamic payment methods compatible with this Setup Intent
  * `cancellation_reason` Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.
  * `client_secret` The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.

The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.
  * `created` Time at which the object was created. Measured in seconds since the Unix epoch.
  * `customer` ID of the Customer this SetupIntent belongs to, if one exists.

If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.
  * `description` An arbitrary string attached to the object. Often useful for displaying to users.
  * `excluded_payment_method_types` Payment method types that are excluded from this SetupIntent.
  * `flow_directions` Indicates the directions of money movement for which this payment method is intended to be used.

Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.
  * `id` Unique identifier for the object.
  * `last_setup_error` The error encountered in the previous SetupIntent confirmation.
  * `latest_attempt` The most recent SetupAttempt for this SetupIntent.
  * `livemode` Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
  * `mandate` ID of the multi use Mandate generated by the SetupIntent.
  * `metadata` Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
  * `next_action` If present, this property tells you what actions you need to take in order for your customer to continue payment setup.
  * `object` String representing the object's type. Objects of the same type share the same value.
  * `on_behalf_of` The account (if any) for which the setup is intended.
  * `payment_method` ID of the payment method used with this SetupIntent. If the payment method is `card_present` and isn't a digital wallet, then the [generated_card](https://docs.stripe.com/api/setup_attempts/object#setup_attempt_object-payment_method_details-card_present-generated_card) associated with the `latest_attempt` is attached to the Customer instead.
  * `payment_method_configuration_details` Information about the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) used for this Setup Intent.
  * `payment_method_options` Payment method-specific configuration for this SetupIntent.
  * `payment_method_types` The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type).
  * `single_use_mandate` ID of the single_use Mandate generated by the SetupIntent.
  * `status` [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`.
  * `usage` Indicates how the payment method is intended to be used in the future.

Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`.

# `three_d_secure`

```elixir
@type three_d_secure() :: %{
  optional(:ares_trans_status) =&gt; :A | :C | :I | :N | :R | :U | :Y,
  optional(:cryptogram) =&gt; binary(),
  optional(:electronic_commerce_indicator) =&gt;
    :&quot;01&quot; | :&quot;02&quot; | :&quot;05&quot; | :&quot;06&quot; | :&quot;07&quot;,
  optional(:network_options) =&gt; network_options(),
  optional(:requestor_challenge_indicator) =&gt; binary(),
  optional(:transaction_id) =&gt; binary(),
  optional(:version) =&gt; :&quot;1.0.2&quot; | :&quot;2.1.0&quot; | :&quot;2.2.0&quot;
}
```

If 3D Secure authentication was performed with a third-party provider,
the authentication details to use for this setup.

# `us_bank_account`

```elixir
@type us_bank_account() :: %{
  optional(:financial_connections) =&gt; financial_connections(),
  optional(:mandate_options) =&gt; mandate_options(),
  optional(:networks) =&gt; networks(),
  optional(:verification_method) =&gt; :automatic | :instant | :microdeposits
}
```

If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.

# `cancel`

```elixir
@spec cancel(
  intent :: binary(),
  params :: %{
    optional(:cancellation_reason) =&gt;
      :abandoned | :duplicate | :requested_by_customer,
    optional(:expand) =&gt; [binary()]
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>You can cancel a SetupIntent object when it’s in one of these statuses: <code>requires_payment_method</code>, <code>requires_confirmation</code>, or <code>requires_action</code>. </p>

<p>After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can’t cancel the SetupIntent for a Checkout Session. <a href="/docs/api/checkout/sessions/expire">Expire the Checkout Session</a> instead.</p>

#### Details

 * Method: `post`
 * Path: `/v1/setup_intents/{intent}/cancel`

# `confirm`

```elixir
@spec confirm(
  intent :: binary(),
  params :: %{
    optional(:confirmation_token) =&gt; binary(),
    optional(:expand) =&gt; [binary()],
    optional(:mandate_data) =&gt; mandate_data() | binary() | mandate_data(),
    optional(:payment_method) =&gt; binary(),
    optional(:payment_method_data) =&gt; payment_method_data(),
    optional(:payment_method_options) =&gt; payment_method_options(),
    optional(:return_url) =&gt; binary(),
    optional(:use_stripe_sdk) =&gt; boolean()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>Confirm that your customer intends to set up the current or
provided payment method. For example, you would confirm a SetupIntent
when a customer hits the “Save” button on a payment method management
page on your website.</p>

<p>If the selected payment method does not require any additional
steps from the customer, the SetupIntent will transition to the
<code>succeeded</code> status.</p>

<p>Otherwise, it will transition to the <code>requires_action</code> status and
suggest additional actions via <code>next_action</code>. If setup fails,
the SetupIntent will transition to the
<code>requires_payment_method</code> status or the <code>canceled</code> status if the
confirmation limit is reached.</p>

#### Details

 * Method: `post`
 * Path: `/v1/setup_intents/{intent}/confirm`

# `create`

```elixir
@spec create(
  params :: %{
    optional(:attach_to_self) =&gt; boolean(),
    optional(:automatic_payment_methods) =&gt; automatic_payment_methods(),
    optional(:confirm) =&gt; boolean(),
    optional(:confirmation_token) =&gt; binary(),
    optional(:customer) =&gt; binary(),
    optional(:description) =&gt; binary(),
    optional(:excluded_payment_method_types) =&gt; [
      :acss_debit
      | :affirm
      | :afterpay_clearpay
      | :alipay
      | :alma
      | :amazon_pay
      | :au_becs_debit
      | :bacs_debit
      | :bancontact
      | :billie
      | :blik
      | :boleto
      | :card
      | :cashapp
      | :crypto
      | :customer_balance
      | :eps
      | :fpx
      | :giropay
      | :grabpay
      | :ideal
      | :kakao_pay
      | :klarna
      | :konbini
      | :kr_card
      | :mb_way
      | :mobilepay
      | :multibanco
      | :naver_pay
      | :nz_bank_account
      | :oxxo
      | :p24
      | :pay_by_bank
      | :payco
      | :paynow
      | :paypal
      | :pix
      | :promptpay
      | :revolut_pay
      | :samsung_pay
      | :satispay
      | :sepa_debit
      | :sofort
      | :swish
      | :twint
      | :us_bank_account
      | :wechat_pay
      | :zip
    ],
    optional(:expand) =&gt; [binary()],
    optional(:flow_directions) =&gt; [:inbound | :outbound],
    optional(:mandate_data) =&gt; mandate_data() | binary(),
    optional(:metadata) =&gt; %{optional(binary()) =&gt; binary()},
    optional(:on_behalf_of) =&gt; binary(),
    optional(:payment_method) =&gt; binary(),
    optional(:payment_method_configuration) =&gt; binary(),
    optional(:payment_method_data) =&gt; payment_method_data(),
    optional(:payment_method_options) =&gt; payment_method_options(),
    optional(:payment_method_types) =&gt; [binary()],
    optional(:return_url) =&gt; binary(),
    optional(:single_use) =&gt; single_use(),
    optional(:usage) =&gt; :off_session | :on_session,
    optional(:use_stripe_sdk) =&gt; boolean()
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>Creates a SetupIntent object.</p>

<p>After you create the SetupIntent, attach a payment method and <a href="/docs/api/setup_intents/confirm">confirm</a>
it to collect any required permissions to charge the payment method later.</p>

#### Details

 * Method: `post`
 * Path: `/v1/setup_intents`

# `list`

```elixir
@spec list(
  params :: %{
    optional(:attach_to_self) =&gt; boolean(),
    optional(:created) =&gt; created() | integer(),
    optional(:customer) =&gt; binary(),
    optional(:ending_before) =&gt; binary(),
    optional(:expand) =&gt; [binary()],
    optional(:limit) =&gt; integer(),
    optional(:payment_method) =&gt; binary(),
    optional(:starting_after) =&gt; binary()
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>Returns a list of SetupIntents.</p>

#### Details

 * Method: `get`
 * Path: `/v1/setup_intents`

# `retrieve`

```elixir
@spec retrieve(
  intent :: binary(),
  params :: %{
    optional(:client_secret) =&gt; binary(),
    optional(:expand) =&gt; [binary()]
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>Retrieves the details of a SetupIntent that has previously been created. </p>

<p>Client-side retrieval using a publishable key is allowed when the <code>client_secret</code> is provided in the query string. </p>

<p>When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the <a href="#setup_intent_object">SetupIntent</a> object reference for more details.</p>

#### Details

 * Method: `get`
 * Path: `/v1/setup_intents/{intent}`

# `update`

```elixir
@spec update(
  intent :: binary(),
  params :: %{
    optional(:attach_to_self) =&gt; boolean(),
    optional(:customer) =&gt; binary(),
    optional(:description) =&gt; binary(),
    optional(:excluded_payment_method_types) =&gt;
      [
        :acss_debit
        | :affirm
        | :afterpay_clearpay
        | :alipay
        | :alma
        | :amazon_pay
        | :au_becs_debit
        | :bacs_debit
        | :bancontact
        | :billie
        | :blik
        | :boleto
        | :card
        | :cashapp
        | :crypto
        | :customer_balance
        | :eps
        | :fpx
        | :giropay
        | :grabpay
        | :ideal
        | :kakao_pay
        | :klarna
        | :konbini
        | :kr_card
        | :mb_way
        | :mobilepay
        | :multibanco
        | :naver_pay
        | :nz_bank_account
        | :oxxo
        | :p24
        | :pay_by_bank
        | :payco
        | :paynow
        | :paypal
        | :pix
        | :promptpay
        | :revolut_pay
        | :samsung_pay
        | :satispay
        | :sepa_debit
        | :sofort
        | :swish
        | :twint
        | :us_bank_account
        | :wechat_pay
        | :zip
      ]
      | binary(),
    optional(:expand) =&gt; [binary()],
    optional(:flow_directions) =&gt; [:inbound | :outbound],
    optional(:metadata) =&gt; %{optional(binary()) =&gt; binary()} | binary(),
    optional(:payment_method) =&gt; binary(),
    optional(:payment_method_configuration) =&gt; binary(),
    optional(:payment_method_data) =&gt; payment_method_data(),
    optional(:payment_method_options) =&gt; payment_method_options(),
    optional(:payment_method_types) =&gt; [binary()]
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>Updates a SetupIntent object.</p>

#### Details

 * Method: `post`
 * Path: `/v1/setup_intents/{intent}`

# `verify_microdeposits`

```elixir
@spec verify_microdeposits(
  intent :: binary(),
  params :: %{
    optional(:amounts) =&gt; [integer()],
    optional(:descriptor_code) =&gt; binary(),
    optional(:expand) =&gt; [binary()]
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
```

<p>Verifies microdeposits on a SetupIntent object.</p>

#### Details

 * Method: `post`
 * Path: `/v1/setup_intents/{intent}/verify_microdeposits`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
