Elixir client for Fatture in Cloud API v2.
Create a client with new/1 and use the resource modules, for example
ExFattureincloud.Clients.list_clients/3. Requests return
{:ok, %ExFattureincloud.Response{}} or {:error, %ExFattureincloud.Error{}}.
JSON keys remain strings; response envelopes and pagination are preserved.
client = ExFattureincloud.new(token: System.fetch_env!("FIC_ACCESS_TOKEN"))
ExFattureincloud.User.list_user_companies(client)Clients are immutable and have no global credentials. Optional supervised
OAuth renewal is provided by ExFattureincloud.OAuth.TokenManager.
API writes are never repeated automatically.
Summary
Functions
Calls a catalog operation by its snake_case name or OpenAPI operation ID.
Creates an immutable client. See ExFattureincloud.Client.new/1 for options.
Makes a request to an API-relative path, including endpoints added after this SDK.
Returns the response or raises ExFattureincloud.Error.
Functions
@spec call( ExFattureincloud.Client.t(), ExFattureincloud.Operations.id(), ExFattureincloud.API.options() ) :: ExFattureincloud.Response.result()
Calls a catalog operation by its snake_case name or OpenAPI operation ID.
See ExFattureincloud.API.call/3 for path, query, and request body options.
@spec new(keyword()) :: ExFattureincloud.Client.t()
Creates an immutable client. See ExFattureincloud.Client.new/1 for options.
To make OAuth requests before you have an access token, create a client with the default options.
iex> client = ExFattureincloud.new()
iex> client.base_url
"https://api-v2.fattureincloud.it"
iex> client.token
nil
@spec request(ExFattureincloud.Client.t(), atom(), String.t(), keyword()) :: ExFattureincloud.Response.result()
Makes a request to an API-relative path, including endpoints added after this SDK.
Supply a path starting with / and pass parameters separately as :query.
Pass :body for a JSON value or :multipart for a list of Req multipart
fields. :accept defaults to "application/json" and :authenticated
defaults to true.
@spec unwrap!(ExFattureincloud.Response.result()) :: ExFattureincloud.Response.t()
Returns the response or raises ExFattureincloud.Error.