# 4. Deposits

Before placing orders the account needs funds. There are two ways to deposit money into an account.

## Bankgiro transfer

The customer makes a standard bank transfer to Fondo's bankgiro number using the account's `ref` field as the OCR reference. The `ref` is returned when the account is created and is available on the [account object](/openapi/api/account/getaccounts).

```json
{
  "$ref": "#/components/schemas/ref",
  "components": {
    "schemas": {
      "ref": {
        "type": "string",
        "maxLength": 128,
        "description": "ref is a unique account number, based on\nepoch, length and Luhn. OCR length digit compliant.\n",
        "example": "160367146695159"
      }
    }
  }
}
```

## Swish

Swish lets the customer pay directly from the Swish app. There are two flows:

- **Same device** — the customer is on a mobile device; Swish opens directly via its app-switch token.
- **QR code** — the customer is on a desktop; you display a QR code they scan with the Swish app.


### Create a Swish deposit session

#### Request schema

```json
{
  "$ref": "#/components/schemas/deposit_swish",
  "components": {
    "schemas": {
      "deposit_swish": {
        "$id": "/models/swish/deposit_swish.yaml",
        "type": "object",
        "discriminator": {
          "propertyName": "type"
        },
        "oneOf": [
          {
            "title": "SwishDepositQr",
            "type": "object",
            "required": [
              "type",
              "amount",
              "qrFormat"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "qr"
                ],
                "description": "type of swish signature"
              },
              "clientRef": {
                "type": "string",
                "description": "Client reference for tracking the payment"
              },
              "amount": {
                "type": "number",
                "description": "Amount"
              },
              "qrFormat": {
                "type": "object",
                "required": [
                  "format"
                ],
                "description": "qr format in accordance to to swish Mcom to Qcom qr v1 https://developer.swish.nu/api/qr-codes/v1",
                "properties": {
                  "format": {
                    "type": "string",
                    "enum": [
                      "jpg",
                      "svg",
                      "png"
                    ]
                  },
                  "size": {
                    "type": "number",
                    "description": "Size of the QR code. The code is a square, so width and height are the same. Not required if the format is svg."
                  },
                  "border": {
                    "type": "number",
                    "description": "Width of the border."
                  },
                  "transparent": {
                    "type": "boolean",
                    "description": "Transparent background color. Does not work with jpg format."
                  }
                }
              }
            }
          },
          {
            "title": "SwishDepositSameDevice",
            "type": "object",
            "required": [
              "type",
              "amount"
            ],
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "same_device"
                ],
                "description": "type of swish signature"
              },
              "clientRef": {
                "type": "string",
                "description": "Client reference for tracking the payment"
              },
              "amount": {
                "type": "number",
                "description": "Amount"
              }
            }
          }
        ]
      }
    }
  }
}
```

### Poll for payment status

After creating the Swish session, poll for the result:

#### Response schema

```json
{
  "$ref": "#/components/schemas/swish_poll_response",
  "components": {
    "schemas": {
      "swish_poll_response": {
        "$id": "/models/swish/swish_poll_response.yaml",
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "description": "status from Swish",
            "example": "PAID"
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "error code from Swish",
            "example": "AM02"
          }
        }
      }
    }
  }
}
```

**Next:** [Autogiro deposits](/guides/api-guide/getting-started/autogiro-payments)