Banking API Documentation

Overview

Version information

Version : 1

Tags

  • BankAccountController
  • CreditCardController

Paths

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

Create a new bank account

POST /bank-accounts

Parameters

Type Name Schema
Body body
optional
BankAccountDto

Responses

HTTP Code Description Schema
200 successful operation BankAccountDto
201 Bank account is created No Content

Tags

  • BankAccountController

Security

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

Example HTTP request

Request path
/bank-accounts
Request body
{
  "accountName" : "string",
  "accountNumber" : "string",
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "bankFeed" : {
    "bankName" : "string",
    "remainingDays" : 0,
    "state" : "string"
  },
  "bankName" : "string",
  "bic" : "string",
  "canBeArchived" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "iban" : "string",
  "id" : 0,
  "personal" : true,
  "sortCode" : "string",
  "sortCodeAndAccountNumberEditable" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
}

Example HTTP response

Response 200
{
  "accountName" : "string",
  "accountNumber" : "string",
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "bankFeed" : {
    "bankName" : "string",
    "remainingDays" : 0,
    "state" : "string"
  },
  "bankName" : "string",
  "bic" : "string",
  "canBeArchived" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "iban" : "string",
  "id" : 0,
  "personal" : true,
  "sortCode" : "string",
  "sortCodeAndAccountNumberEditable" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
}

Get all bank accounts for the current user

GET /bank-accounts

Responses

HTTP Code Description Schema
200 All bank accounts for the current user returned < BankAccountDto > array

Tags

  • BankAccountController

Security

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

Example HTTP request

Request path
/bank-accounts

Example HTTP response

Response 200
[ {
  "accountName" : "string",
  "accountNumber" : "string",
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "bankFeed" : {
    "bankName" : "string",
    "remainingDays" : 0,
    "state" : "string"
  },
  "bankName" : "string",
  "bic" : "string",
  "canBeArchived" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "iban" : "string",
  "id" : 0,
  "personal" : true,
  "sortCode" : "string",
  "sortCodeAndAccountNumberEditable" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
} ]

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

GET /bank-accounts/accounts/{isArchived}

Parameters

Type Name Description Schema
Path isArchived
required
isArchived boolean

Responses

HTTP Code Description Schema
200 All active / inactive bank accounts are returned < BankAccountDto > array

Tags

  • BankAccountController

Security

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

Example HTTP request

Request path
/bank-accounts/accounts/true

Example HTTP response

Response 200
[ {
  "accountName" : "string",
  "accountNumber" : "string",
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "bankFeed" : {
    "bankName" : "string",
    "remainingDays" : 0,
    "state" : "string"
  },
  "bankName" : "string",
  "bic" : "string",
  "canBeArchived" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "iban" : "string",
  "id" : 0,
  "personal" : true,
  "sortCode" : "string",
  "sortCodeAndAccountNumberEditable" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
} ]

Make default bank account

PUT /bank-accounts/default/{bankAccountId}

Parameters

Type Name Schema
Path bankAccountId
required
integer (int64)

Responses

HTTP Code Description Schema
200 Bank account is made default No Content
404 Bank account not found No Content

Tags

  • BankAccountController

Security

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

Example HTTP request

Request path
/bank-accounts/default/0

Get opening balances by bank account Ids

POST /bank-accounts/opening-balances

Parameters

Type Name Schema
Body body
optional
OpeningBalancesRequestDto

Responses

HTTP Code Description Schema
200 Returned Opening Balances list OpeningBalancesResponseDto
404 Could not find Opening Balances No Content

Tags

  • BankAccountController

Security

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

Example HTTP request

Request path
/bank-accounts/opening-balances
Request body
{
  "accountIds" : [ 0 ]
}

Example HTTP response

Response 200
{
  "openingBalances" : [ {
    "accountId" : 0,
    "editable" : true,
    "openingBalance" : "string"
  } ]
}

Get bank account by id

GET /bank-accounts/{bankAccountId}

Parameters

Type Name Schema
Path bankAccountId
required
integer (int64)

Responses

HTTP Code Description Schema
200 Bank account is returned BankAccountDto

Tags

  • BankAccountController

Security

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

Example HTTP request

Request path
/bank-accounts/0

Example HTTP response

