> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brosbots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Payment during the call (Stripe)

> The agent texts a one-time payment link and checks that the payment arrived before the caller hangs up.

## What it does

During a call the agent can take a payment: a deposit for an appointment, a
booking fee, an overdue invoice. It names the amount and what it is for, and
once the caller agrees it creates a **one-time Payment Link** in your own
Stripe account and texts it to the caller's number. The caller pays on their
phone (BLIK, Przelewy24, card, whatever the account has switched on), and the
agent asks Stripe with `check_payment_status` whether the payment came
through, confirming it while still on the line.

The link allows a single completed payment, so a double tap does not mean
two charges.

## Setup

1. In Stripe: **Developers → API keys**, create a **restricted key** with
   write access to Payment Links, Products and Prices and read access to
   Checkout Sessions. A secret key (`sk_`) works too; a publishable key
   (`pk_`) does not, and the connection test says so.
2. **Integrations → Stripe**: paste the key, optionally the currency
   (default PLN) and the business name shown in the SMS. **Test
   connection** reads the account and checks it can take payments.
3. In Stripe **Settings → Payment methods** switch on BLIK and Przelewy24 so
   Polish callers pay in their banking app instead of typing a card.
4. Agent editor → **Integrations** → **Payment link during the call**: pick
   the connection and write when the agent may ask for a payment, e.g. "50
   PLN deposit when booking a first visit; overdue invoices for the amount
   the caller states".

<Note>
  The SMS goes out from the agent's number, so the agent needs an assigned
  number that sends SMS (plfon and Telnyx numbers do). Without one the tool
  returns an error and the agent says it cannot send the link.
</Note>

## What the caller sees

An SMS like `Studio Fit: Deposit for 15 Oct - 50,00 PLN. Pay here:
https://buy.stripe.com/...`. The link opens Stripe's checkout page with the
account's payment methods and a confirmation after paying.

## What you see

* **Integrations → Deliveries** lists every link: amount, description,
  number, link URL and whether the SMS went out. The URL finds the payment in
  the Stripe dashboard.
* In Stripe the link carries metadata `brosbots_run` (the call id) and
  `phone`.

## Agent tools

| Tool | What it does |
| - | - |
| `send_payment_link(amount, description, to?)` | creates a price and a one-time link, sends the SMS |
| `check_payment_status(payment_link_id?)` | whether the last link of this call has been paid |

The amount is in currency units (`49.90`); "49,90" and "50 zł" are
understood too. A non-numeric or zero amount is refused before anything is
sent to Stripe.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.