Register customer webhooks

How register customer webhooks? Because this mutation schema works for accounts, I use 3PL acc.

mutation {
  webhook_create(data: { 
    name: "PO Update", 
    url: "https://someValidURL.com/webhook" 
  }) {
    request_id
    complexity
    webhook {
      name
      url
    }
  }
}

Hi,
The mutation to register a webhook could be:
mutation {
webhook_create(data: {
name: “PO Update”,
url: “https://someValidURL.com/webhook
}) {
request_id
complexity
webhook {
name
url
}
}
}

and should be added to the child account.

How to assign webhook to customer. Because different customers can have different webhooks with just seperate customer_id in url path.

Hi,
You can sign in with the 3PL and then add the customer_account_id in the data:

 mutation {
      webhook_create(
        data: {
          name: "PO Update"
          url: "https://someValidURL.com/webhook"
          customer_account_id: "customer_id"
        }
      ) {
        request_id
        complexity
        webhook {
          name
          url
        }
      }
    }

By the way, how check if registered webhooks are closed because with query from doc, doesn’t show. I tried with query via Altair IDE.

This is the query for all registered webhooks.

    query {
      webhooks {
        request_id
        complexity
        data {
          edges {
            node {
              id
              legacy_id
              account_id
              shop_name
              name
              url
              source
            }
          }
        }
      }
    }

How to check if registered webhooks are closed, or in other what field represents that?

Hi @LancyBark!
Once webhooks are registered they should be triggering, if you would like to close them, the only way is to un-register them by using the Webhook delete mutation> Webhooks – Developer Resources | ShipHero

Please let us know if that doesn’t help or if there is anything else we could help with,
Thanks!
Tom