Skip to content

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.

string, <= 128 characters

ref is a unique account number, based on epoch, length and Luhn. OCR length digit compliant.

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

curl -i -X POST \
  'https://api.sandbox.fondo.se/v2/partner/client/{clientId}/account/{accountId}/deposit/swish' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "qr",
    "clientRef": "string",
    "thirdPartySsn": "string",
    "message": "string",
    "amount": 0,
    "qrFormat": {
      "format": "jpg",
      "size": 0,
      "border": 0,
      "transparent": true
    }
  }'

Request schema

typestringrequired

Type of swish signature

Value:"qr"
Discriminator
clientRefstring

Client reference for tracking the payment

thirdPartySsnstring(SSN (Social Security Number))^(19|20)[0-9]{2}(0[1-9]|1[0-2])(0[1-9]|[12][0...

Social security number of a payer other than the account owner. Omit it when the owner pays. Requires the client permission allowThirdPartySwishDeposits, that third-party Swish deposits are enabled on the account (thirdPartySwishDepositsEnabled) and that Fondo has not blocked them (thirdPartySwishDepositsBlocked); otherwise the request fails with 400 and error_description third_party_swish_not_allowed. Only allowed for accounts owned by a natural person.

Example:"197001010003"
messagestring, <= 50 characters

Message shown to the payer. Ignored in production, where a fixed message is used. In test environments the Swish simulator derives the payment outcome from this value.

amountnumberrequired

Amount

qrFormatobjectrequired

qr format in accordance to to swish Mcom to Qcom qr v1 https://developer.swish.nu/api/qr-codes/v1

Poll for payment status

After creating the Swish session, poll for the result:

curl -i -X GET \
  'https://api.sandbox.fondo.se/v2/partner/deposit/swish/{swishId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Response schema

statusstring

status from Swish

Example:"PAID"
errorCodestring or null

error code from Swish

Example:"AM02"

Letting someone else pay

By default the account owner pays. Pass thirdPartySsn to let another person pay into the account, for example a parent depositing to a child's account.

Third-party deposits require all of the following, otherwise the request fails with 400 and error_description third_party_swish_not_allowed:

  • The client permission allowThirdPartySwishDeposits, set by Fondo and visible under permissions on the client.
  • Third-party Swish deposits are enabled on the account. Set thirdPartySwishDepositsEnabled with PATCH /v2/partner/client/{clientId}/account/{accountId} once the customer agrees to receive Swish deposits from others. Accounts default to false.
  • Fondo has not blocked it on the account. thirdPartySwishDepositsBlocked is read-only on the account.
curl -i -X PATCH \
  'https://api.sandbox.fondo.se/v2/partner/client/{clientId}/account/{accountId}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string",
    "thirdPartySwishDepositsEnabled": true
  }'

Next: Autogiro deposits