Nombaone. Prices
(Nomba One v0.1.0)
View Source
Prices — the amounts and cadences plans are sold at. Create and list them
under a plan via Nombaone.Plans.Prices; this namespace reads and
deactivates them directly.
Summary
Functions
Deactivate a price so no new subscriptions can be created against it. Existing subscriptions are unaffected — prices are immutable history.
Raising variant of deactivate/3.
List prices across all plans, newest first. Optional filters: :plan_ref
(note the wire name — filter one plan's prices), :active, :limit,
:cursor.
Raising variant of list/3.
Retrieve a price by id. Common errors: 404 PRICE_NOT_FOUND.
Raising variant of retrieve/3.
Functions
@spec deactivate(Nombaone.Client.t(), String.t(), keyword()) :: {:ok, Nombaone.Price.t()} | {:error, Nombaone.Error.t()}
Deactivate a price so no new subscriptions can be created against it. Existing subscriptions are unaffected — prices are immutable history.
Common errors: 409 PRICE_ALREADY_INACTIVE.
@spec deactivate!(Nombaone.Client.t(), String.t(), keyword()) :: Nombaone.Price.t()
Raising variant of deactivate/3.
@spec list(Nombaone.Client.t(), map(), keyword()) :: {:ok, Nombaone.Page.t()} | {:error, Nombaone.Error.t()}
List prices across all plans, newest first. Optional filters: :plan_ref
(note the wire name — filter one plan's prices), :active, :limit,
:cursor.
Example
{:ok, page} = Nombaone.Prices.list(client, %{plan_ref: plan.id, active: true})
@spec list!(Nombaone.Client.t(), map(), keyword()) :: Nombaone.Page.t()
Raising variant of list/3.
@spec retrieve(Nombaone.Client.t(), String.t(), keyword()) :: {:ok, Nombaone.Price.t()} | {:error, Nombaone.Error.t()}
Retrieve a price by id. Common errors: 404 PRICE_NOT_FOUND.
@spec retrieve!(Nombaone.Client.t(), String.t(), keyword()) :: Nombaone.Price.t()
Raising variant of retrieve/3.