ExShopify v0.2.0 ExShopify.GiftCard

Alternative payment method, and has a code which is entered during checkout.

Summary

Functions

Receive a count of all gift cards

Create a new gift card

Disable a gift card

Receive a single gift card

Receive a list of all gift cards

Search for gift cards

Modify an existing gift card

Types

gift_card_plural()
gift_card_plural() :: {:ok, [%ExShopify.GiftCard{api_client_id: term, balance: term, code: term, created_at: term, currency: term, disabled_at: term, expires_on: term, id: term, last_characters: term, line_item_id: term, masked_code: term, note: term, order_id: term, template_suffix: term, updated_at: term, user_id: term}], %ExShopify.Meta{api_call_limit: term}}
gift_card_singular()
gift_card_singular() :: {:ok, %ExShopify.GiftCard{api_client_id: term, balance: term, code: term, created_at: term, currency: term, disabled_at: term, expires_on: term, id: term, last_characters: term, line_item_id: term, masked_code: term, note: term, order_id: term, template_suffix: term, updated_at: term, user_id: 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
count(session, params)
count(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, map) ::
  ExShopify.Resource.count |
  ExShopify.Resource.error

Receive a count of all gift cards.

Examples

iex> ExShopify.GiftCard.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) ::
  gift_card_singular |
  ExShopify.Resource.error

Create a new gift card.

Examples

Create a new gift card with a custom code

iex> params = %ExShopify.GiftCard{
...>   note: "This is a note",
...>   initial_value: 100.0,
...>   code: "ABCD EFGH IJKL MNOP",
...>   template_suffix: "gift_cards.birthday.liquid"
...> }

iex> ExShopify.GiftCard.create(session, params)
{:ok, gift_card, meta}

Create a new gift card with an automatically generated code

iex> params = %ExShopify.GiftCard{
...>   initial_value: 25.0,
...> }

iex> ExShopify.GiftCard.create(session, params)
{:ok, gift_card, meta}
disable(session, id)
disable(%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) ::
  gift_card_singular |
  ExShopify.Resource.error

Disable a gift card.

Examples

iex> ExShopify.GiftCard.disable(session, 48394658)
{:ok, gift_card, 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) ::
  gift_card_singular |
  ExShopify.Resource.error

Receive a single gift card.

Examples

iex> ExShopify.GiftCard.find(session, 48394658)
{:ok, gift_card, 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}) ::
  gift_card_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) ::
  gift_card_plural |
  ExShopify.Resource.error

Receive a list of all gift cards.

Examples

iex> ExShopify.GiftCard.list(session)
{:ok, gift_cards, meta}
search(session, params)
search(%ExShopify.Session{access_token: term, api_key: term, domain: term, port: term, protocol: term, secret: term, shop_name: term, shop_url: term}, map) ::
  gift_card_plural |
  ExShopify.Resource.error

Search for gift cards.

Examples

iex> ExShopify.GiftCard.search(session, %{query: "Bob"})
{:ok, gift_cards, 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) ::
  gift_card_singular |
  ExShopify.Resource.error

Modify an existing gift card.

Examples

iex> params = %{note: "Updating with a new note"}

iex> ExShopify.GiftCard.update(session, 48394658, params)
{:ok, gift_card, meta}