Mass update customer metafields

Matt_Werdean
Shopify Partner
20 0 6

Each customer I have has a year metafield that needs to be updated to the next year. The problem is, I have to pull the customers,  get their id, individually pull the metafields for each customer, then send an updated year based on their previous year.  Is there not a way I can pull all customers with their metafields and then send back the updated object? It takes a long time and a lot of api calls to get this simple task done.

Replies 2 (2)

Alex
Shopify Staff
1561 81 341

Hey Matt,

 

Although we don't have a mechanism for bulk updating these metafields across different customer resources, you could consider leveraging the GraphQL admin API where the mutations should be more efficient, granting you more throughput than with REST (assuming rate limiting is part of your problem). You could even use REST in tandem with GraphQL for even more throughput as well.

 

I hope that helps a bit.

 

Cheers.

Alex | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

JacksonHowell
Shopify Partner
10 0 4

Can you please provide some sort of example?

 

I am trying to do something very similar with customers 

 

Thanks