This s a documentation page for our shiny new REST API - you weren't meant to find it. This API isn't ready for public use yet. We're chopping and changing it a LOT as we grow it. So if you build something that uses it then it's very likely to break in a future update. Don't say you weren't warned!
URL: | https://api.kashflow.com/v2/bankaccounts/{accountId}/transactions |
Method(s): | get,post,put,delete |
Response Formats: | JSON, XML |
Description: | These methods allow to retrieve the list of transactions, create a new transaction, update an existing transaction and delete transaction. |
Parameters
Name | Type | Description |
---|---|---|
AccountId | Numeric | Unique bank account identifier |
BFSTransactionId | Numeric | Bank Feeds transaction Id |
Comment | String | |
CustomerCode | String | Customer Code if it is an invoice payment |
CustomerId | Numeric | Customer Id if it is an invoice payment |
Id | Numeric | Id of the transaction |
PaidIn | Numeric | Money paid in |
MoneyOut | Numeric | Money paid out |
ProjectId | Numeric | Unique Project Identifier |
Reconciled | Numeric | Whether this transaction is reconciled or not |
ReconciledId | String | Reconciliation Id |
ResourceNumber | Numeric | Number of Invoice/Purchase as applicable |
SupplierCode | Numeric | Supplier Code if it is purchase payment |
Date | Date | Date of transaction |
TransactionNumber | Numeric | User specific unique Number of Transaction |
VATAble | Boolean | Whether vat is exempted or not for a transaction |
VATAmount | Numeric | Total amount of VAT in the transaction |
VATPaid | Numeric | Amount of VAT paid till now |
VATRate | Numeric | VAT rate for line item. For PUT and POST request, It cannot be specified in case of VATAble property as true. This field is readonly. |
VATReturnId | Numeric | VAT return Id if VAT return is filed already |
TransactionType | Numeric | Specifies the type of Transaction 0 1 2 3 4 5 6 |
GET Operation
GET of transactions returns list of bank transaction for a given bank account.URL: /bankaccounts/{accountId}/transactions?startDate={startDate}&endDate={endDate}&page={page}&
perpage={perpage}&sortcolumn={sortcolumn}&order={order}&filterby={filterby}&includeBulk={true/false}&searchtext={searchText}
A paginated list of bank transactions is returned (ordered by TransactionDate in descending order).
If startDate and endDate are not specified then, bank transactions for previous month will be fetched by default.
If page and page size are not specified then, first page with 10 bank transactions will be displayed (like invoices).
Example response for GET of bank transaction list
{
"Data":[
{
"AccountId":18,
"BFSTransactionId":null,
"Comment":"INV #45374: ",
"CustomerCode":"000001",
"CustomerId":16210401,
"Date":null,
"EditLink":"\/#invoices\/45374",
"Id":36948882,
"MoneyType":null,
"PaidIn":20700.0000,
"PaidOut":0.0000,
"Payee":null,
"PaymentType":0,
"ProjectId":null,
"Reconciled":true,
"ReconciledId":246,
"ResourceNumber":45374,
"SupplierCode":"",
"SupplierId":null,
"TransactionDate":"2013-01-09 12:00:00",
"TransactionNumber":null,
"TransactionType":1,
"Type":"Sale - 000001",
"VATAble":true,
"VATAmount":4140.0000,
"VATPaid":4140.0000,
"VATRate":20.0000,
"VATReturnId":null
},
{
"AccountId":18,
"BFSTransactionId":null,
"Comment":"KF00044: ",
"CustomerCode":"",
"CustomerId":null,
"Date":null,
"EditLink":"\/#purchases\/44",
"Id":22189152,
"MoneyType":null,
"PaidIn":0.0000,
"PaidOut":6480.0000,
"Payee":null,
"PaymentType":0,
"ProjectId":null,
"Reconciled":false,
"ReconciledId":0,
"ResourceNumber":44,
"SupplierCode":"ASDA0",
"SupplierId":3048713,
"TransactionDate":"2013-01-11 12:00:00",
"TransactionNumber":null,
"TransactionType":2,
"Type":"Purchase - ASDA0",
"VATAble":true,
"VATAmount":1296.0000,
"VATPaid":1296.0000,
"VATRate":20.0000,
"VATReturnId":null
}
],
"MetaData":{
"FirstPageUrl":"https:\/\/api.kashflow.com\/v2\/bankaccounts\/18\/transactions?startDate=20130101&endDate=20130131&page=1&sortcolumn=Date&order=Asc&filterby=All&includeBulk=True&includeJournals=True&includeMoneyTypeBankTransactions=True",
"LastPageUrl":"https:\/\/api.kashflow.com\/v2\/bankaccounts\/18\/transactions?startDate=20130101&endDate=20130131&page=1&sortcolumn=Date&order=Asc&filterby=All&includeBulk=True&includeJournals=True&includeMoneyTypeBankTransactions=True",
"NextPageUrl":null,
"OpeningBalance":-100.3700,
"PreviousPageUrl":null,
"TotalRecords":8,
"ClosingBalance": 29112.5200
}
}
Request Parameters
Name | Description |
---|---|
accountId | Unique identifier of bank account |
startDate | start date in YYYYMMDD format (optional) |
endDate | end date in YYYYMMDD format (optional) |
accountId | Unique identifier of bank account |
page | The page number (optional) |
perpage | Number of records to be fetched (optional) |
sortby | Name of the column on which sorting needs to be applied. The acceptable values for this parameter are: 1. Date 2. PaidIn 3. PaidOut 4. TransactionTypeThis parameter is optional. Default is Date |
order | Sort direction can be either Asc for ascending or Desc for descending. Default is Desc. (optional) |
filterby | The list can be filtered by transactions frequency type. Set this parameter to “All” or empty or exclude from the URL if all transactions are to be retrieved. The acceptable values for this parameter are: 1. All 2. Unallocated 3. Invoice 4. Purchase Default is All |
includeBulk | Default is true. Pass false when you don’t want bulk Invoice/Purchase payments to be included in results |
searchText | search keywords |
includeFeedMatched | Default is true. Pass false when you don’t want all transaction for which BankFeeds have already been matched |
includeJournals | Default is true. Pass false when you don’t want banktransaction done from Journals |
includeNominalCodeBankTransactions | Default is true. Pass false when you don’t want bank transactions done from other bank accounts. |
To GET a particular bank transaction with all details –
URL : /bankaccounts/{accountId}/transactions/{transactionId}
Example response for GET of bank transaction
{
"AccountId":18,
"Comment":"Advance payment recieved from Supplier",
"CustomerCode":"",
"Date":"2014-08-21 12:00:00",
"EditLink":"",
"Id":31417163,
"MoneyType":2100,
"PaidIn":0.0000,
"PaidOut":44.3300,
"PaymentType":0,
"ProjectNumber":0,
"Reconciled":true,
"ReconciledId":34,
"SupplierCode":"KLAY01",
"TransactionNumber":34,
"TransactionType":-1,
"Type":"",
"VATAble":true,
"VATAmount":7.3900,
"VATPaid":0.0000,
"VATRate":20.0000,
"VATReturnId":0
}
POST Operation
Creates a new bank transaction record with the given data using following URL –URL: /bankaccounts/{accountId}/transactions
{accountId} in the URL will be replaced by bank account for which transaction is to be created.
Newly created bank transaction is returned in response.
Example request for POST of bank transaction
{
"AccountId": 18,
"Comment": "Update Test",
"CustomerCode": "",
"Date": "2014-10-16 12:00:00",
"Id": 31417166,
"MoneyType": 2100,
"PaidIn": 0.0000,
"PaidOut": 10.0000,
"ProjectNumber": 0,
"SupplierCode": "ASDA0",
"TransactionType": -1,
"VATAble": true,
"VATAmount": 2.0000,
"VATPaid": 1.0000,
"VATRate": 3.0000,
"VATReturnId": 1
}
Response : 201 Created with newly created bank transaction
Example response for POST of bank transaction
{
"Id":17622,
"AccountId": 18,
"Comment": "Update Test",
"CustomerCode": "",
"Date": "2014-10-16 12:00:00",
"Id": 31417166,
"MoneyType": 2100,
"PaidIn": 0.0000,
"PaidOut": 10.0000,
"ProjectNumber": 0,
"SupplierCode": "ASDA0",
"TransactionType": -1,
"VATAble": true,
"VATAmount": 2.0000,
"VATPaid": 1.0000,
"VATRate": 3.0000,
"VATReturnId": 1
}
PUT Operation
Updates bank transaction record specified with the given data using following URL –URL: /bankaccounts/{accountId}/transactions/{transactionid}
{accountId} in the URL will be replaced by bank account for which transaction is to be created.
Newly created bank transaction is returned in response.
{transactionid} in the url will be replaced by transaction id to be updated
Example request for PUT of bank transaction
{
"Id" : 18927,
"AccountId": 18,
"Comment": "Update Test",
"CustomerCode": "",
"Date": "2014-10-16 12:00:00",
"Id": 31417166,
"MoneyType": 2100,
"PaidIn": 0.0000,
"PaidOut": 10.0000,
"ProjectNumber": 0,
"SupplierCode": "ASDA0",
"TransactionType": -1,
"VATAble": true,
"VATAmount": 2.0000,
"VATPaid": 1.0000,
"VATRate": 3.0000,
"VATReturnId": 1
}
Response : 200 OK with updated bank transaction
Example response for PUT of bank transaction
{
"Id" : 18927,
"AccountId": 18,
"Comment": "Update Test",
"CustomerCode": "",
"Date": "2014-10-16 12:00:00",
"Id": 31417166,
"MoneyType": 2100,
"PaidIn": 0.0000,
"PaidOut": 10.0000,
"ProjectNumber": 0,
"SupplierCode": "ASDA0",
"TransactionType": -1,
"VATAble": true,
"VATAmount": 2.0000,
"VATPaid": 1.0000,
"VATRate": 3.0000,
"VATReturnId": 1
}
DELETE Operation
Deletes a specific transaction of a bank account using following URL –URL: /bankaccounts/{accountId}/transactions/{transactionid}
{accountId} in the URL will be replaced by bank account for which transaction is to be deleted.
{transactionid} in the url will be replaced by transaction id to be deleted.
Rest Api returns 204 as in http response code if deletion is succeeded.