Interface InvoicesApi

All Superinterfaces:
Api.Create<Invoice>, Api.Delete<Invoice>, Api.Get<Invoice>, Api.Simple<Invoice>
All Known Implementing Classes:
InvoicesApiImpl

public interface InvoicesApi extends Api.Simple<Invoice>
See Also:
  • Method Details

    • list

      List<Invoice> list(InvoiceFilter filter)
      Return a list of invoices, sorted by issue date, newest first. Use the filter object to filter the list.
      Parameters:
      filter - filtering options
      Returns:
      a (filtered) list of Invoices
    • list

      Pagination<Invoice> list(InvoiceFilter filter, int page, int perPage)
      Return a list of invoices, sorted by issue date, newest first. Use the filter object to filter the list. Page and perPage allow controlling how many results to return.
      Parameters:
      filter - filtering options
      page - the page number
      perPage - how many results to return for one page. Max 100
      Returns:
      a (filtered) list of Invoices
    • get

      Invoice get(Reference<Invoice> invoiceReference)
      Specified by:
      get in interface Api.Get<Invoice>
      Parameters:
      invoiceReference - a reference to an existing Invoice
      Returns:
      Return a full Invoice object
    • create

      Invoice create(Invoice invoiceCreationInfo)
      Create a new Invoice according to given creation information.
      Specified by:
      create in interface Api.Create<Invoice>
      Parameters:
      invoiceCreationInfo - the creation options
      Returns:
      the newly created Invoice
    • createFrom

      Invoice createFrom(InvoiceImportInfo invoiceCreationInfo)
      Create a new Invoice based on time tracked and expense.
      Parameters:
      invoiceCreationInfo - the creation options
      Returns:
      the newly created Invoice
    • addLineItem

      Invoice addLineItem(Reference<Invoice> invoiceReference, InvoiceItem creationInfo)
      Create a new invoice line item and add it to the given invoice
      Parameters:
      invoiceReference - the invoice to add the item to
      creationInfo - the line item to be created
      Returns:
      the updated Invoice
    • updateLineItem

      Invoice updateLineItem(Reference<Invoice> invoiceReference, Reference<InvoiceItem> invoiceItemReference, InvoiceItemUpdateInfo updateInfo)
      Update an existing line item
      Parameters:
      invoiceReference - the invoice that contains the item
      updateInfo - the line item to be updated
      invoiceItemReference - the line item to be deleted
      Returns:
      the updated Invoice
    • deleteLineItem

      Invoice deleteLineItem(Reference<Invoice> invoiceReference, Reference<InvoiceItem> invoiceItemReference)
      Delete an existing line item
      Parameters:
      invoiceReference - the invoice that contains the item
      invoiceItemReference - the line item to be deleted
      Returns:
      the updated Invoice
    • addLineItems

      Invoice addLineItems(Reference<Invoice> invoiceReference, List<InvoiceItem> creationInfoList)
      Create new invoice line items and add it to the given invoice
      Parameters:
      invoiceReference - the invoice to add the item to
      creationInfoList - a list of items to be created
      Returns:
      the updated Invoice
    • updateLineItems

      Invoice updateLineItems(Reference<Invoice> invoiceReference, List<? extends Reference<InvoiceItem>> invoiceItemReferenceList, List<InvoiceItemUpdateInfo> updateInfoList)
      Update an existing line item
      Parameters:
      invoiceReference - the invoice that contains the item
      invoiceItemReferenceList - a list of the item references to be updated, in the same order as updateInfoList
      updateInfoList - a list of the line items to be updated
      Returns:
      the updated Invoice
    • deleteLineItems

      Invoice deleteLineItems(Reference<Invoice> invoiceReference, List<? extends Reference<InvoiceItem>> invoiceItemReferenceList)
      Delete an existing line item
      Parameters:
      invoiceReference - the invoice that contains the item
      invoiceItemReferenceList - a list of the line items to be deleted
      Returns:
      the updated Invoice
    • update

      Invoice update(Reference<Invoice> invoiceReference, InvoiceUpdateInfo toChange)
      Updates an existing Invoice with the properties set in InvoiceUpdateInfo. Be careful: setting a list of InvoiceItem will add them to the existing ones, not replace them. See deleteLineItems(Reference, List) to delete existing items
      Parameters:
      invoiceReference - the existing invoice to be updated
      toChange - the properties to be updated
      Returns:
      the updated Invoice
    • delete

      void delete(Reference<Invoice> invoiceReference)
      Delete an existing Invoice.
      Specified by:
      delete in interface Api.Delete<Invoice>
      Parameters:
      invoiceReference - a reference to an existing Invoice to be deleted