Moov.Products (Moov v1.0.0)

Copy Markdown View Source

An account's product catalog - title, base price, description, image, and price-modifying options. Maps onto line items in transfers and payment links.

See https://docs.moov.io/api/tools/products/.

Summary

Functions

Retrieves a single product.

Lists an account's active products.

Updates a product and its options.

Functions

create(client, account_id, params)

@spec create(Moov.Client.t(), String.t(), map()) ::
  {:ok, map()} | {:error, Moov.Error.t()}

Creates a product.

params: :name, :description, :price (%{currency: "USD", value: 2500}), :image_id (from Moov.Images), :options (price-modifying variants).

disable(client, account_id, product_id)

@spec disable(Moov.Client.t(), String.t(), String.t()) ::
  {:ok, term()} | {:error, Moov.Error.t()}

Disables a product.

get(client, account_id, product_id)

@spec get(Moov.Client.t(), String.t(), String.t()) ::
  {:ok, map()} | {:error, Moov.Error.t()}

Retrieves a single product.

list(client, account_id, opts \\ [])

@spec list(Moov.Client.t(), String.t(), keyword()) ::
  {:ok, [map()]} | {:error, Moov.Error.t()}

Lists an account's active products.

update(client, account_id, product_id, params)

@spec update(Moov.Client.t(), String.t(), String.t(), map()) ::
  {:ok, map()} | {:error, Moov.Error.t()}

Updates a product and its options.