# manage_invoice_autogiro

> Schedule or cancel Autogiro (Swedish direct-debit) payment of an invoice.

- Tier: W
- Required scope: write:billing
- Annotations: none
- Docs: https://api.inleed.com/tools/manage-invoice-autogiro

## Description

Schedule or cancel Autogiro (Swedish direct-debit) payment of an invoice. `action=pay` moves money and does not schedule on the call: it previews, then returns `{status:"confirmation_required", confirmationUrl, …}`; on approval a pending Autogiro draw is scheduled (the bank draw is a manual staff export, so nothing moves immediately) — poll `get_pending_action`. `action=cancel` immediately unschedules a not-yet-exported draw and returns `{cancelled:true}`. Autogiro must be enabled — check `get_invoice_payment_methods` → `can.payWithAutogiro`.

## Input schema

- `invoice_id` — integer (required). The numeric invoice id. Get it from list_invoices → data[].id.
- `action` — enum (required). pay schedules an Autogiro draw (money, held for confirmation); cancel unschedules a pending draw immediately. One of pay, cancel.
- `attempt_key` — string. For pay: an idempotency key you choose. Reusing it within an hour returns the same held payment instead of scheduling twice.

## Example call

```json
{
  "name": "manage_invoice_autogiro",
  "arguments": {
    "invoice_id": 1,
    "action": "pay"
  }
}
```

