Mass update customer metafields

Shopify Partner
20 0 3

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.

2 Likes
Shopify Staff
Shopify Staff
1558 78 233

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.

0 Likes
Highlighted
Shopify Partner
9 0 1

Can you please provide some sort of example?

 

I am trying to do something very similar with customers 

 

Thanks

0 Likes