Response 200
{
  "accountName" : "string",
  "accountNumber" : "string",
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "bankFeed" : {
    "bankName" : "string",
    "remainingDays" : 0,
    "state" : "string"
  },
  "bankName" : "string",
  "bic" : "string",
  "canBeArchived" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "iban" : "string",
  "id" : 0,
  "personal" : true,
  "sortCode" : "string",
  "sortCodeAndAccountNumberEditable" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
}

Update an existing bank account

PUT /bank-accounts/{bankAccountId}

Parameters

Type Name Schema
Path bankAccountId
required
integer (int64)
Body body
optional
BankAccountDto

Responses

HTTP Code Description Schema
200 Bank account is updated BankAccountDto
400 Bank account is not editable No Content
404 Bank account not found and cannot be updated No Content

Tags

  • BankAccountController

Security

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

Example HTTP request

Request path
/bank-accounts/0
Request body
{
  "accountName" : "string",
  "accountNumber" : "string",
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "bankFeed" : {
    "bankName" : "string",
    "remainingDays" : 0,
    "state" : "string"
  },
  "bankName" : "string",
  "bic" : "string",
  "canBeArchived" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "iban" : "string",
  "id" : 0,
  "personal" : true,
  "sortCode" : "string",
  "sortCodeAndAccountNumberEditable" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
}

Example HTTP response

Response 200
{
  "accountName" : "string",
  "accountNumber" : "string",
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "bankFeed" : {
    "bankName" : "string",
    "remainingDays" : 0,
    "state" : "string"
  },
  "bankName" : "string",
  "bic" : "string",
  "canBeArchived" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "doesLastReconciledStatementEntryFallIntoClosedFinancialYear" : true,
  "iban" : "string",
  "id" : 0,
  "personal" : true,
  "sortCode" : "string",
  "sortCodeAndAccountNumberEditable" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
}

Delete a bank account (currently unavailable)

DELETE /bank-accounts/{bankAccountId}

Parameters

Type Name Schema
Path bankAccountId
required
integer (int64)

Responses

HTTP Code Description Schema
200 Bank account is deleted No Content
404 Bank account not found and cannot be deleted No Content

Tags

  • BankAccountController

Security

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

Example HTTP request

Request path
/bank-accounts/0

Get payments for Bank Account

GET /bank-accounts/{id}/payments

Description

The default sorting criteria is date,asc.

Parameters

Type Name Description Schema Default
Path bankAccountId
required
integer (int64)
Query page
optional
The index of the page to retrieve, based at 0. integer (int32)
Query reconciled
required
boolean
Query size
optional
Number of records returned per page. Maximum value allowed is 200. integer (int32) 20
Query sort
optional
Sorting criteria by a given field. < string (<field>[,asc|desc]) > array(multi)

Responses

HTTP Code Description Schema
200 success PagePaymentDto

Produces

  • application/json

Tags

  • BankAccountController

Security

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

Example HTTP request

Request path
/bank-accounts/{id}/payments?reconciled=true

Example HTTP response

Response 200
{
  "content" : [ {
    "amount" : 0.0,
    "amountType" : "string",
    "date" : "string",
    "description" : "string",
    "id" : 0,
    "paymentName" : "string",
    "paymentType" : "string",
    "reference" : "string",
    "statementEntryId" : 0,
    "unmatchable" : true
  } ],
  "empty" : true,
  "first" : true,
  "last" : true,
  "number" : 0,
  "numberOfElements" : 0,
  "pageable" : {
    "offset" : 0,
    "pageNumber" : 0,
    "pageSize" : 0,
    "paged" : true,
    "sort" : {
      "empty" : true,
      "sorted" : true,
      "unsorted" : true
    },
    "unpaged" : true
  },
  "size" : 0,
  "sort" : {
    "empty" : true,
    "sorted" : true,
    "unsorted" : true
  },
  "totalElements" : 0,
  "totalPages" : 0
}

Create a new credit card

POST /credit-cards

Parameters

Type Name Schema
Body body
optional
CreditCardDto

Responses

HTTP Code Description Schema
200 successful operation CreditCardDto
201 Credit card created No Content
400 Credit card details not valid No Content

Tags

  • CreditCardController

Security

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

Example HTTP request

Request path
/credit-cards
Request body
{
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "canBeArchived" : true,
  "cardNumber" : "string",
  "cardNumberEditable" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "id" : 0,
  "personal" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
}

Example HTTP response

Response 200
{
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "canBeArchived" : true,
  "cardNumber" : "string",
  "cardNumberEditable" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "id" : 0,
  "personal" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
}

