Hi, I used to have a “legacy” custom private app and I had started using the GraphQL APi to register webhooks for it in particular these two topics: CHECKOUTS_CREATE and CHECKOUTS_UPDATE.
I’m now trying to do the same under the new Dev Dashboard. And I get GraphQL userError…
I get my access token with the following scopes…
{
"access_token": "shpat_...",
"scope": "write_checkouts,write_customers,customer_write_orders,unauthenticated_write_checkouts,unauthenticated_write_customers",
"expires_in": 86399
}
I added as my scopes as I could think of that would help…
Then I call the GraphQl mutation as I always did…
{
"query": "mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) { webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) { webhookSubscription { id topic callbackUrl format } userErrors { field message } } }",
"variables": {
"topic": "CHECKOUTS_CREATE",
"webhookSubscription": {
"callbackUrl": "https://.../shopify-webhook/checkouts/v1/action/_create",
"format": "JSON"
}
}
}
But I get the following error…
{
"data": {
"webhookSubscriptionCreate": {
"webhookSubscription": null,
"userErrors": [
{
"field": [
"webhookSubscription"
],
"message": "You cannot create a webhook subscription with the specified topic"
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 10,
"throttleStatus": {
"maximumAvailable": 4000.0,
"currentlyAvailable": 3990,
"restoreRate": 200.0
}
}
}
}
