# webhookSubscriptionCreate - admin-graphql - MUTATION
Version: 2025-01

## Description
Creates a new webhook subscription.

Building an app? If you only use app-specific webhooks, you won't need this. App-specific webhook subscriptions specified in your `shopify.app.toml` may be easier. They are automatically kept up to date by Shopify & require less maintenance. Please read [About managing webhook subscriptions](https://shopify.dev/docs/apps/build/webhooks/subscribe).

### Access Scopes



## Arguments
* [topic](/docs/api/admin-graphql/2025-01/enums/WebhookSubscriptionTopic): WebhookSubscriptionTopic! - The type of event that triggers the webhook.
* [webhookSubscription](/docs/api/admin-graphql/2025-01/input-objects/WebhookSubscriptionInput): WebhookSubscriptionInput! - Specifies the input fields for a webhook subscription.


## Returns
* [userErrors](/docs/api/admin-graphql/2025-01/objects/UserError): UserError! The list of errors that occurred from executing the mutation.
* [webhookSubscription](/docs/api/admin-graphql/2025-01/objects/WebhookSubscription): WebhookSubscription The webhook subscription that was created.


## Examples
### Create a METAOBJECTS_CREATE webhook subscription for lookbook metaobjects
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) { webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) { webhookSubscription { id topic filter format endpoint { __typename ... on WebhookHttpEndpoint { callbackUrl } } } userErrors { field message } } }\",\n \"variables\": {\n    \"topic\": \"METAOBJECTS_CREATE\",\n    \"webhookSubscription\": {\n      \"callbackUrl\": \"https://example.org/endpoint\",\n      \"format\": \"JSON\",\n      \"filter\": \"type:lookbook\"\n    }\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n      webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n        webhookSubscription {\n          id\n          topic\n          filter\n          format\n          endpoint {\n            __typename\n            ... on WebhookHttpEndpoint {\n              callbackUrl\n            }\n          }\n        }\n        userErrors {\n          field\n          message\n        }\n      }\n    }`,\n    \"variables\": {\n      \"topic\": \"METAOBJECTS_CREATE\",\n      \"webhookSubscription\": {\n        \"callbackUrl\": \"https://example.org/endpoint\",\n        \"format\": \"JSON\",\n        \"filter\": \"type:lookbook\"\n      }\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n    webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n      webhookSubscription {\n        id\n        topic\n        filter\n        format\n        endpoint {\n          __typename\n          ... on WebhookHttpEndpoint {\n            callbackUrl\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"topic\": \"METAOBJECTS_CREATE\",\n  \"webhookSubscription\": {\n    \"callbackUrl\": \"https://example.org/endpoint\",\n    \"format\": \"JSON\",\n    \"filter\": \"type:lookbook\"\n  }\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n    webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n      webhookSubscription {\n        id\n        topic\n        filter\n        format\n        endpoint {\n          __typename\n          ... on WebhookHttpEndpoint {\n            callbackUrl\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"topic\": \"METAOBJECTS_CREATE\",\n      \"webhookSubscription\": {\n        \"callbackUrl\": \"https://example.org/endpoint\",\n        \"format\": \"JSON\",\n        \"filter\": \"type:lookbook\"\n      }\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n  webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n    webhookSubscription {\n      id\n      topic\n      filter\n      format\n      endpoint {\n        __typename\n        ... on WebhookHttpEndpoint {\n          callbackUrl\n        }\n      }\n    }\n    userErrors {\n      field\n      message\n    }\n  }\n}"
#### Graphql Input
{
  "topic": "METAOBJECTS_CREATE",
  "webhookSubscription": {
    "callbackUrl": "https://example.org/endpoint",
    "format": "JSON",
    "filter": "type:lookbook"
  }
}
#### Graphql Response
{
  "data": {
    "webhookSubscriptionCreate": {
      "webhookSubscription": {
        "id": "gid://shopify/WebhookSubscription/8589934635",
        "topic": "METAOBJECTS_CREATE",
        "filter": "type:lookbook",
        "format": "JSON",
        "endpoint": {
          "__typename": "WebhookHttpEndpoint",
          "callbackUrl": "https://example.org/endpoint"
        }
      },
      "userErrors": []
    }
  }
}

