Account

user.payment_method.setup

Check whether a card is on file, and get the link to add or replace one.

View as Markdown

The first tool a buyer's assistant calls. Card numbers are never typed into the chat.

TypeWrite: changes a cart or an order
Needs a cart the buyer approvedNo
Moves moneyNo
Tool description (what the assistant sees)
Starts saving a card for the buyer. Returns a Stripe setup client secret for the buyer's own payment page, plus the cards already on file; card numbers are never accepted as tool input. With replace: true it returns a link that saves a new card and removes the old one once the new one is saved. Safe to call repeatedly.

#Parameters

NameTypeRequiredDescription
replacebooleanNotrue returns a link that saves a new card and removes the old one once the new one is saved.
include_setup_client_secretbooleanNoOnly for a surface that can draw Stripe's card form itself. Chat clients use card_setup_url instead.

#Notes

  • checkout_ready says whether the buyer can order now.
  • ACCOUNT_SETUP_REQUIRED means the phone, terms or card step is not finished. Give the buyer the link from corrective_action exactly as returned and stop.