# pay_invoice_with_card

> Pay an invoice from a saved card, off-session.

- Tier: W
- Required scope: write:billing + write:payment_methods
- Annotations: idempotentHint
- Docs: https://api.inleed.com/tools/pay-invoice-with-card

## Description

Pay an invoice from a saved card, off-session. This moves money and does not charge on the call: it previews the amount and the card, then returns `{status:"confirmation_required", confirmationUrl, …}`. Show the human the `confirmationUrl`; on approval the card is charged and the result carries an honest `paymentStatus: paid | pending` — the charge is confirmed by polling the invoice, because the off-session charge can fail silently and Stripe reconciles by webhook; if it stays `pending`, poll `get_invoice` or use `create_payment_link`. The card pan never touches this API — pass only a saved `card_id` from `get_invoice_payment_methods` → `cards[].id` (omit to use the default card).

## Input schema

- `invoice_id` — integer (required). The numeric invoice id to pay. Get it from list_invoices → data[].id.
- `card_id` — integer. Which saved card to charge, from get_invoice_payment_methods → cards[].id. Omit to use the account default card.
- `attempt_key` — string. An idempotency key you choose. Reusing it within an hour returns the same held payment instead of charging twice.

## Example call

```json
{
  "name": "pay_invoice_with_card",
  "arguments": {
    "invoice_id": 1
  }
}
```

