ExShopify v0.2.0 ExShopify.Webhook

An HTTP request to an app after a specific event happens on a shop.

Summary

Functions

Receive a count of all webhooks

Create a new webhook

Remove a webhook from the database

Receive a single webhooks

Receive a list of all webhooks

Modify an existing namespace

Types

webhook_plural()
webhook_plural() :: {:ok, [%ExShopify.Webhook{address: term, created_at: term, fields: term, format: term, id: term, metafield_namespaces: term, topic: term, updated_at: term}], %ExShopify.Meta{api_call_limit: term}}
webhook_singular()
webhook_singular() :: {:ok, %ExShopify.Webhook{address: term, created_at: term, fields: term, format: term, id: term, metafield_namespaces: term, topic: term, updated_at: term}, %ExShopify.Meta{api_call_limit: term}}

Functions

count(session)
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) ::
  webhook_singular |
  ExShopify.Resource.error

Receive a count of all webhooks.

Examples

iex> ExShopify.Webhook.count(session)
{:ok, webhook, 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) ::
  webhook_singular |
  ExShopify.Resource.error

Create a new webhook.

Examples

iex> params = %{
...>   topic: "orders/create",
...>   address: "http://whatever.hostname.com/",
...>   format: "json"
...> }

iex> ExShopify.Webhook.create(session, params)
{:ok, webhook, 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.meta_only |
  ExShopify.Resource.error

Remove a webhook from the database.

Examples

iex> ExShopify.Webhook.delete(session, 4759306)
{: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) ::
  webhook_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) ::
  webhook_singular |
  ExShopify.Resource.error

Receive a single webhooks.

Examples

iex> ExShopify.Webhook.find(session, 4759306)
{:ok, webhook, 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}) ::
  webhook_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) ::
  webhook_plural |
  ExShopify.Resource.error

Receive a list of all webhooks.

Examples

iex> ExShopify.Webhook.list(session)
{:ok, webhooks, 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) ::
  webhook_singular |
  ExShopify.Resource.error

Modify an existing namespace.

Examples

iex> params = %{
...>   address: "http://somewhere-else.com/"
...> }

iex> ExShopify.Webhook.update(session, 4759306, params)
{:ok, webhook, meta}