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
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{}]}
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}
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{}}
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{}}