new InvoicesAPI(rest)
This class is used to interact with Invoices in TidyHQ.
Parameters:
Name | Type | Description |
---|---|---|
rest | Rest | The rest instance to use for requests. |
- Source
Methods
(async) addPayment(invoiceID, optionsopt) → {Promise.<TidyAPI_V1_Payment>}
This function is used to add a payment to an invoice.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
invoiceID | string | The ID of the invoice. | |||||||||||||||||||||
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) createInvoice(invoice, optionsopt) → {Promise.<TidyAPI_V1_Invoice>}
Create a new invoice.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
invoice | Tidy_V1_InvoiceParams | The invoice to create. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The newly created invoice.
- Type:
- Promise.<TidyAPI_V1_Invoice>
(async) deleteInvoice(invoiceID, optionsopt) → {Promise.<TidyAPI_Response>}
Delete an invoice.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
invoiceID | string | The ID of the invoice. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- Success or failure.
- Type:
- Promise.<TidyAPI_Response>
(async) getInvoice(invoiceID, optionsopt) → {Promise.<TidyAPI_V1_Invoice>}
Get a single invoice from TidyHQ.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
invoiceID | string | The ID of the invoice to get | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- An invoice.
- Type:
- Promise.<TidyAPI_V1_Invoice>
(async) getInvoices(optionsopt) → {Promise.<TidyAPI_V1_Invoices>}
Get a list of invoices from TidyHQ.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | Properties
|
- Source
Returns:
- An array of invoices.
- Type:
- Promise.<TidyAPI_V1_Invoices>