consumer-banking-xs2a (1.0.0)

Download OpenAPI specification:Download

Access to Account API specification

Create a session

Create a consent session by providing email and permissions.

Request
header Parameters
X-Request-ID
string

ID of the request, unique to the call, as determined by the initiating party. You can communicate this header to us to debug any issues with your requests.

Request Body schema: application/json
email
required
string

Email address the user used for their Klarna Bank Account.

postal_code
required
string

Postal code of the consent session creator.

permission
required
Array of strings

Type of PSD2 permission level to grant.

Items Enum: "AIS" "PIIS"
Responses
201

Consent session response.

400

Validation of request parameters failed.

403

The client does not have access rights to the content. This could be caused by many things - an invalid certificate, missing permission or an attempted access to resources that the TPP has no access to. The error message and code should give more context for the cause of the error.

404

Could not initiate consent session.

post/v2/consent-sessions
Request samples
application/json
{
  • "email": "sven.svenson@klarna.com",
  • "postal_code": "10115",
  • "permission": [
    ]
}
Response samples
application/json
{
  • "id": "04d2bd77-f310-4c45-b435-a0bb588697ef",
  • "status": "AWAITING_APPROVAL",
  • "consent_id": "null"
}

Get session details

Get the status of a consent session.

Request
path Parameters
consent_session_id
required
string

ID of the consent session.

header Parameters
X-Request-ID
string

ID of the request, unique to the call, as determined by the initiating party. You can communicate this header to us to debug any issues with your requests.

Responses
200

Consent session response.

400

Validation of request parameters failed.

401

Authorization information is missing or invalid.

403

The client does not have access rights to the content.

404

Could not get consent session.

get/v2/consent-sessions/{consent_session_id}
Request samples
curl -i -X GET \
  'https://api.klarna.com/v2/consent-sessions/{consent_session_id}' \
  -H 'X-Request-ID: string'
Response samples
application/json
{
  • "id": "04d2bd77-f310-4c45-b435-a0bb588697ef",
  • "status": "APPROVED",
  • "consent_id": "06e11107-c9c1-466a-b686-2223161692d0"
}

Account list

Get the list of accounts of a given user.

Request
header Parameters
consent-id
required
string

The consent-id that was received in the GET /consent-sessions/{consent_session_id} request

X-Request-ID
string

ID of the request, unique to the call, as determined by the initiating party. You can communicate this header to us to debug any issues with your requests.

Responses
200

Accounts response.

400

Validation of request parameters failed.

401

Authorization information is missing or invalid.

403

The client does not have access rights to the content.

404

Could not get accounts.

get/v2/accounts
Request samples
curl -i -X GET \
  https://api.klarna.com/v2/accounts \
  -H 'X-Request-ID: string' \
  -H 'consent-id: string'
Response samples
application/json
{
  • "accounts": [
    ]
}

Account details

Get the account details of a given account.

Request
path Parameters
account_id
required
string

account id

header Parameters
consent-id
required
string

The consent-id that was received in the GET /consent-sessions/{consent_session_id} request

X-Request-ID
string

ID of the request, unique to the call, as determined by the initiating party. You can communicate this header to us to debug any issues with your requests.

Responses
200

Account response.

400

Validation of request parameters failed.

401

Authorization information is missing or invalid.

403

The client does not have access rights to the content.

404

Could not get account.

get/v2/accounts/{account_id}
Request samples
curl -i -X GET \
  'https://api.klarna.com/v2/accounts/{account_id}' \
  -H 'X-Request-ID: string' \
  -H 'consent-id: string'
Response samples
application/json
{
  • "id": "135d9376-b529-44f1-b5a4-bc54f54c9785",
  • "type": "CURRENT",
  • "account_holder_id": "c11ee70f-0769-4a73-9c7c-1b000b3d8756",
  • "account_number": "null",
  • "iban": "DE2635638985986393786474",
  • "bic": "KLRNDEBE",
  • "holder_name": "Sven Svenson",
  • "holder_address": "Chausseestraße 117, Berlin",
  • "bank_name": "Bank Name",
  • "bank_address": "Chausseestraße 117, Berlin",
  • "sort_code": "10010300",
  • "balance": {
    }
}

Account balance

Get the account balance for a given account.

Request
path Parameters
account_id
required
string

account id

header Parameters
consent-id
required
string

The consent-id that was received in the GET /consent-sessions/{consent_session_id} request

X-Request-ID
string

ID of the request, unique to the call, as determined by the initiating party. You can communicate this header to us to debug any issues with your requests.

Responses
200

Account balance response.

400

Validation of request parameters failed.

401

Authorization information is missing or invalid.

403

The client does not have access rights to the content.

404

Could not get account balance.

get/v2/accounts/{account_id}/balance
Request samples
curl -i -X GET \
  'https://api.klarna.com/v2/accounts/{account_id}/balance' \
  -H 'X-Request-ID: string' \
  -H 'consent-id: string'
