# 5. Autogiro Deposits

Autogiro lets you pull deposits from the customer's bank account into their Fondo account. It is used in two ways:

1. **Allocation plans** — Rules for distributing an account's cash balance across funds by percentage (e.g., "allocate 60% to fund X, 40% to fund Y").
2. **Savings plans** — Recurring withdrawals from a payment account, investing fixed amounts into specified funds (e.g., "withdraw 5000 SEK monthly and buy fund X").


## Step 1: Sign the autogiro mandate

There are multiple ways to create an autogiro mandate:

1. In the `createAccount` journey when setting up an allocation plan — you provide the autogiro bank account when initializing the journey.
2. In the `updateAllocationPlan` journey — you provide the autogiro bank account when initializing the journey.
3. In the `addBankAccount` journey — the customer selects a bank account to connect, including a 3rd-party account verification.
4. In the `createAccount` journey when setting up a savings plan.


## Step 2: Create a payment instruction (only for allocation plan)

Once the mandate is active, trigger autogiro deposits by creating a payment instruction. You can batch multiple payments (to different accounts) in a single instruction.

The instruction progresses through: `new` → `executing` → `processed`. The `clientRef` you provide is copied to the resulting cash transactions for reconciliation.

### Payment instruction schema

```json
{
  "$ref": "#/components/schemas/post_payment_instruction",
  "components": {
    "schemas": {
      "uuid": {
        "$id": "/models/uuid.yaml",
        "title": "UUID",
        "type": "string",
        "example": "49ad7378-121c-4a53-9894-dfd14a7b4877",
        "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
      },
      "post_payment_instruction": {
        "$id": "/models/payment/post_payment_instruction.yaml",
        "type": "object",
        "required": [
          "payments",
          "type"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "description": "The type of payment",
            "enum": [
              "autogiro"
            ]
          },
          "payments": {
            "description": "Array of payment instructions",
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "amount",
                "account",
                "clientRef"
              ],
              "properties": {
                "amount": {
                  "description": "The amount of the payment",
                  "type": "number",
                  "example": 110
                },
                "account": {
                  "$ref": "#/components/schemas/uuid"
                },
                "clientRef": {
                  "description": "Client specified reference for keeping track of payment.\nValue is copied to the `clientRef` of transactions\n",
                  "example": "instruction_id_29384",
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
```

## Track payments

Check the status of individual payments within an instruction:

**Next:** [Place an order](/guides/api-guide/getting-started/place-order)