new ExpensesAPI(rest)
This class is used to interact with Expenses in TidyHQ.
Parameters:
Name | Type | Description |
---|---|---|
rest | Rest | The rest instance to use for requests. |
- Source
Methods
(async) addPayment(expenseID, optionsopt) → {Promise.<TidyAPI_V1_Payment>}
This function is used to add a payment to an expense.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
expenseID | string | The ID of the expense. | |||||||||||||||||||||
options | object | <optional> | The options to create the payment with. At least one option is required that isn't the access_token.Properties
|
- Source
Returns:
- The newly created payment.
- Type:
- Promise.<TidyAPI_V1_Payment>
(async) createExpense(expense, optionsopt) → {Promise.<TidyAPI_V1_Expense>}
Create a new expense in TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
expense | Tidy_V1_ExpenseParams | The expense to create. | ||||||||||
options | object | <optional> | {} | The options to create the expense with.Properties
|
- Source
Returns:
- The newly created expense.
- Type:
- Promise.<TidyAPI_V1_Expense>
(async) deleteExpense(expenseID, optionsopt) → {Promise.<TidyAPI_Response>}
Delete an expense.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
expenseID | string | The ID of the expense. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- Success or failure.
- Type:
- Promise.<TidyAPI_Response>
(async) getExpense(expenseID, optionsopt) → {Promise.<TidyAPI_V1_Expense>}
Get a single expense from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
expenseID | string | The ID of the expense to get | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An Expense object.
- Type:
- Promise.<TidyAPI_V1_Expense>
(async) getExpenses(optionsopt) → {Promise.<TidyAPI_V1_Expenses>}
Get a list of expenses from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An array of expenses.
- Type:
- Promise.<TidyAPI_V1_Expenses>