shopify v0.4.0 Shopify.Variant
Link to this section Summary
Functions
Requests all resources
Requests the resource count
Requests to create a new resource
Requests to delete a resource by id
Requests a resource by id
Requests to update a resource by id
Link to this section Functions
Requests all resources.
Returns {:ok, %Shopify.Response{}}
or {:error, %Shopify.Response{}}
Parameters
- session: A
%Shopify.Session{}
struct. - top_id: The id of the top-level resource.
- params: Any additional query params.
Examples
iex> Shopify.session |> Shopify.Transaction.all(order_id)
{:ok, %Shopify.Response{}}
Requests the resource count.
Returns {:ok, %Shopify.Response{}}
or {:error, %Shopify.Response{}}
Parameters
- session: A
%Shopify.Session{}
struct. - top_id: The id of the top-level resource.
- params: Any additional query params.
Examples
iex> Shopify.session |> Shopify.Transaction.count(order_id)
{:ok, %Shopify.Response{}}
Requests to create a new resource.
Returns {:ok, %Shopify.Response{}}
or {:error, %Shopify.Response{}}
Parameters
- session: A
%Shopify.Session{}
struct. - top_id: The id of the top-level resource.
- new_resource: A struct of the resource being created.
Examples
iex> Shopify.session |> Shopify.Transaction.create(order_id)
{:ok, %Shopify.Response{}}
Requests to delete a resource by id.
Returns {:ok, %Shopify.Response{}}
or {:error, %Shopify.Response{}}
Parameters
- session: A
%Shopify.Session{}
struct. - top_id: The id of the top-level resource.
- nest_id: The id of the nested resource.
Examples
iex> Shopify.session |> Shopify.CustomerAddress.delete(customer_id, address_id)
{:ok, %Shopify.Response{}}
Requests a resource by id.
Returns {:ok, %Shopify.Response{}}
or {:error, %Shopify.Response{}}
Parameters
- session: A
%Shopify.Session{}
struct. - id: The id of the resource.
- params: Any additional query params.
Examples
iex> Shopify.session |> Shopify.Product.find(id)
{:ok, %Shopify.Response{}}
Requests to update a resource by id.
Returns {:ok, %Shopify.Response{}}
or {:error, %Shopify.Error{}}
Parameters
- session: A
%Shopify.Session{}
struct. - top_id: The id of the top-level resource.
- nest_id: The id of the nested-level resource.
- updated_resource: A struct of the resource being updated.
Examples
iex> Shopify.session |> Shopify.CustomerAddress.update(customer_id, address_id)
{:ok, %Shopify.Response{}}