FortnoxEx.Models.Invoice (FortnoxEx v0.1.0) View Source

Link to this section Summary

Functions

Gets a list of partial invoice objects with pagination information.

Streams a partial invoice objects. Will go through each page of results with a delay between page. The stream will produce a single invoice data object for each hit.

Link to this section Functions

Link to this function

create_invoice(client, invoice_data)

View Source

Creates a invoice

Examples

iex> create_invoice(client, %{"Name" => "ACME") {:ok, %{"DocumentNumber" => "1", "Name" => "ACME"}}

iex> create_invoice(client, invoice_attrs)

Link to this function

delete_invoice(client, invoice_number)

View Source

Deletes a invoice

Examples

iex> delete_invoice(client, "1") :ok

iex> delete_invoice(client, "missing")

Link to this function

get_invoice(client, invoice_number)

View Source

Gets a invoice

Examples

iex> get_invoice(client, "1")

iex> get_invoice(clientm "1")

Link to this function

list_invoices(client, query)

View Source

Gets a list of partial invoice objects with pagination information.

Examples

iex> list_invoices(client, []) {:ok, %{"@CurrentPage" => 1, "@TotalPages" => 1, "@TotalResources" => 1}, [%{"DocumentNumber" => "1", "Name" => "ACME"}]}

iex> list_invoices(client, [])

Link to this function

stream_invoices(client, query)

View Source

Streams a partial invoice objects. Will go through each page of results with a delay between page. The stream will produce a single invoice data object for each hit.

Examples

iex> stream_invoices(client, []) stream_of_invoices

iex> stream_invoices(client, [])

Link to this function

update_invoice(client, invoice_number, invoice_data)

View Source

Updates a invoice

Examples

iex> update_invoice(client, "1", %{"Name" => "Johnny"})

iex> update_invoice(clientm "1", invoice_attrs)