Banking API Documentation

banking-api-service

Overview

Version information

Version : 1

Tags

  • BankAccountController
  • CreditCardController

Access

  • Base URL: https://public-api.crunch.co.uk/v1/banking

Paths

Archive or un-archive a bank account

Up
put /bank-accounts/archive/{bankAccountId}

Path parameters

bankAccountId (required)
Path Parameter — format: int64

Query parameters

archive (optional)
Query Parameter — To archive or not

Security

oauth2-authorisation-code
Type: oauth2 Scopes: update:all

Return type

Example data

Content-Type: application/json
{
  "unmatchedEntriesAmount" : 1,
  "accountName" : "accountName",
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "bankName" : "bankName",
  "personal" : true,
  "accountNumber" : "accountNumber",
  "sortCode" : "sortCode",
  "unreconciledCrunchPaymentsAmount" : 5,
  "archived" : true,
  "default" : true,
  "bankFeed" : {
    "remainingDays" : 5,
    "bankName" : "bankName",
    "state" : "available"
  },
  "iban" : "iban",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "sortCodeAndAccountNumberEditable" : true,
  "id" : 0,
  "bic" : "bic",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

202

Archiving or un-archiving of bank account accepted BankAccountDto

400

Bank account details not valid

404

Bank account not found and cannot be archived

Create a new bank account

Up
post /bank-accounts

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Request body

body BankAccountDto (optional)
Body Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: create:all

Return type

Example data

Content-Type: application/json
{
  "unmatchedEntriesAmount" : 1,
  "accountName" : "accountName",
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "bankName" : "bankName",
  "personal" : true,
  "accountNumber" : "accountNumber",
  "sortCode" : "sortCode",
  "unreconciledCrunchPaymentsAmount" : 5,
  "archived" : true,
  "default" : true,
  "bankFeed" : {
    "remainingDays" : 5,
    "bankName" : "bankName",
    "state" : "available"
  },
  "iban" : "iban",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "sortCodeAndAccountNumberEditable" : true,
  "id" : 0,
  "bic" : "bic",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

201

Bank account is created BankAccountDto

Delete a bank account

Up
delete /bank-accounts/{bankAccountId}

Path parameters

bankAccountId (required)
Path Parameter — format: int64

Security

oauth2-authorisation-code
Type: oauth2 Scopes: delete:all

Responses

200

Bank account is deleted

404

Bank account not found and cannot be deleted

Get all active / inactive (archived) bank accounts for the current user

Up
get /bank-accounts/accounts/{isArchived}

Path parameters

isArchived (required)
Path Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
[ {
  "unmatchedEntriesAmount" : 1,
  "accountName" : "accountName",
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "bankName" : "bankName",
  "personal" : true,
  "accountNumber" : "accountNumber",
  "sortCode" : "sortCode",
  "unreconciledCrunchPaymentsAmount" : 5,
  "archived" : true,
  "default" : true,
  "bankFeed" : {
    "remainingDays" : 5,
    "bankName" : "bankName",
    "state" : "available"
  },
  "iban" : "iban",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "sortCodeAndAccountNumberEditable" : true,
  "id" : 0,
  "bic" : "bic",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
}, {
  "unmatchedEntriesAmount" : 1,
  "accountName" : "accountName",
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "bankName" : "bankName",
  "personal" : true,
  "accountNumber" : "accountNumber",
  "sortCode" : "sortCode",
  "unreconciledCrunchPaymentsAmount" : 5,
  "archived" : true,
  "default" : true,
  "bankFeed" : {
    "remainingDays" : 5,
    "bankName" : "bankName",
    "state" : "available"
  },
  "iban" : "iban",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "sortCodeAndAccountNumberEditable" : true,
  "id" : 0,
  "bic" : "bic",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
} ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

All active / inactive bank accounts are returned

Get bank account by id

Up
get /bank-accounts/{bankAccountId}

Path parameters

bankAccountId (required)
Path Parameter — format: int64

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "unmatchedEntriesAmount" : 1,
  "accountName" : "accountName",
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "bankName" : "bankName",
  "personal" : true,
  "accountNumber" : "accountNumber",
  "sortCode" : "sortCode",
  "unreconciledCrunchPaymentsAmount" : 5,
  "archived" : true,
  "default" : true,
  "bankFeed" : {
    "remainingDays" : 5,
    "bankName" : "bankName",
    "state" : "available"
  },
  "iban" : "iban",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "sortCodeAndAccountNumberEditable" : true,
  "id" : 0,
  "bic" : "bic",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Bank account is returned BankAccountDto

Get all bank accounts for the current user

Up
get /bank-accounts

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
[ {
  "unmatchedEntriesAmount" : 1,
  "accountName" : "accountName",
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "bankName" : "bankName",
  "personal" : true,
  "accountNumber" : "accountNumber",
  "sortCode" : "sortCode",
  "unreconciledCrunchPaymentsAmount" : 5,
  "archived" : true,
  "default" : true,
  "bankFeed" : {
    "remainingDays" : 5,
    "bankName" : "bankName",
    "state" : "available"
  },
  "iban" : "iban",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "sortCodeAndAccountNumberEditable" : true,
  "id" : 0,
  "bic" : "bic",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
}, {
  "unmatchedEntriesAmount" : 1,
  "accountName" : "accountName",
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "bankName" : "bankName",
  "personal" : true,
  "accountNumber" : "accountNumber",
  "sortCode" : "sortCode",
  "unreconciledCrunchPaymentsAmount" : 5,
  "archived" : true,
  "default" : true,
  "bankFeed" : {
    "remainingDays" : 5,
    "bankName" : "bankName",
    "state" : "available"
  },
  "iban" : "iban",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "sortCodeAndAccountNumberEditable" : true,
  "id" : 0,
  "bic" : "bic",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
} ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

All bank accounts for the current user returned

Get opening balances by bank account Ids

Up
post /bank-accounts/opening-balances

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Request body

Body Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "openingBalances" : [ {
    "accountId" : 0,
    "editable" : true,
    "openingBalance" : "openingBalance"
  }, {
    "accountId" : 0,
    "editable" : true,
    "openingBalance" : "openingBalance"
  } ]
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Returned Opening Balances list OpeningBalancesResponseDto

404

Could not find Opening Balances

Get payments for Bank Account

Up
get /bank-accounts/{id}/payments
The default sorting criteria is date,asc.

Path parameters

bankAccountId (required)
Path Parameter — format: int64

Query parameters

page (optional)
Query Parameter — The index of the page to retrieve, based at 0. format: int32
size (optional)
Query Parameter — Number of records returned per page. Maximum value allowed is 200. default: 20 format: int32
sort (optional)
Query Parameter — Sorting criteria by a given <code>field</code>. format: <field>[,asc|desc]
reconciled (required)
Query Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "number" : 7,
  "size" : 1,
  "last" : true,
  "numberOfElements" : 9,
  "totalPages" : 0,
  "pageable" : {
    "paged" : true,
    "pageNumber" : 2,
    "offset" : 3,
    "pageSize" : 4,
    "unpaged" : true
  },
  "sort" : {
    "unsorted" : true,
    "sorted" : true,
    "empty" : true
  },
  "content" : [ {
    "date" : "2000-01-23",
    "amountType" : "DEBIT",
    "reference" : "reference",
    "amount" : 5.637376656633329,
    "unmatchable" : true,
    "statementEntryId" : 2,
    "deletable" : true,
    "description" : "description",
    "id" : 5,
    "paymentName" : "paymentName",
    "paymentType" : "SUPPLIER_PAYMENT"
  }, {
    "date" : "2000-01-23",
    "amountType" : "DEBIT",
    "reference" : "reference",
    "amount" : 5.637376656633329,
    "unmatchable" : true,
    "statementEntryId" : 2,
    "deletable" : true,
    "description" : "description",
    "id" : 5,
    "paymentName" : "paymentName",
    "paymentType" : "SUPPLIER_PAYMENT"
  } ],
  "first" : true,
  "totalElements" : 6,
  "empty" : true
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

success PagePaymentDto

Make default bank account

Up
put /bank-accounts/default/{bankAccountId}

Path parameters

bankAccountId (required)
Path Parameter — format: int64

Security

oauth2-authorisation-code
Type: oauth2 Scopes: update:all

Responses

200

Bank account is made default

404

Bank account not found

Update an existing bank account

Up
put /bank-accounts/{bankAccountId}

Path parameters

bankAccountId (required)
Path Parameter — format: int64

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Request body

body BankAccountDto (optional)
Body Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: update:all

Return type

Example data

Content-Type: application/json
{
  "unmatchedEntriesAmount" : 1,
  "accountName" : "accountName",
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "bankName" : "bankName",
  "personal" : true,
  "accountNumber" : "accountNumber",
  "sortCode" : "sortCode",
  "unreconciledCrunchPaymentsAmount" : 5,
  "archived" : true,
  "default" : true,
  "bankFeed" : {
    "remainingDays" : 5,
    "bankName" : "bankName",
    "state" : "available"
  },
  "iban" : "iban",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "sortCodeAndAccountNumberEditable" : true,
  "id" : 0,
  "bic" : "bic",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Bank account is updated BankAccountDto

404

Bank account not found and cannot be updated

400

Bank account is not editable

Archive or un-archive a credit card

Up
put /credit-cards/archive/{creditCardId}

Path parameters

creditCardId (required)
Path Parameter — format: int64

Query parameters

archive (optional)
Query Parameter — To archive or not

Security

oauth2-authorisation-code
Type: oauth2 Scopes: update:all

Return type

Example data

Content-Type: application/json
{
  "archived" : true,
  "unmatchedEntriesAmount" : 6,
  "default" : true,
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "cardNumberEditable" : true,
  "personal" : true,
  "id" : 0,
  "unreconciledCrunchPaymentsAmount" : 1,
  "cardNumber" : "cardNumber",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

202

Archiving or un-archiving of credit card accepted CreditCardDto

400

Credit card details not valid

404

Credit card not found and cannot be archived

Create a new credit card

Up
post /credit-cards

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Request body

body CreditCardDto (optional)
Body Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: create:all

Return type

Example data

Content-Type: application/json
{
  "archived" : true,
  "unmatchedEntriesAmount" : 6,
  "default" : true,
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "cardNumberEditable" : true,
  "personal" : true,
  "id" : 0,
  "unreconciledCrunchPaymentsAmount" : 1,
  "cardNumber" : "cardNumber",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

201

Credit card created CreditCardDto

400

Credit card details not valid

Delete a credit card

Up
delete /credit-cards/{creditCardId}

Path parameters

creditCardId (required)
Path Parameter — format: int64

Security

oauth2-authorisation-code
Type: oauth2 Scopes: delete:all

Responses

200

Credit card is deleted

404

Credit card not found and cannot be deleted

Get all active / inactive (archived) credit cards for the current user

Up
get /credit-cards/cards/{isArchived}

Path parameters

(required)
Path Parameter — isArchived

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

array[CreditCardDto]

Example data

Content-Type: application/json
[ {
  "archived" : true,
  "unmatchedEntriesAmount" : 6,
  "default" : true,
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "cardNumberEditable" : true,
  "personal" : true,
  "id" : 0,
  "unreconciledCrunchPaymentsAmount" : 1,
  "cardNumber" : "cardNumber",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
}, {
  "archived" : true,
  "unmatchedEntriesAmount" : 6,
  "default" : true,
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "cardNumberEditable" : true,
  "personal" : true,
  "id" : 0,
  "unreconciledCrunchPaymentsAmount" : 1,
  "cardNumber" : "cardNumber",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
} ]

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

All active / inactive credit cards are returned

Get credit card by id

Up
get /credit-cards/{creditCardId}

Path parameters

creditCardId (required)
Path Parameter — format: int64

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "archived" : true,
  "unmatchedEntriesAmount" : 6,
  "default" : true,
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "cardNumberEditable" : true,
  "personal" : true,
  "id" : 0,
  "unreconciledCrunchPaymentsAmount" : 1,
  "cardNumber" : "cardNumber",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Credit card is returned CreditCardDto

Get opening balance for a Credit Card

Up
get /credit-cards/{creditCardId}/openingBalance

Path parameters

creditCardId (required)
Path Parameter — format: int64

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "accountId" : 0,
  "editable" : true,
  "openingBalance" : "openingBalance"
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Opening balance received OpeningBalanceDto

404

Opening balance not found

Get opening balances by credit card Ids

Up
post /credit-cards/opening-balances

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Request body

Body Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: read:all

Return type

Example data

Content-Type: application/json
{
  "openingBalances" : [ {
    "accountId" : 0,
    "editable" : true,
    "openingBalance" : "openingBalance"
  }, {
    "accountId" : 0,
    "editable" : true,
    "openingBalance" : "openingBalance"
  } ]
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Returned Opening Balances list OpeningBalancesResponseDto

404

Could not find Opening Balances

Make default credit card

Up
put /credit-cards/default/{creditCardId}

Path parameters

creditCardId (required)
Path Parameter — format: int64

Security

oauth2-authorisation-code
Type: oauth2 Scopes: update:all

Responses

200

Credit card is made default

404

Credit card not found

Post opening balance for a credit card

Up
post /credit-cards/postOpeningBalance/{creditCardId}

Path parameters

creditCardId (required)
Path Parameter — format: int64

Query parameters

accountBalance (required)
Query Parameter — Opening balance value

Security

oauth2-authorisation-code
Type: oauth2 Scopes: create:all

Responses

200

Posted opening balance

404

Could not post opening balance

Update an existing credit card

Up
put /credit-cards/{creditCardId}

Path parameters

creditCardId (required)
Path Parameter — format: int64

Consumes

This API call consumes the following media types via the Content-Type request header:
  • application/json

Request body

body CreditCardDto (optional)
Body Parameter

Security

oauth2-authorisation-code
Type: oauth2 Scopes: update:all

Return type

Example data

Content-Type: application/json
{
  "archived" : true,
  "unmatchedEntriesAmount" : 6,
  "default" : true,
  "displayName" : "displayName",
  "deletable" : true,
  "canBeArchived" : true,
  "cardNumberEditable" : true,
  "personal" : true,
  "id" : 0,
  "unreconciledCrunchPaymentsAmount" : 1,
  "cardNumber" : "cardNumber",
  "balanceDto" : {
    "date" : "2000-01-23",
    "balance" : 6.027456183070403
  }
}

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.
  • application/json

Responses

200

Credit card is updated CreditCardDto

404

Credit card not found and cannot be updated

Update opening balance for a credit card account

Up
put /credit-cards/updateOpeningBalance/{creditCardId}

Path parameters

creditCardId (required)
Path Parameter — format: int64

Query parameters

accountBalance (required)
Query Parameter — Opening balance value

Security

oauth2-authorisation-code
Type: oauth2 Scopes: create:all

Responses

200

Updated opening balance

404

Could not update opening balance

Models

[ Jump to Methods ]

Table of Contents

  1. BalanceDto
  2. BankAccountDto
  3. BankFeedDto
  4. CreditCardDto
  5. OpeningBalanceDto
  6. OpeningBalancesRequestDto
  7. OpeningBalancesResponseDto
  8. PagePaymentDto
  9. Pageable
  10. PaymentDto
  11. Sort

BalanceDto Up

balance (optional)
date (optional)
date format: date

BankAccountDto Up

id (optional)
Long format: int64
bankName
displayName
accountName (optional)
sortCode (optional)
accountNumber (optional)
iban (optional)
bic (optional)
balanceDto (optional)
unmatchedEntriesAmount (optional)
Integer format: int32
unreconciledCrunchPaymentsAmount (optional)
Integer format: int32
sortCodeAndAccountNumberEditable (optional)
deletable (optional)
personal (optional)
doesLastReconciledStatementEntryFallIntoClosedFinancialYear (optional)
archived (optional)
canBeArchived (optional)
bankFeed (optional)
default (optional)

BankFeedDto Up

state (optional)
Enum:
available
pending
active
inactive
unavailable
remainingDays (optional)
Long format: int64
bankName (optional)

CreditCardDto Up

id (optional)
Long format: int64
displayName (optional)
cardNumber (optional)
balanceDto (optional)
unmatchedEntriesAmount (optional)
Integer format: int32
unreconciledCrunchPaymentsAmount (optional)
Integer format: int32
cardNumberEditable (optional)
deletable (optional)
default (optional)
personal (optional)
archived (optional)
canBeArchived (optional)

OpeningBalanceDto Up

openingBalance (optional)
accountId (optional)
Long format: int64
editable (optional)

OpeningBalancesRequestDto Up

accountIds (optional)
array[Long] format: int64

PagePaymentDto Up

totalPages (optional)
Integer format: int32
totalElements (optional)
Long format: int64
size (optional)
Integer format: int32
content (optional)
number (optional)
Integer format: int32
sort (optional)
last (optional)
numberOfElements (optional)
Integer format: int32
pageable (optional)
first (optional)
empty (optional)

Pageable Up

offset (optional)
Long format: int64
sort (optional)
pageNumber (optional)
Integer format: int32
paged (optional)
unpaged (optional)
pageSize (optional)
Integer format: int32

PaymentDto Up

id (optional)
Long format: int64
amount (optional)
date (optional)
date format: date
description (optional)
statementEntryId (optional)
Long format: int64
paymentType (optional)
Enum:
SUPPLIER_PAYMENT
BANK_DEPOSIT
MONEY_TRANSFER
COMPANY_LOAN
BOUNCED_CUSTOMER_PAYMENT
COMPANY_LOAN_REPAYMENT
CUSTOMER_PAYMENT
DIRECTOR_WITHDRAWAL
EMPLOYEE_SALARY_PAYMENT
CORPORATION_TAX_PAYMENT
INTEREST_RECEIVED
VAT_PAYMENT
PAYE_NIC_PAYMENT
SHAREHOLDER_DIVIDEND_PAYMENT
PENSION_PAYMENT
OTHER_INCOME
TAX_INCENTIVE
paymentName (optional)
amountType (optional)
Enum:
DEBIT
CREDIT
deletable (optional)
unmatchable (optional)
reference (optional)

Sort Up

empty (optional)
sorted (optional)
unsorted (optional)