### Create a new Webhook
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation WebhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) { webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) { webhookSubscription { id topic apiVersion { handle } format createdAt } userErrors { field message } } }\",\n \"variables\": {\n    \"topic\": \"ORDERS_CREATE\",\n    \"webhookSubscription\": {\n      \"callbackUrl\": \"https://example.org/endpoint\",\n      \"format\": \"JSON\"\n    }\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation WebhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n      webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n        webhookSubscription {\n          id\n          topic\n          apiVersion {\n            handle\n          }\n          format\n          createdAt\n        }\n        userErrors {\n          field\n          message\n        }\n      }\n    }`,\n    \"variables\": {\n      \"topic\": \"ORDERS_CREATE\",\n      \"webhookSubscription\": {\n        \"callbackUrl\": \"https://example.org/endpoint\",\n        \"format\": \"JSON\"\n      }\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation WebhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n    webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n      webhookSubscription {\n        id\n        topic\n        apiVersion {\n          handle\n        }\n        format\n        createdAt\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"topic\": \"ORDERS_CREATE\",\n  \"webhookSubscription\": {\n    \"callbackUrl\": \"https://example.org/endpoint\",\n    \"format\": \"JSON\"\n  }\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation WebhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n    webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n      webhookSubscription {\n        id\n        topic\n        apiVersion {\n          handle\n        }\n        format\n        createdAt\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"topic\": \"ORDERS_CREATE\",\n      \"webhookSubscription\": {\n        \"callbackUrl\": \"https://example.org/endpoint\",\n        \"format\": \"JSON\"\n      }\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation WebhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n  webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n    webhookSubscription {\n      id\n      topic\n      apiVersion {\n        handle\n      }\n      format\n      createdAt\n    }\n    userErrors {\n      field\n      message\n    }\n  }\n}"
#### Graphql Input
{
  "topic": "ORDERS_CREATE",
  "webhookSubscription": {
    "callbackUrl": "https://example.org/endpoint",
    "format": "JSON"
  }
}
#### Graphql Response
{
  "data": {
    "webhookSubscriptionCreate": {
      "webhookSubscription": {
        "id": "gid://shopify/WebhookSubscription/8589934639",
        "topic": "ORDERS_CREATE",
        "apiVersion": {
          "handle": "unstable"
        },
        "format": "JSON",
        "createdAt": "2025-01-10T19:12:50Z"
      },
      "userErrors": []
    }
  }
}

### Create an HTTP webhook subscription for APP_UNINSTALLED events
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) { webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) { webhookSubscription { id topic format endpoint { __typename ... on WebhookHttpEndpoint { callbackUrl } } } userErrors { field message } } }\",\n \"variables\": {\n    \"topic\": \"APP_UNINSTALLED\",\n    \"webhookSubscription\": {\n      \"callbackUrl\": \"https://example.org/endpoint\",\n      \"format\": \"JSON\"\n    }\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n      webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n        webhookSubscription {\n          id\n          topic\n          format\n          endpoint {\n            __typename\n            ... on WebhookHttpEndpoint {\n              callbackUrl\n            }\n          }\n        }\n        userErrors {\n          field\n          message\n        }\n      }\n    }`,\n    \"variables\": {\n      \"topic\": \"APP_UNINSTALLED\",\n      \"webhookSubscription\": {\n        \"callbackUrl\": \"https://example.org/endpoint\",\n        \"format\": \"JSON\"\n      }\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n    webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n      webhookSubscription {\n        id\n        topic\n        format\n        endpoint {\n          __typename\n          ... on WebhookHttpEndpoint {\n            callbackUrl\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"topic\": \"APP_UNINSTALLED\",\n  \"webhookSubscription\": {\n    \"callbackUrl\": \"https://example.org/endpoint\",\n    \"format\": \"JSON\"\n  }\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n    webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n      webhookSubscription {\n        id\n        topic\n        format\n        endpoint {\n          __typename\n          ... on WebhookHttpEndpoint {\n            callbackUrl\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"topic\": \"APP_UNINSTALLED\",\n      \"webhookSubscription\": {\n        \"callbackUrl\": \"https://example.org/endpoint\",\n        \"format\": \"JSON\"\n      }\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n  webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n    webhookSubscription {\n      id\n      topic\n      format\n      endpoint {\n        __typename\n        ... on WebhookHttpEndpoint {\n          callbackUrl\n        }\n      }\n    }\n    userErrors {\n      field\n      message\n    }\n  }\n}"
#### Graphql Input
{
  "topic": "APP_UNINSTALLED",
  "webhookSubscription": {
    "callbackUrl": "https://example.org/endpoint",
    "format": "JSON"
  }
}
#### Graphql Response
{
  "data": {
    "webhookSubscriptionCreate": {
      "webhookSubscription": {
        "id": "gid://shopify/WebhookSubscription/8589934637",
        "topic": "APP_UNINSTALLED",
        "format": "JSON",
        "endpoint": {
          "__typename": "WebhookHttpEndpoint",
          "callbackUrl": "https://example.org/endpoint"
        }
      },
      "userErrors": []
    }
  }
}

