FortnoxEx.Models.Customer (FortnoxEx v0.1.0) View Source
Link to this section Summary
Functions
Creates a customer
Deletes a customer
Gets a customer
Gets a list of partial customer objects with pagination information.
Streams a partial customer objects. Will go through each page of results with a delay between page. The stream will produce a single customer data object for each hit.
Updates a customer
Link to this section Functions
Creates a customer
Examples
iex> create_customer(client, %{"Name" => "ACME") {:ok, %{"CustomerNumber" => "1", "Name" => "ACME"}}
iex> create_customer(client, customer_attrs)
Deletes a customer
Examples
iex> delete_customer(client, "1") :ok
iex> delete_customer(client, "missing")
Gets a customer
Examples
iex> get_customer(client, "1")
iex> get_customer(clientm "1")
Gets a list of partial customer objects with pagination information.
Examples
iex> list_customers(client, []) {:ok, %{"@CurrentPage" => 1, "@TotalPages" => 1, "@TotalResources" => 1}, [%{"CustomerNumber" => "1", "Name" => "ACME"}]}
iex> list_customers(client, [])
Streams a partial customer objects. Will go through each page of results with a delay between page. The stream will produce a single customer data object for each hit.
Examples
iex> stream_customers(client, []) stream_of_customers
iex> stream_customers(client, [])
Updates a customer
Examples
iex> update_customer(client, "1", %{"Name" => "Johnny"})
iex> update_customer(clientm "1", customer_attrs)