Request custom fields in Webhook

benkweller
Visitor
1 0 0

I've seen this listed elsewhere on the forum but haven't seen a clear answer.

1. Our webhook is firing.
2. Zoho CRM is receiving the data except the data is the stock Shopify data.
3. we need to retrieve additional metafields from 3rd party app "Customer Fields". 

I've been speaking with Kyle in Customer Fields support team, this is what he said:

"You can retrieve the non-Shopify custom fields as long as the metafields property is specified when accessing the data: https://shopify.dev/docs/admin-api/rest/reference/events/webhook?api[version]=2020-04#properties-202...
Our app saves all of the custom data in a single JSON string, using the namespace of customer_fields 
For Shopify's webhooks, the event/topics that you will want to subscribe to are customers/create and customers/update.
You'll want to make sure that your request includes a parameter for the metafield_namespaces property, since the custom data from our app is saved in Shopify's metafields. Our app uses customer_fields as the namespace for customer metafields."

Thanks for any help/tips here. All i want is to collect my customers' birthdays! hahaha should be easy. so i thought...

Replies 7 (7)

michael-helium
Shopify Expert
361 5 178

Hi @benkweller,

Michael here from Customer Fields. Are you aware of the Zapier integration coming soon? You can request beta access here: https://customr.myshopify.com/pages/zapier-beta-signup

If all else fails, Zapier should be a surefire way to get that data into Zoho.

Michael, COO @ Helium
- Customer Fields ✪✪✪✪✪ (346 reviews)
- Meteor Mega Menu ✪✪✪✪✪ (265 reviews)

norabrowndesign
Shopify Partner
9 0 2

Did you ever find a solution for this, other than the Customer Fields Zapier integration (which I think is only available on the most expensive plan?)

When creating a webhook within the Shopify Admin UI, there are very limited options -- basically only the URL to POST to and what to subscribe to. I'd like to subscribe to the customer create and updated hooks and have some metafields included. Can anyone help with how to accomplish this?

Gregarican
Shopify Partner
1033 86 285

If this isn't available out-of-the-box, when you receive the webhook you could just perform an API request back to Shopify to pull the metafields you need associated with the record ID passed to you in the originating webhook. I know that's just another step and not a one-shot solution. But it works while you're waiting for webhooks to have extended functionality they don't currently have...

SB_90
Shopify Partner
216 52 68

From what I've read you'll need a PUT request to the relevant webhook ID subscription to modify the data that is sent with that webhook.

Something like...

PUT /admin/api/2020-07/webhooks/[webhookid123].json

With a body of:

{
  "webhook"
: {
    "id": "webhookid123",
    "metafield_namespaces": [
         "namespace_name"
     ]

 }
}

Just my reading of the docs though - I'm not at a laptop to test this...

norabrowndesign
Shopify Partner
9 0 2

I think I sorted my issue, but it would be helpful to fully understand this. So this would just be a one-time PUT request to modify a webhook I've already created via the Shopify Admin -- am I understanding that right? How would such a request be authenticated? With a developer API key?

Thanks for this.

norabrowndesign
Shopify Partner
9 0 2

Good point! If I can't figure out another solution this would work for now.

mattrose
Shopify Staff (Retired)
12 4 6

Sorry, there's currently no way to configure the metafields that you would like returned with the webhook via the Shopify Admin UI. You can, however, do this if you create the webhook via the Admin API. This is done using the metafieldNamespaces input for the GraphQL API and the metafield_namespaces property for the REST API. I hope this helps.

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