FortnoxEx.Api.Default (fortnox_ex v0.4.4)

API calls for all endpoints tagged Default.

Link to this section Summary

Link to this section Functions

Link to this function

create_customer(connection, single_customer_attrs, opts \\ [])

Specs

Create customer

Parameters

  • connection (FortnoxEx.Connection): Connection to server
  • single_customer_attrs (SingleCustomerAttrs):
  • opts (KeywordList): [optional] Optional parameters

    Returns

} on success {:error, info} on failure

Link to this function

delete_customer(connection, customer_number, opts \\ [])

Specs

delete_customer(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Deletes a customer

Parameters

  • connection (FortnoxEx.Connection): Connection to server
  • customer_number (String.t): The customer number
  • opts (KeywordList): [optional] Optional parameters

    Returns

} on success {:error, info} on failure

Link to this function

get_customer(connection, customer_number, opts \\ [])

Specs

get_customer(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, FortnoxEx.Model.SingleCustomer.t()} | {:error, Tesla.Env.t()}

Get customer by customer number

Parameters

  • connection (FortnoxEx.Connection): Connection to server
  • customer_number (String.t): The customer number
  • opts (KeywordList): [optional] Optional parameters

    Returns

} on success {:error, info} on failure

Link to this function

list_customers(connection, opts \\ [])

Specs

list_customers(Tesla.Env.client(), keyword()) ::
  {:ok, FortnoxEx.Model.CustomerList.t()} | {:error, Tesla.Env.t()}

List customers

Parameters

  • connection (FortnoxEx.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters
    • :financialyeardate (String.t): Selects by date, what financial year that should be used
    • :financialyear (String.t): Selects what financial year that should be used
    • :fromdate (String.t): Defines a selection based on a start date. Only available for invoices, orders, offers and vouchers.
    • :lastmodified (String.t): Retrieves all records since the provided timestamp.
    • :limit (integer()): Limit per page. Default 100, from 1 to 500 are valid options.
    • :offset (integer()): Offset
    • :page (integer()): Page, with 1 beeing the first page
    • :sortby (String.t): A result can be sorted, either ascending or descending, by specific fields. These fields are listed in the table under the section “Fields” in the documentation for each resource. This is made in the same way as the search and the filter, by adding GET parameters. Apart from the filters and the search, sorting uses two parameters. One named “sortby”, which specifies the field that the result should be sorted by and one named “sortorder”, which specifies the order in which the sorting should be made.
    • :sortorder (String.t): Sorting order
    • :todate (String.t): Defines a selection based on an end date. Only available for invoices, orders, offers and vouchers
    • :filter (String.t): Filters on active and inactive customers

      Returns

} on success {:error, info} on failure

Link to this function

update_customer(connection, customer_number, single_customer_attrs, opts \\ [])

Specs

Updates a customer

Parameters

  • connection (FortnoxEx.Connection): Connection to server
  • customer_number (String.t): The customer number
  • single_customer_attrs (SingleCustomerAttrs):
  • opts (KeywordList): [optional] Optional parameters

    Returns

} on success {:error, info} on failure