Class Taxes


public class Taxes extends AccountingResource
FreshBooks taxes resource with calls to get, list, create, update, delete
  • Constructor Details

  • Method Details

    • getPath

      protected String getPath()
      Specified by:
      getPath in class AccountingResource
    • list

      public TaxList list(String accountId) throws FreshBooksException
      Get a list of taxes using the query strings generated by the QueryBuilder list.
      Parameters:
      accountId - Id of the account
      Returns:
      TaxList containing taxes and pagination details
      Throws:
      FreshBooksException - If the call is not successful
    • list

      public TaxList list(String accountId, List<QueryBuilder> builders) throws FreshBooksException
      Get a list of taxes using the query strings generated by the QueryBuilder list.
      Parameters:
      accountId - Id of the account
      builders - List of QueryBuilders
      Returns:
      TaxList containing taxes and pagination details
      Throws:
      FreshBooksException - If the call is not successful
    • get

      public Tax get(String accountId, long taxId) throws FreshBooksException
      Get a single tax with the corresponding id.
      Parameters:
      accountId - The alpha-numeric account id
      taxId - Id of the resource to return
      Returns:
      The Tax
      Throws:
      FreshBooksException - If the call is not successful
    • get

      public Tax get(String accountId, long taxId, IncludesQueryBuilder builder) throws FreshBooksException
      Get a single tax with the corresponding id.
      Parameters:
      accountId - The alpha-numeric account id
      taxId - Id of the resource to return
      builder - IncludesQueryBuilder object for including additional data, sub-resources, etc.
      Returns:
      The Tax
      Throws:
      FreshBooksException - If the call is not successful
    • create

      public Tax create(String accountId, Tax data) throws FreshBooksException
      Create a new tax from the provided Tax model. Makes a POST call against the tax resource endpoint. This calls `tax.getContent()` to get a hash map of data.
      Parameters:
      accountId - The alpha-numeric account id
      data - Tax model with create data
      Returns:
      The created Tax
      Throws:
      FreshBooksException - If the call is not successful
    • create

      public Tax create(String accountId, Map<String,Object> data) throws FreshBooksException
      Create a new tax from the provided data. Makes a POST call against the tax resource endpoint.
      Parameters:
      accountId - The alpha-numeric account id
      data - Map of create data
      Returns:
      The created Tax
      Throws:
      FreshBooksException - If the call is not successful
    • update

      public Tax update(String accountId, long taxId, Tax data) throws FreshBooksException
      Update the tax with the corresponding id. Makes a PUT call against the tax resource endpoint.
      Parameters:
      accountId - The alpha-numeric account id
      taxId - Id of the resource to return
      data - Tax model with updated data
      Returns:
      The updated Tax
      Throws:
      FreshBooksException - If the call is not successful
    • update

      public Tax update(String accountId, long taxId, Map<String,Object> data) throws FreshBooksException
      Update the tax with the corresponding id. Makes a PUT call against the tax resource endpoint.
      Parameters:
      accountId - The alpha-numeric account id
      taxId - Id of the resource to update
      data - Map of data to change
      Returns:
      The updated Tax
      Throws:
      FreshBooksException - If the call is not successful
    • delete

      public void delete(String accountId, long taxId) throws FreshBooksException
      Delete the tax with the corresponding id.

      Note: Most FreshBooks resources are soft-deleted,
      Parameters:
      accountId - The alpha-numeric account id
      taxId - Id of the resource to update
      Throws:
      FreshBooksException - If the call is not successful
      See Also: