Invoices

Connect Stripe for invoices

invoices_connect_stripe · Changes data · Markdown

Connects the business's own Stripe account with a restricted key, so invoices can be paid online; the money goes straight to the business.

$0.001 a call

From your agent’s balance. A call that fails costs nothing.

An example

Let customers pay our invoices online through our Stripe account.

Your agent callsinvoices_connect_stripe$0.001 a call

The example business is Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff. The reply is the one the tool really gives.

With these arguments
{}
What comes back
{
  "link": "https://conecto.chat/api/bots/connect/jGCKE7tcnxoPi-Ahfqpmt5LpJ3f31iP34BSDcZOm-hs",
  "expires_in_minutes": 60,
  "tell_the_owner": "Open this link within the hour, sign in to Conecto and type a Stripe restricted key there. It goes to Conecto only; I never see it.",
  "from_a_terminal": "npx @conecto-chat/cli@latest run invoices_connect_stripe -s stripe_key",
  "from_a_terminal_with_curl": "printf %s 'Restricted key: '; read -rs v1; echo; curl -sS -H \"Authorization: Bearer $CONECTO_KEY\" --data-urlencode stripe_key@<(printf %s \"$v1\") https://conecto.chat/api/bots/connect/jGCKE7tcnxoPi-Ahfqpmt5LpJ3f31iP34BSDcZOm-hs; unset v1",
  "next": "When the owner types it on the link, account.credential_added (account_events) says so, with what invoices_connect_stripe answered."
}

Use it when

The business wants a Pay button on its invoices (invoices_set_profile pay_online).

What it does

Connect the business's own Stripe account with a restricted key (a person makes it in Stripe: Developers, API keys, Create restricted key), so invoices can carry a Pay button (invoices_set_profile pay_online). A restricted key with write access to Checkout Sessions and Webhook Endpoints. Conecto registers a webhook on that account to learn when an invoice is paid. The money goes straight to the business; Conecto never holds it. Called without stripe_key, it answers with a link for the owner, who types the key on a Conecto page, so it never passes through the chat (from_a_terminal does the same from a terminal); account.credential_added says when it is connected, and the link costs nothing. The key is kept encrypted and never shown again.

What comes back

Without stripe_key: link, a page where the owner or an admin, signed in, types the restricted key, with expires_in_minutes, tell_the_owner, from_a_terminal (the CLI), from_a_terminal_with_curl and next. With stripe_key: stripe, connected, the Stripe account id, whether it is live and when it was connected. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
stripe_keystringA restricted key, rk_live_... Leave it out to get the link instead. 20 to 300 characters.

The call

Over MCP, call invoices_connect_stripe on https://api.conecto.chat/mcp/invoices. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/invoices_connect_stripe \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
stripe_key_refused400Stripe refused the key, or it lacks a permission invoices need.Ask the owner for a restricted key with the permissions the message lists.
stripe_error502Stripe refused the request.Try again; the message gives Stripe's reason.

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md