Response samples
application/json
{
  • "amount": 4000,
  • "currency": "EUR"
}

Transaction list

Get the transactions for a given account.

Request
path Parameters
account_id
required
string

account id

query Parameters
start_at
string

Format: yyyy-MM-dd Earliest inclusive initiation or completion date of a transaction.

end_at
string

Format: yyyy-MM-dd Latest inclusive initiation or completion date of a transaction.

page_number
integer >= 0
Default: 0

Page number - defaults to 0

page_size
integer [ 1 .. 100 ]
Default: 20

Page size - defaults to 20

header Parameters
consent-id
required
string

The consent-id that was received in the GET /consent-sessions/{consent_session_id} request

X-Request-ID
string

ID of the request, unique to the call, as determined by the initiating party. You can communicate this header to us to debug any issues with your requests.

Responses
200

Paginated transactions response.

400

Validation of request parameters failed.

401

Authorization information is missing or invalid.

403

The client does not have access rights to the content.

404

Could not get account transactions.

get/v2/accounts/{account_id}/transactions
Request samples
curl -i -X GET \
  'https://api.klarna.com/v2/accounts/{account_id}/transactions?start_at=string&end_at=string&page_number=0&page_size=20' \
  -H 'X-Request-ID: string' \
  -H 'consent-id: string'
Response samples
application/json
{
  • "account_id": "66d3b648-f5f4-414e-8a3d-5fb6e1a6d05c",
  • "transactions": [
    ],
  • "page_info": {
    }
}

Funds confirmation

Confirm of the available funds for an amount and a given email in a given currency.

Request
header Parameters
consent-id
required
string

The consent-id that was received in the GET /consent-sessions/{consent_session_id} request

X-Request-ID
string

ID of the request, unique to the call, as determined by the initiating party. You can communicate this header to us to debug any issues with your requests.

Request Body schema: application/json
amount
required
number

Fund amount in the smallest unit of given currency (e.g. 1.89 EUR would be 189 cents { amount: 189 }).

currency
required
string

Currency.

email
required
string

Email address the user used for their Klarna Bank Account.

Responses
200

Fund confirmation response.

400

The requested account has a different currency.

403

Account not approved for the consent-id.

404

The requested account does not exist.

post/v2/funds-confirmations
Request samples
application/json
{
  • "amount": 300,
  • "currency": "EUR",
  • "email": "sven.svenson@klarna.com"
}
Response samples
application/json
{
  • "result": true
}

Create payment

Initiate a standard or standing order payment.

Request
header Parameters
X-Request-ID
string

ID of the request, unique to the call, as determined by the initiating party. You can communicate this header to us to debug any issues with your requests.

Request Body schema: application/json
amount
required
number

Payment amount in the smallest unit of the currency. For EUR, it is in cents.

currency
required
string

Payment currency.

email
required
string

Email of the payment creator.

postal_code
required
string

Postal code of the payment creator.

reference
string

Payment reference.

required
object
object
Responses
201

Initiated payment response.

400

Validation of request parameters failed.

401

Authorization information is missing or invalid.

403

The client does not have access rights to the content.

404

Could not initiate payment.

post/v2/payments
Request samples
application/json
{
  • "amount": 5000,
  • "currency": "EUR",
  • "email": "sven.svenson@klarna.com",
  • "postal_code": "10115",
  • "reference": "Reference",
  • "to": {
    },
  • "standing_order": {
    }
}
Response samples
application/json
{
  • "id": "60e5d557-964c-43ab-a19f-0c7d29bd9d84",
  • "status": "AWAITING_APPROVAL"
}

Payment details

Get the payment details of a given payment.

Request
path Parameters
payment_id
required
string

ID of the payment.

header Parameters
X-Request-ID
string

ID of the request, unique to the call, as determined by the initiating party. You can communicate this header to us to debug any issues with your requests.

Responses
200

Payment response.

400

Validation of request parameters failed.

401

Authorization information is missing or invalid.

403

The client does not have access rights to the content.

404

Could not find payment.

get/v2/payments/{payment_id}
Request samples
curl -i -X GET \
  'https://api.klarna.com/v2/payments/{payment_id}' \
  -H 'X-Request-ID: string'
Response samples
application/json
{
  • "id": "60e5d557-964c-43ab-a19f-0c7d29bd9d84",
  • "status": "APPROVED",
  • "sender_details": {
    }
}

Revoke payment

This will only revoke payments with status AWAITING_APPROVAL

Request
path Parameters
payment_id
required
string

ID of the payment.

header Parameters
X-Request-ID
string

ID of the request, unique to the call, as determined by the initiating party. You can communicate this header to us to debug any issues with your requests.

Responses
200

Success

400

Validation of request parameters failed.

401

Authorization information is missing or invalid.

403

The client does not have access rights to the content.

404

Could not find payment.

delete/v2/payments/{payment_id}
Request samples
curl -i -X DELETE \
  'https://api.klarna.com/v2/payments/{payment_id}' \
  -H 'X-Request-ID: string'