shopify v0.1.3 Shopify.Transaction

Summary

Functions

Requests all resources

Requests the resource count

Requests to create a new resource

Requests a resource by id

Functions

all(session, id1, params \\ %{})

Requests all resources.

Returns {:ok, [resources]} or {:error, %Shopify.Error{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • id1: The id of the top-level resource.
  • params: Any additional query params.

Examples

iex> Shopify.session |> Shopify.Product.all
{:ok, [%Shopify.Product{}]}
count(session, id1, params \\ %{})

Requests the resource count.

Returns {:ok, integer} or {:error, %Shopify.Error{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • id1: The id of the top-level resource.
  • params: Any additional query params.

Examples

iex> Shopify.session |> Shopify.Product.count
{:ok, 1}
create(session, id1, new_resource)

Requests to create a new resource.

Returns {:ok, resource} or {:error, %Shopify.Error{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • id1: The id of the top-level resource.
  • new_resource: A struct of the resource being created.

Examples

iex> Shopify.session |> Shopify.Product.create(%Shopify.Product{})
{:ok, %Shopify.Product{}}
find(session, id1, id2, params \\ %{})

Requests a resource by id.

Returns {:ok, resource} or {:error, %Shopify.Error{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • id1: The id of the top-level resource.
  • id2: The id of the nested resource.
  • params: Any additional query params.

Examples

iex> Shopify.session |> Shopify.Product.find(id)
{:ok, %Shopify.Product{}}