shopify v0.1.5 Shopify.Customer

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 all resources based of search params

Requests to update a resource by id

Functions

all(session, params \\ %{})

Requests all resources.

Returns {:ok, %Shopify.Response{}} or {:error, %Shopify.Response{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • params: Any additional query params.

Examples

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

Requests the resource count.

Returns {:ok, %Shopify.Response{}} or {:error, %Shopify.Response{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • params: Any additional query params.

Examples

iex> Shopify.session |> Shopify.Product.count
{:ok, %Shopify.Response{}}
create(session, new_resource)
create(%Shopify.Session{access_token: term, api_key: term, client_id: term, client_secret: term, password: term, shop_name: term, type: term}, map) ::
  {:ok, list} |
  {:error, map}

Requests to create a new resource.

Returns {:ok, %Shopify.Response{}} or {:error, %Shopify.Response{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • new_resource: A struct of the resource being created.

Examples

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

Requests to delete a resource by id.

Returns {:ok, %Shopify.Response{}} or {:error, %Shopify.Response{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • id: The id of the resource.

Examples

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

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{}}
search(session, params \\ %{})
search(%Shopify.Session{access_token: term, api_key: term, client_id: term, client_secret: term, password: term, shop_name: term, type: term}, map) ::
  {:ok, list} |
  {:error, map}

Requests all resources based of search params.

Returns {:ok, %Shopify.Response{}} or {:error, %Shopify.Response{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • params: Any additional query params.

Examples

iex> Shopify.session |> Shopify.Product.search
{:ok, %Shopify.Response{}}
update(session, id, updated_resource)

Requests to update a resource by id.

Returns {:ok, %Shopify.Response{}} or {:error, %Shopify.Response{}}

Parameters

  • session: A %Shopify.Session{} struct.
  • id: The id of the resource.
  • updated_resource: A struct of the resource being updated.

Examples

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