ExShopify v0.2.0 ExShopify.Customer

Information about the customer.

Summary

Functions

Create account activation URL for an invited or disabled customer

Get a count of all customers

Create a new customer

Delete a customer

Get a single customer by id

Retrieve all customers of a shop

Search for customers of a shop

Update a customer

Types

customer_account_activation_url()
customer_account_activation_url() :: {:ok, String.t, %ExShopify.Meta{api_call_limit: term}}
customer_plural()
customer_plural() :: {:ok, [%ExShopify.Customer{accepts_marketing: term, addresses: term, created_at: term, default_address: term, email: term, first_name: term, id: term, last_name: term, last_order_id: term, last_order_name: term, metafields: term, multipass_identifier: term, note: term, orders_count: term, state: term, tags: term, tax_exempt: term, total_spent: term, updated_at: term, verified_email: term}], %ExShopify.Meta{api_call_limit: term}}
customer_singular()
customer_singular() :: {:ok, %ExShopify.Customer{accepts_marketing: term, addresses: term, created_at: term, default_address: term, email: term, first_name: term, id: term, last_name: term, last_order_id: term, last_order_name: term, metafields: term, multipass_identifier: term, note: term, orders_count: term, state: term, tags: term, tax_exempt: term, total_spent: term, updated_at: term, verified_email: term}, %ExShopify.Meta{api_call_limit: term}}

Functions

account_activation_url(session, id)
account_activation_url(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t) ::
  customer_account_activation_url |
  ExShopify.Resource.error

Create account activation URL for an invited or disabled customer.

Examples

iex> ExShopify.Customer.account_activation_url(session, 207119551)
{:ok, account_activation_url, meta}
count(session)
count(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}) ::
  ExShopify.Resource.count |
  ExShopify.Resource.error

Get a count of all customers.

Examples

iex> ExShopify.Customer.count(session)
{:ok, count, meta}
create(session, params)
create(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, map) ::
  customer_singular |
  ExShopify.Resource.error

Create a new customer.

Examples

Create a new customer record

iex> params = %{
...>   first_name: "Steve",
...>   last_name: "Lastnameson",
...>   email: "steve.lastnameson@example.com",
...>   verified_email: true,
...>   addresses: [
...>     %ExShopify.CustomerAddress{
...>       address1: "123 Oak St",
...>       city: "Ottawa",
...>       province: "ON",
...>       phone: "555-1212",
...>       zip: "123 ABC",
...>       first_name: "Mother",
...>       last_name: "Lastnameson",
...>       country: "CA"
...>     }
...>   ]
...> }

iex> ExShopify.Customer.create(session ,params)
{:ok, customer, meta}

Create a new customer with password and password_confirmation and skip sending the welcome email

iex> params = %{
...>   first_name: "Steve",
...>   last_name: "Lastnameson",
...>   email: "steve.lastnameson@example.com",
...>   verified_email: true,
...>   addresses: [
...>     %ExShopify.CustomerAddress{
...>       address1: "123 Oak St",
...>       city: "Ottawa",
...>       province: "ON",
...>       phone: "555-1212",
...>       zip: "123 ABC",
...>       first_name: "Mother",
...>       last_name: "Lastnameson",
...>       country: "CA"
...>     }
...>   ],
...>   password: "newpass",
...>   password_confirmation: "newpass",
...>   send_email_welcome: false
...> }

iex> ExShopify.Customer.create(session ,params)
{:ok, customer, meta}

Create a new customer with send_email_invite

iex> params = %{
...>   first_name: "Steve",
...>   last_name: "Lastnameson",
...>   email: "steve.lastnameson@example.com",
...>   verified_email: true,
...>   addresses: [
...>     %ExShopify.CustomerAddress{
...>       address1: "123 Oak St",
...>       city: "Ottawa",
...>       province: "ON",
...>       phone: "555-1212",
...>       zip: "123 ABC",
...>       first_name: "Mother",
...>       last_name: "Lastnameson",
...>       country: "CA"
...>     }
...>   ],
...>   send_email_invite: false
...> }

iex> ExShopify.Customer.create(session ,params)
{:ok, customer, meta}

Create a new customer with a metafield

iex> params = %{
...>   first_name: "Steve",
...>   last_name: "Lastnameson",
...>   email: "steve.lastnameson@example.com",
...>   verified_email: true,
...>   addresses: [
...>     %ExShopify.CustomerAddress{
...>       address1: "123 Oak St",
...>       city: "Ottawa",
...>       province: "ON",
...>       phone: "555-1212",
...>       zip: "123 ABC",
...>       first_name: "Mother",
...>       last_name: "Lastnameson",
...>       country: "CA"
...>     }
...>   ],
...>   metafields: [
...>     %ExShopify.Metafield{
...>       key: "key",
...>       value: "newvalue",
...>       value_type: "string",
...>       namespace: "global"
...>     }
...>   ]
...> }

iex> ExShopify.Customer.create(session ,params)
{:ok, customer, meta}
delete(session, id)
delete(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t) ::
  ExShopify.Resource.only_meta |
  ExShopify.Resource.error

Delete a customer.

Examples

iex> ExShopify.Customer.delete(session, 207119551)
{:ok, meta}
find(session, id)
find(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t) ::
  customer_singular |
  ExShopify.Resource.error
find(session, id, params)
find(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t, map) ::
  customer_singular |
  ExShopify.Resource.error

Get a single customer by id.

Examples

iex> ExShopify.Customer.find(session, 207119551)
{:ok, customer, meta}
list(session)
list(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}) ::
  customer_plural |
  ExShopify.Resource.error
list(session, params)
list(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, map) ::
  customer_plural |
  ExShopify.Resource.error

Retrieve all customers of a shop.

Examples

Get all customers for a shop

iex> ExShopify.Customer.list(session)
{:ok, customers, meta}

Get a list of specific customers

iex> ExShopify.Customer.list(session, %{ids: [207119551, 1073339468]})
{:ok, customers, meta}
search(session, query)
search(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, String.t) ::
  customer_plural |
  ExShopify.Resource.error

Search for customers of a shop.

Examples

iex> ExShopify.Customer.search(session, "Bob country:United States")
update(session, id, params)
update(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, integer | String.t, map) ::
  customer_singular |
  ExShopify.Resource.error

Update a customer.

Examples

iex> ExShopify.Customer.update(session, 207119551, %{tags: "New Customer, Repeat Customer"})
{:ok, customer, meta}