Solved

Problems trying to update the subscribed "topic"

DanielEFGS
Visitor
1 0 0

Greetings,

I have tried to make a PUT request to a webhook that I created, in order to modify the subscribed topic, as follows:

 

{
    "webhook": {
        "id": 1028087152804,
        "topic": "orders/create",
        "address": "https://xxxxxxx/api/shopify/response/31/",
        "format": "json"
    }
}

 

and I get the following response:

 

{
    "webhook": {
        "id": 1028087152804,
        "address": "https://xxxxxxx/api/shopify/response/31/",
        "topic": "orders/create",
        "created_at": "2021-04-16T12:53:32-04:00",
        "updated_at": "2021-04-19T09:41:33-04:00",
        "format": "json",
        "fields": [],
        "metafield_namespaces": [],
        "api_version": "2021-04",
        "private_metafield_namespaces": []
    }
}

 

As you can see, the answer is successful. Here comes the problem, making a GET request returns the initial value for "topic" (which is orders/fulfilled):

 

{
    "webhook": {
        "id": 1028087152804,
        "address": "https://xxxxxxx/api/shopify/response/31/",
        "topic": "orders/fulfilled",
        "created_at": "2021-04-16T12:53:32-04:00",
        "updated_at": "2021-04-19T09:41:33-04:00",
        "format": "json",
        "fields": [],
        "metafield_namespaces": [],
        "api_version": "2021-04",
        "private_metafield_namespaces": []
    }
}

 

 I tried with different versions of the API and there was no difference.

 

Accepted Solution (1)

james-langille
Shopify Staff (Retired)
70 15 27

This is an accepted solution.

Hello @DanielEFGS ,

Unfortunately, that endpoint does not update the topic as it says in the documentation. To keep consistency with the GraphQL mutations, I'll update the documentation, and if you want to change the topic that you're subscribing to, simply create a new subscription to that topic and delete the original.

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Reply 1 (1)

james-langille
Shopify Staff (Retired)
70 15 27

This is an accepted solution.

Hello @DanielEFGS ,

Unfortunately, that endpoint does not update the topic as it says in the documentation. To keep consistency with the GraphQL mutations, I'll update the documentation, and if you want to change the topic that you're subscribing to, simply create a new subscription to that topic and delete the original.

To learn more visit the Shopify Help Center or the Community Blog.