ExShopify v0.2.0 ExShopify.ApplicationCredit

A credit for a shop.

Summary

Functions

Create a new credit

Retrieve a single application credit

All past and present application credits

Types

application_credit_plural()
application_credit_plural() :: {:ok, [%ExShopify.ApplicationCredit{amount: term, description: term, id: term, test: term}], %ExShopify.Meta{api_call_limit: term}}
application_credit_singular()
application_credit_singular() :: {:ok, %ExShopify.ApplicationCredit{amount: term, description: term, id: term, test: term}, %ExShopify.Meta{api_call_limit: term}}

Functions

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) ::
  application_credit_singular |
  ExShopify.Resource.error

Create a new credit.

Examples

Create a new credit for $5.00 USD

iex> params = %ExShopify.ApplicationCredit{
...>   description: "application credit for refund",
...>   amount: 5.0
...> }

iex> ExShopify.ApplicationCredit.create(session, params)
{:ok, application_credit, meta}

Create a test application credit that will not issue a credit to the merchant

iex> params = %ExShopify.ApplicationCredit{
...>   description: "application credit for refund",
...>   amount: 5.0,
...>   test: true
...> }

iex> ExShopify.ApplicationCredit.create(session, params)
{:ok, application_credit, 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) ::
  application_credit_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) ::
  application_credit_singular |
  ExShopify.Resource.error

Retrieve a single application credit.

Examples

iex> ExShopify.ApplicationCharge.find(session, 445365009)
{:ok, application_charge, 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}) ::
  application_credit_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) ::
  application_credit_plural |
  ExShopify.Resource.error

All past and present application credits.

Examples

iex> ExShopify.ApplicationCharge.list(session)
{:ok, application_charges, meta}