Hi everyone,
I’m currently subscribing to the CUSTOMERS_MARKETING_CONSENT_UPDATE webhook topic and I would like to include extra fields in the payload — specifically the customer’s email.
According to the documentation, the default event payload looks like this:
{
"id": 706405506930370084,
"phone": null,
"sms_marketing_consent": {
"state": null,
"opt_in_level": null,
"consent_updated_at": null,
"consent_collected_from": "other"
}
}
From what I understand, it seems that this topic only returns these fields and nothing else.
However, I tried to use the includeFields parameter in my GraphQL mutation to request additional fields, like this (C# example):
mutation SubscribeToCustomersMarketingConsentUpdate {
webhookSubscriptionCreate(
topic: CUSTOMERS_MARKETING_CONSENT_UPDATE,
webhookSubscription: {
uri: "{webhookEndpoint}",
format: JSON,
includeFields: ["id", "email", "phone", "sms_marketing_consent"]
}
) {
webhookSubscription {
id
topic
includeFields
}
userErrors {
field
message
}
}
}
The subscription works, but the resulting payload still doesn’t include the email field.
My question:
Is it actually possible to include extra fields (like email) in a webhook for this topic, or are we limited to the default payload defined by Shopify for CUSTOMERS_MARKETING_CONSENT_UPDATE?
Thanks in advance!
(This question has been translated and formatted by ChatGPT)