pify/webhook/subscription

Webhook subscriptions the app owns on one shop.

Shopify deletes a subscription made through the Admin API after eight failed deliveries in a row, so a consumer lists them and creates what is missing. A subscription reports the version it serializes bodies with; compare it with the X-Shopify-API-Version of each delivery.

Types

pub type Subscription {
  Subscription(
    id: String,
    topic: String,
    uri: String,
    api_version: option.Option(String),
  )
}

Constructors

  • Subscription(
      id: String,
      topic: String,
      uri: String,
      api_version: option.Option(String),
    )

    Arguments

    topic

    The WebhookSubscriptionTopic enum value, such as ORDERS_CREATE.

    api_version

    The version handle bodies are serialized with, such as 2026-07.

Values

pub fn create(
  client: pify.Client,
  topic topic: webhook.Topic,
  uri uri: String,
  name name: option.Option(String),
) -> effect.Effect(Result(Subscription, error.ShopifyError), key)

Subscribe uri to topic. name is sent only to versions that take it and is dropped for older ones.

pub const create_mutation: String
pub fn create_variables(
  version: api_version.ApiVersion,
  topic_enum: String,
  uri: String,
  name: option.Option(String),
) -> json.Json
pub fn list(
  client: pify.Client,
) -> effect.Effect(
  Result(List(Subscription), error.ShopifyError),
  key,
)
pub const list_query: String
pub fn list_variables(after: option.Option(String)) -> json.Json
pub const name_since: api_version.ApiVersion

From this version a subscription takes a name, which Shopify sends back in X-Shopify-Name.

✨ Search Document