ExShopify v0.2.0 ExShopify.CustomerAddress
Represents one of the many addresses a customer may have.
Summary
Functions
Creates a new address for a customer
Removes an address from the customers address list
Retrieve details for one of a customers addresses
Retrieve all addresses for a customer
Assign a new default address to a customer
Updates the values on an existing customer address
Types
customer_address_plural()
customer_address_plural() :: {:ok, [%ExShopify.CustomerAddress{address1: term, address2: term, city: term, company: term, country: term, country_code: term, country_name: term, default: term, first_name: term, id: term, last_name: term, name: term, phone: term, province: term, province_code: term, zip: term}], %ExShopify.Meta{api_call_limit: term}}
customer_address_singular()
customer_address_singular() :: {:ok, %ExShopify.CustomerAddress{address1: term, address2: term, city: term, company: term, country: term, country_code: term, country_name: term, default: term, first_name: term, id: term, last_name: term, name: term, phone: term, province: term, province_code: term, zip: term}, %ExShopify.Meta{api_call_limit: term}}
Functions
create(session, customer_id, params)
create(%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_address_plural | ExShopify.Resource.error
Creates a new address for a customer
Examples
iex> params = %{
...> address1: "1 Rue des Carrieres",
...> address2: "Suite 1234",
...> city: "Montreal",
...> company: "Fancy Co.",
...> first_name: "Samuel",
...> last_name: "de Champlain",
...> phone: "819-555-5555",
...> province: "Quebec",
...> country: "Canada",
...> zip: "G1R 4P5",
...> name: "Samuel de Champlain",
...> province_code: "QC",
...> country_code: "CA",
...> country_name: "Canada"
...> }
iex> ExShopify.CustomerAddress.create(session, 207119551, params)
{:ok, customer_address, meta}
delete(session, id, customer_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, integer | String.t) :: ExShopify.Resource.only_meta | ExShopify.Resource.error
Removes an address from the customers address list.
Examples
iex> ExShopify.CustomerAddress.delete(session, 1053317286, 207119551)
{:ok, meta}
find(session, id, customer_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, integer | String.t) :: customer_address_singular | ExShopify.Resource.error
Retrieve details for one of a customers addresses
Examples
Get a single customers address
iex> ExShopify.CustomerAddress.find(session, 207119551, 207119551)
{:ok, customer_address, meta}
list(session, customer_id)
list(%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_address_plural | ExShopify.Resource.error
list(session, customer_id, params)
list(%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_address_plural | ExShopify.Resource.error
Retrieve all addresses for a customer.
Examples
Get all of a customer’s addresses
iex> ExShopify.CustomerAddress.list(session, 207119551)
{:ok, customer_addresses, meta}
Get a limited number of addresses for a customer
iex> ExShopify.CustomerAddress.list(session, 207119551, %{limit: 1, page: 1})
{:ok, customer_addresses, meta}
set_default(session, id, customer_id)
set_default(%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, integer | String.t) :: customer_address_singular | ExShopify.Resource.error
Assign a new default address to a customer.
Examples
iex> ExShopify.CustomerAddress.set_default(session, 1053317287, 207119551)
{:ok, customer_address, meta}
update(session, id, customer_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, integer | String.t, map) :: customer_address_singular | ExShopify.Resource.error
Updates the values on an existing customer address.
Examples
iex> params = %{
...> zip: "90210"
...> }
iex> ExShopify.CustomerAddress.update(session, 207119551, 207119551, params)
{:ok, customer_address, meta}