public class TransactionCall extends AbstractCall<TransactionDataType> implements BulkProcessable<TransactionDataType>
Constructor and Description |
---|
TransactionCall(ClearCheckBookConnection connection) |
Modifier and Type | Method and Description |
---|---|
List<String> |
bulkProcess(List<TransactionDataType> dataTypeList)
Helper wrapper function to iterate over a list of items to
insert/edit/delete calling the relevant method on each.
|
boolean |
delete(ParsedNameValuePair input)
Delete a specific transaction for the current user.
|
boolean |
edit(TransactionDataType input)
Edit a specific transaction for the current user.
|
boolean |
editJive(ParsedNameValuePair id,
boolean jiveStatus)
Jive or Un-jive a specific transaction for the current user.
|
TransactionDataType |
get(ParsedNameValuePair id)
Returns information about a specific transaction.
|
List<TransactionDataType> |
getAll()
Returns an array of transactions for the current user
Method: get Call: transactions |
List<TransactionDataType> |
getAll(AccountDataType account) |
List<TransactionDataType> |
getAll(int page,
int limit) |
List<TransactionDataType> |
getAll(long accountId) |
List<TransactionDataType> |
getAll(long accountId,
int page,
int limit) |
protected String |
getUrlSuffix() |
String |
insert(TransactionDataType input)
Inserts a transaction for the current user
Method: post Call: transaction |
String |
process(TransactionDataType dataType)
|
get, getAll, getConnection, getPluralUrl
public static final String TYPE
public TransactionCall(ClearCheckBookConnection connection)
public List<String> bulkProcess(List<TransactionDataType> dataTypeList) throws ClearcheckbookException
AbstractCall
bulkProcess
in interface BulkProcessable<TransactionDataType>
bulkProcess
in class AbstractCall<TransactionDataType>
List
<String
>ClearcheckbookException
public String process(TransactionDataType dataType) throws ClearcheckbookException
BulkProcessable
process
in interface BulkProcessable<TransactionDataType>
process
in class AbstractCall<TransactionDataType>
ClearcheckbookException
protected String getUrlSuffix()
getUrlSuffix
in class AbstractCall<TransactionDataType>
public List<TransactionDataType> getAll() throws ClearcheckbookException
Example:
https://username:password@www.clearcheckbook.com/api/transactions/
Parameters:
Parameter Required Description
account_id Optional Get transactions for a specific account
page Optional integer used for limiting the number of transactions. Used
in conjunction with limit. (eg: page=2, limit=10)
limit Optional The number of transactions you want to receive. Must be
used with the page variable.
Returned Values:
Value Description
id The id of the transaction
date The date for the transaction (formatted as yyyy-mm-dd)
amount Float value for the amount of the transaction.
transaction_type Whether this transaction is a deposit or withdrawal
(0=withdrawal, 1=deposit)
description The description for this transaction
account_id The account associated with this transaction. 0 = No account
category_id The category associated with this transaction. 0 = No
category
jive Whether or not this transaction is jived (0= Not jived, 1= Jived)
specialstatus Text that is empty or says Transfer or Split
parent If this is a split from a split transaction, this is the id of the
parent transaction
related_transfer A unique integer corresponding to its related transfer.
check_num Text from the check number field
memo Text from the memo field
payee Text from the payee field
initial_balance Boolean for whether or not this was set up as an initial
balance for an account
getAll
in class AbstractCall<TransactionDataType>
ClearcheckbookException
public List<TransactionDataType> getAll(long accountId) throws ClearcheckbookException
ClearcheckbookException
public List<TransactionDataType> getAll(AccountDataType account) throws ClearcheckbookException
account
- ClearcheckbookException
public List<TransactionDataType> getAll(long accountId, int page, int limit) throws ClearcheckbookException
ClearcheckbookException
public List<TransactionDataType> getAll(int page, int limit) throws ClearcheckbookException
ClearcheckbookException
public TransactionDataType get(ParsedNameValuePair id) throws ClearcheckbookException
Example:
https://username:password@www.clearcheckbook.com/api/transaction/
Parameters:
Parameter Required Description
id Required The id of the transaction you want
Returned Values:
Value Description
id The id of the transaction
date The date for the transaction (formatted as yyyy-mm-dd)
amount Float value for the amount of the transaction.
transaction_type Whether this transaction is a deposit or withdrawal
(0=withdrawal, 1=deposit)
description The description for this transaction
account_id The account associated with this transaction. 0 = No account
category_id The category associated with this transaction. 0 = No
category
jive Whether or not this transaction is jived (0= Not jived, 1= Jived)
specialstatus Text that is empty or says Transfer or Split
parent If this is a split from a split transaction, this is the id of the
parent transaction
related_transfer A unique integer corresponding to its related transfer.
check_num Text from the check number field
memo Text from the memo field
payee Text from the payee field
initial_balance Boolean for whether or not this was set up as an initial
balance for an account
get
in class AbstractCall<TransactionDataType>
ClearcheckbookException
public String insert(TransactionDataType input) throws ClearcheckbookException
Example:
https://username:password@www.clearcheckbook.com/api/transaction/
Parameters:
Parameter Required Description
date Required The date for the transaction (Formatted as yyyy-mm-dd)
amount Required Float value formatted as (xxxx.xx)
transaction_type Required Whether the transaction is a deposit or
withdrawal (0= Withdrawal, 1= Deposit, 3= Transfer)
account_id Required* The id of the account for this transaction (0 if no
account). * Not required if transaction_type=3
category_id Required The id of the category for this transaction (0 if no
category)
description Required Text for the description of this transaction
jive Optional If the transaction being added should be marked as jived.
(0= un-jived, 1= jived)
from_account_id Optional If this transaction is a transfer, this is the
id of the account you're transferring from.
to_account_id Optional If this transaction is a transfer, this is the id
of the account you're transferring to.
check_num Optional If the user has a premium membership and has the
check_num field enabled, the system will accept a check number
memo Optional If the user has a premium membership and has the memo field
enabled, the system will accept a memo
payee Optional If the user has a premium membership and has the payee
field enabled, the system will accept a payee
Returned Values:
Value Description
Multiple Responses* Returns the id of the newly created transaction, true
(if the transaction is a transfer) or false/null on fail.
insert
in class AbstractCall<TransactionDataType>
IOException
ClearcheckbookException
public boolean edit(TransactionDataType input) throws ClearcheckbookException
Example:
https://username:password@www.clearcheckbook.com/api/transaction/
Parameters:
Parameter Required Description
id Required The id of the transaction being edited
date Required The date for the transaction (Formatted as yyyy-mm-dd)
amount Required Float value formatted as (xxxx.xx)
transaction_type Required Whether the transaction is a deposit or
withdrawal (0= Withdrawal, 1= Deposit)
account_id Required The id of the account for this transaction (0 if no
account)
category_id Required The id of the category for this transaction (0 if no
category)
description Required Text for the description of this transaction
jive Optional Optional value to set whether or not the transaction is
jived (0= Un-jived, 1= Jived). If you just want to jive a transaction,
use editJive() instead.
check_num Optional If the user has a premium membership and has the
check_num field enabled, the system will accept a check number
memo Optional If the user has a premium membership and has the memo field
enabled, the system will accept a memo
payee Optional If the user has a premium membership and has the payee
field enabled, the system will accept a payee
Returned Values:
Value Description
true / false Returns true on a successful edit or false/null on fail.
edit
in class AbstractCall<TransactionDataType>
ClearcheckbookException
public boolean delete(ParsedNameValuePair input) throws ClearcheckbookException
Example:
https://username:password@www.clearcheckbook.com/api/transaction/
Parameters:
Parameter Required Description
id Required The id of the transaction to delete
Returned Values:
Value Description
true / false Returns true on a successful delete or false/null on fail
delete
in class AbstractCall<TransactionDataType>
IOException
ClearcheckbookException
public boolean editJive(ParsedNameValuePair id, boolean jiveStatus) throws ClearcheckbookException
Example:
https://username:password@www.clearcheckbook.com/api/jive/
Parameters:
Parameter Required Description
id Required The id of the transaction being updated
status Required The status of the jive (0= Un-jived, 1= Jived)
Returned Values:
Value Description
true / false Returns true on a successful jive update or false/null on
fail
input
- ClearcheckbookException
Copyright © 2014 Leonard UK Ltd. All rights reserved.