ExShopify v0.2.0 ExShopify.Country

Reader’s response to an article in a blog.

Summary

Functions

Get a count of all countries

Create a country

Delete a country

Get a list of all countries

Update a country

Types

country_plural()
country_plural() :: {:ok, [%ExShopify.Country{code: term, id: term, name: term, provinces: term, tax: term, tax_name: term}], %ExShopify.Meta{api_call_limit: term}}
country_singular()
country_singular() :: {:ok, %ExShopify.Country{code: term, id: term, name: term, provinces: term, tax: term, tax_name: term}, %ExShopify.Meta{api_call_limit: term}}

Functions

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 countries.

Examples

iex> ExShopify.Country.count(session)
{:ok, country, 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) ::
  country_singular |
  ExShopify.Resource.error

Create a country

Examples

Create a country using Shopify’s tax rate for the country

iex> params = %ExShopify.Country{
...>   code: "FR"
...> }

Create a country using a custom tax rate

iex> params = %ExShopify.Country{
...>   code: "FR",
...>   tax: 0.25
...> }

iex> ExShopify.Country.create(session, params)
{:ok, country, 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 country.

iex> ExShopify.Country.delete(session, 879921427)
{: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) ::
  country_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) ::
  country_singular |
  ExShopify.Resource.error

Show country.

Examples

iex> ExShopify.Country.find(session, 879921427)
{:ok, country, 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}) ::
  country_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) ::
  country_plural |
  ExShopify.Resource.error

Get a list of all countries

Examples

Get all countries

iex> ExShopify.Country.list(session)
{:ok, countries, meta}

Get all countries after the specified ID

iex> ExShopify.Country.list(session, %{since_id: 359115488})
{:ok, countries, meta}
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) ::
  country_singular |
  ExShopify.Resource.error

Update a country.

Examples

iex> ExShopify.Country.update(session, 879921427, %{tax: 0.1})
{:ok, country, meta}