### Create an ORDERS_CREATE webhook subscription that includes metafields during serialization
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) { webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) { webhookSubscription { id topic format metafieldNamespaces endpoint { __typename ... on WebhookHttpEndpoint { callbackUrl } } } userErrors { field message } } }\",\n \"variables\": {\n    \"topic\": \"ORDERS_CREATE\",\n    \"webhookSubscription\": {\n      \"callbackUrl\": \"https://example.org/endpoint\",\n      \"format\": \"JSON\",\n      \"metafieldNamespaces\": [\n        \"MY_NAMESPACE\",\n        \"ANOTHER_NAMESPACE\"\n      ]\n    }\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n      webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n        webhookSubscription {\n          id\n          topic\n          format\n          metafieldNamespaces\n          endpoint {\n            __typename\n            ... on WebhookHttpEndpoint {\n              callbackUrl\n            }\n          }\n        }\n        userErrors {\n          field\n          message\n        }\n      }\n    }`,\n    \"variables\": {\n      \"topic\": \"ORDERS_CREATE\",\n      \"webhookSubscription\": {\n        \"callbackUrl\": \"https://example.org/endpoint\",\n        \"format\": \"JSON\",\n        \"metafieldNamespaces\": [\n          \"MY_NAMESPACE\",\n          \"ANOTHER_NAMESPACE\"\n        ]\n      }\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n    webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n      webhookSubscription {\n        id\n        topic\n        format\n        metafieldNamespaces\n        endpoint {\n          __typename\n          ... on WebhookHttpEndpoint {\n            callbackUrl\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"topic\": \"ORDERS_CREATE\",\n  \"webhookSubscription\": {\n    \"callbackUrl\": \"https://example.org/endpoint\",\n    \"format\": \"JSON\",\n    \"metafieldNamespaces\": [\"MY_NAMESPACE\", \"ANOTHER_NAMESPACE\"]\n  }\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n    webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n      webhookSubscription {\n        id\n        topic\n        format\n        metafieldNamespaces\n        endpoint {\n          __typename\n          ... on WebhookHttpEndpoint {\n            callbackUrl\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"topic\": \"ORDERS_CREATE\",\n      \"webhookSubscription\": {\n        \"callbackUrl\": \"https://example.org/endpoint\",\n        \"format\": \"JSON\",\n        \"metafieldNamespaces\": [\n          \"MY_NAMESPACE\",\n          \"ANOTHER_NAMESPACE\"\n        ]\n      }\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n  webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n    webhookSubscription {\n      id\n      topic\n      format\n      metafieldNamespaces\n      endpoint {\n        __typename\n        ... on WebhookHttpEndpoint {\n          callbackUrl\n        }\n      }\n    }\n    userErrors {\n      field\n      message\n    }\n  }\n}"
#### Graphql Input
{
  "topic": "ORDERS_CREATE",
  "webhookSubscription": {
    "callbackUrl": "https://example.org/endpoint",
    "format": "JSON",
    "metafieldNamespaces": [
      "MY_NAMESPACE",
      "ANOTHER_NAMESPACE"
    ]
  }
}
#### Graphql Response
{
  "data": {
    "webhookSubscriptionCreate": {
      "webhookSubscription": {
        "id": "gid://shopify/WebhookSubscription/8589934632",
        "topic": "ORDERS_CREATE",
        "format": "JSON",
        "metafieldNamespaces": [
          "MY_NAMESPACE",
          "ANOTHER_NAMESPACE"
        ],
        "endpoint": {
          "__typename": "WebhookHttpEndpoint",
          "callbackUrl": "https://example.org/endpoint"
        }
      },
      "userErrors": []
    }
  }
}

