REST API adding metafields to products

barrya_
Visitor
2 0 2

I've noticed some unexpected behavior when adding a metafield to a product using the metafields REST API.

 

I'm making a POST to the following url: .../admin/api/2024-01/products/1234567890/metafields.json

 

I'm receiving a create (201) status code for each call, even if there is an existing matching metafield assigned to the product. I'd assumed I would receive an error if I attempted to add a metafield that existed. Is this by design, i.e. if you try to add an existing metafield it replaces the pre-existing?

 

Thanks

Replies 0 (0)