Get all active credit cards for the current user

GET /credit-cards/cards/false

Responses

HTTP Code Description Schema
200 All active credit card for the current user returned < CreditCardDto > array

Tags

  • CreditCardController

Security

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

Example HTTP request

Request path
/credit-cards/cards/false

Example HTTP response

Response 200
[ {
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "canBeArchived" : true,
  "cardNumber" : "string",
  "cardNumberEditable" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "id" : 0,
  "personal" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
} ]

Make default credit card

PUT /credit-cards/default/{creditCardId}

Parameters

Type Name Schema
Path creditCardId
required
integer (int64)

Responses

HTTP Code Description Schema
200 Credit card is made default No Content
404 Credit card not found No Content

Tags

  • CreditCardController

Security

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

Example HTTP request

Request path
/credit-cards/default/0

Get opening balances by credit card Ids

POST /credit-cards/opening-balances

Parameters

Type Name Schema
Body body
optional
OpeningBalancesRequestDto

Responses

HTTP Code Description Schema
200 Returned Opening Balances list OpeningBalancesResponseDto
404 Could not find Opening Balances No Content

Tags

  • CreditCardController

Security

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

Example HTTP request

Request path
/credit-cards/opening-balances
Request body
{
  "accountIds" : [ 0 ]
}

Example HTTP response

Response 200
{
  "openingBalances" : [ {
    "accountId" : 0,
    "editable" : true,
    "openingBalance" : "string"
  } ]
}

Post opening balance for a credit card

POST /credit-cards/postOpeningBalance/{creditCardId}

Parameters

Type Name Description Schema
Path creditCardId
required
integer (int64)
Query accountBalance
required
Opening balance value number

Responses

HTTP Code Description Schema
200 Posted opening balance No Content
404 Could not post opening balance No Content

Tags

  • CreditCardController

Security

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

Example HTTP request

Request path
/credit-cards/postOpeningBalance/0?accountBalance=34500.14

Update opening balance for a credit card account

PUT /credit-cards/updateOpeningBalance/{creditCardId}

Parameters

Type Name Description Schema
Path creditCardId
required
integer (int64)
Query accountBalance
required
Opening balance value number

Responses

HTTP Code Description Schema
200 Updated opening balance No Content
404 Could not update opening balance No Content

Tags

  • CreditCardController

Security

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

Example HTTP request

Request path
/credit-cards/updateOpeningBalance/0?accountBalance=34500.14

Get credit card by id

GET /credit-cards/{creditCardId}

Parameters

Type Name Schema
Path creditCardId
required
integer (int64)

Responses

HTTP Code Description Schema
200 Credit card is returned CreditCardDto

Tags

  • CreditCardController

Security

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

Example HTTP request

Request path
/credit-cards/0

Example HTTP response

Response 200
{
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "canBeArchived" : true,
  "cardNumber" : "string",
  "cardNumberEditable" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "id" : 0,
  "personal" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
}

Update an existing credit card

PUT /credit-cards/{creditCardId}

Parameters

Type Name Schema
Path creditCardId
required
integer (int64)
Body body
optional
CreditCardDto

Responses

HTTP Code Description Schema
200 Credit card is updated CreditCardDto
404 Credit card not found and cannot be updated No Content

Tags

  • CreditCardController

Security

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

Example HTTP request

Request path
/credit-cards/0
Request body
{
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "canBeArchived" : true,
  "cardNumber" : "string",
  "cardNumberEditable" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "id" : 0,
  "personal" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
}

Example HTTP response

Response 200
{
  "archived" : true,
  "balanceDto" : {
    "balance" : 0.0,
    "date" : "string"
  },
  "canBeArchived" : true,
  "cardNumber" : "string",
  "cardNumberEditable" : true,
  "default" : true,
  "deletable" : true,
  "displayName" : "string",
  "id" : 0,
  "personal" : true,
  "unmatchedEntriesAmount" : 0,
  "unreconciledCrunchPaymentsAmount" : 0
}

Get opening balance for a Credit Card

GET /credit-cards/{creditCardId}/openingBalance

Parameters

Type Name Schema
Path creditCardId
required
integer (int64)

Responses

HTTP Code Description Schema
200 Opening balance received OpeningBalanceDto
404 Opening balance not found No Content

Tags

  • CreditCardController

Security

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

Example HTTP request

Request path
/credit-cards/0/openingBalance