### Create an ORDERS_CREATE webhook subscription with fewer resource fields during serialization
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) { webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) { webhookSubscription { id topic format includeFields endpoint { __typename ... on WebhookHttpEndpoint { callbackUrl } } } userErrors { field message } } }\",\n \"variables\": {\n    \"topic\": \"ORDERS_CREATE\",\n    \"webhookSubscription\": {\n      \"callbackUrl\": \"https://example.org/endpoint\",\n      \"format\": \"JSON\",\n      \"includeFields\": [\n        \"id\",\n        \"note\"\n      ]\n    }\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n      webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n        webhookSubscription {\n          id\n          topic\n          format\n          includeFields\n          endpoint {\n            __typename\n            ... on WebhookHttpEndpoint {\n              callbackUrl\n            }\n          }\n        }\n        userErrors {\n          field\n          message\n        }\n      }\n    }`,\n    \"variables\": {\n      \"topic\": \"ORDERS_CREATE\",\n      \"webhookSubscription\": {\n        \"callbackUrl\": \"https://example.org/endpoint\",\n        \"format\": \"JSON\",\n        \"includeFields\": [\n          \"id\",\n          \"note\"\n        ]\n      }\n    },\n  },\n});\n"
Ruby example: "session = ShopifyAPI::Auth::Session.new(\n  shop: \"your-development-store.myshopify.com\",\n  access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n  session: session\n)\n\nquery = <<~QUERY\n  mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n    webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n      webhookSubscription {\n        id\n        topic\n        format\n        includeFields\n        endpoint {\n          __typename\n          ... on WebhookHttpEndpoint {\n            callbackUrl\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"topic\": \"ORDERS_CREATE\",\n  \"webhookSubscription\": {\n    \"callbackUrl\": \"https://example.org/endpoint\",\n    \"format\": \"JSON\",\n    \"includeFields\": [\"id\", \"note\"]\n  }\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n    webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n      webhookSubscription {\n        id\n        topic\n        format\n        includeFields\n        endpoint {\n          __typename\n          ... on WebhookHttpEndpoint {\n            callbackUrl\n          }\n        }\n      }\n      userErrors {\n        field\n        message\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"topic\": \"ORDERS_CREATE\",\n      \"webhookSubscription\": {\n        \"callbackUrl\": \"https://example.org/endpoint\",\n        \"format\": \"JSON\",\n        \"includeFields\": [\n          \"id\",\n          \"note\"\n        ]\n      }\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {\n  webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {\n    webhookSubscription {\n      id\n      topic\n      format\n      includeFields\n      endpoint {\n        __typename\n        ... on WebhookHttpEndpoint {\n          callbackUrl\n        }\n      }\n    }\n    userErrors {\n      field\n      message\n    }\n  }\n}"
#### Graphql Input
{
  "topic": "ORDERS_CREATE",
  "webhookSubscription": {
    "callbackUrl": "https://example.org/endpoint",
    "format": "JSON",
    "includeFields": [
      "id",
      "note"
    ]
  }
}
#### Graphql Response
{
  "data": {
    "webhookSubscriptionCreate": {
      "webhookSubscription": {
        "id": "gid://shopify/WebhookSubscription/8589934629",
        "topic": "ORDERS_CREATE",
        "format": "JSON",
        "includeFields": [
          "id",
          "note"
        ],
        "endpoint": {
          "__typename": "WebhookHttpEndpoint",
          "callbackUrl": "https://example.org/endpoint"
        }
      },
      "userErrors": []
    }
  }
}