DepositsAPI

new DepositsAPI(rest)

This class is used to interact with Deposits in TidyHQ.
Parameters:
NameTypeDescription
restRestThe rest instance to use for requests.

Methods

(async) createDeposit(deposit, optionsopt) → {Promise.<TidyAPI_V1_Deposit>}

Create a new deposit in TidyHQ.
Parameters:
NameTypeAttributesDefaultDescription
depositTidy_V1_DepositParamsThe deposit to create.
optionsobject<optional>
{}The options to create the deposit with.
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The newly created deposit.
Type: 
Promise.<TidyAPI_V1_Deposit>

(async) getDeposit(depositID, optionsopt) → {Promise.<TidyAPI_V1_Deposit>}

Get a single deposit from TidyHQ.
Parameters:
NameTypeAttributesDefaultDescription
depositIDstringThe ID of the deposit to get
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- An deposit object.
Type: 
Promise.<TidyAPI_V1_Deposit>

(async) getDeposits(optionsopt) → {Promise.<TidyAPI_V1_Deposits>}

Get a list of deposits from TidyHQ.
Parameters:
NameTypeAttributesDefaultDescription
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
limitnumber<optional>
The maximum number of deposits to return.
offsetnumber<optional>
The number of deposits to skip.
status"activated" | "cancelled" | "all"<optional>
The status of the deposit.
updated_sincestring<optional>
The timestamp of the last update in ISO 8601 format.
Returns:
- An array of deposits.
Type: 
Promise.<TidyAPI_V1_Deposits>