LagoClient
Elixir client for the Lago API generated from Lago's OpenAPI spec.
Installation
Add lago_client to your dependencies:
def deps do
[
{:lago_client, "~> 1.0.0"}
]
endGenerate From OpenAPI
Fetch the latest Lago OpenAPI file and regenerate the client:
mix api.lago.genThis command:
-
Downloads
https://swagger.getlago.com/openapi.yamlintopriv/openapi/lago.yaml -
Runs
mix api.gen lago priv/openapi/lago.yaml -
Outputs generated modules under
Lago.*inlib/lago/
Usage
# Configure once (config/runtime.exs, env vars, etc.)
config :lago_client, :api_key, System.fetch_env!("LAGO_API_KEY")
# Use generated operations:
Lago.Customers.create_customer(
%{customer: %{external_id: "cust_123", name: "ACME"}},
[]
)