Example HTTP response

Response 200
{
  "accountId" : 0,
  "editable" : true,
  "openingBalance" : "string"
}

Definitions

BalanceDto

Name Description Schema
balance
optional
Example : 0.0 number
date
optional
Example : "string" string (date)

BankAccountDto

Name Description Schema
accountName
optional
Length : 0 - 255
Example : "string"
string
accountNumber
optional
Length : 0 - 10
Example : "string"
string
archived
optional
Example : true boolean
balanceDto
optional
Example : "[balancedto](#balancedto)" BalanceDto
bankFeed
optional
Example : "[bankfeeddto](#bankfeeddto)" BankFeedDto
bankName
optional
Length : 0 - 50
Example : "string"
string
bic
optional
Length : 0 - 11
Example : "string"
string
canBeArchived
optional
Example : true boolean
default
optional
Example : true boolean
deletable
optional
Example : true boolean
displayName
optional
Example : "string" string
doesLastReconciledStatementEntryFallIntoClosedFinancialYear
optional
Example : true boolean
iban
optional
Length : 0 - 34
Example : "string"
string
id
optional
Example : 0 integer (int64)
personal
optional
Example : true boolean
sortCode
optional
Length : 0 - 6
Example : "string"
string
sortCodeAndAccountNumberEditable
optional
Example : true boolean
unmatchedEntriesAmount
optional
Example : 0 integer (int32)
unreconciledCrunchPaymentsAmount
optional
Example : 0 integer (int32)

BankFeedDto

Name Description Schema
bankName
optional
Example : "string" string
remainingDays
optional
Example : 0 integer (int64)
state
optional
Example : "string" enum (available, pending, active, inactive, unavailable)

CreditCardDto

Name Description Schema
archived
optional
Example : true boolean
balanceDto
optional
Example : "[balancedto](#balancedto)" BalanceDto
canBeArchived
optional
Example : true boolean
cardNumber
optional
Example : "string" string
cardNumberEditable
optional
Example : true boolean
default
optional
Example : true boolean
deletable
optional
Example : true boolean
displayName
optional
Example : "string" string
id
optional
Example : 0 integer (int64)
personal
optional
Example : true boolean
unmatchedEntriesAmount
optional
Example : 0 integer (int32)
unreconciledCrunchPaymentsAmount
optional
Example : 0 integer (int32)

OpeningBalanceDto

Name Description Schema
accountId
optional
Example : 0 integer (int64)
editable
optional
Example : true boolean
openingBalance
optional
Example : "string" string

OpeningBalancesRequestDto

Name Description Schema
accountIds
optional
Example : [ 0 ] < integer (int64) > array

OpeningBalancesResponseDto

Name Description Schema
openingBalances
optional
Example : [ "[openingbalancedto](#openingbalancedto)" ] < OpeningBalanceDto > array

PagePaymentDto

Name Description Schema
content
optional
Example : [ "[paymentdto](#paymentdto)" ] < PaymentDto > array
empty
optional
Example : true boolean
first
optional
Example : true boolean
last
optional
Example : true boolean
number
optional
Example : 0 integer (int32)
numberOfElements
optional
Example : 0 integer (int32)
pageable
optional
Example : "[pageable](#pageable)" Pageable
size
optional
Example : 0 integer (int32)
sort
optional
Example : "[sort](#sort)" Sort
totalElements
optional
Example : 0 integer (int64)
totalPages
optional
Example : 0 integer (int32)

Pageable

Name Description Schema
offset
optional
Example : 0 integer (int64)
pageNumber
optional
Example : 0 integer (int32)
pageSize
optional
Example : 0 integer (int32)
paged
optional
Example : true boolean
sort
optional
Example : "[sort](#sort)" Sort
unpaged
optional
Example : true boolean

PaymentDto

Name Description Schema
amount
optional
Example : 0.0 number
amountType
optional
Example : "string" enum (DEBIT, CREDIT)
date
optional
Example : "string" string (date)
description
optional
Example : "string" string
id
optional
Example : 0 integer (int64)
paymentName
optional
Example : "string" string
paymentType
optional
Example : "string" 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)
reference
optional
Example : "string" string
statementEntryId
optional
Example : 0 integer (int64)
unmatchable
optional
Example : true boolean

Sort

Name Description Schema
empty
optional
Example : true boolean
sorted
optional
Example : true boolean
unsorted
optional
Example : true boolean