A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hey guys!
Looking to replace a script that previously used the depreciated acceptsMarketing when creating a customer. Essentially I'd like to create a customer who has given consent to be opted in.
mutation {
customerCreate(
input: {
email: "tes0910@example.com"
emailMarketingConsent: {
marketingState: SUBSCRIBED
marketingOptInLevel: SINGLE_OPT_IN
consentUpdatedAt: "2024-10-09T23:49:48Z"
}
}
) {
customer {
id
}
}
}
Customer record is being created, but still not opted in. I've tried "PENDING" as well, no luck.
Any ideas or advice would be most appreciated!
Solved! Go to the solution
This is an accepted solution.
Hi Jay, good point! Was using the latest 2024/10
I removed consentUpdatedAt and it works for me! Had been trying so many things but looks like the date was throwing it off for some reason
Thanks!
What API version are you using? I use essentially the same mutation and it works fine for me.
Are you on 2024-07 or later?
This is an accepted solution.
Hi Jay, good point! Was using the latest 2024/10
I removed consentUpdatedAt and it works for me! Had been trying so many things but looks like the date was throwing it off for some reason
Thanks!