---
title: Compare-and-swap (CAS) for the Metafields API - Shopify developer changelog
description: >-
  Shopify’s developer changelog documents all changes to Shopify’s platform.
  Find the latest news and learn about new platform opportunities.
source_url:
  html: 'https://shopify.dev/changelog/compare-and-swap-cas-for-the-metafields-api'
  md: 'https://shopify.dev/changelog/compare-and-swap-cas-for-the-metafields-api.md'
metadata:
  effectiveApiVersion: 2024-07
  affectedApi:
    - displayName: Admin GraphQL API
      handle: admin-graphql
    - displayName: Customer Account API
      handle: customer-account-graphql
  primaryTag:
    displayName: API
    handle: api
  secondaryTag:
    displayName: Update
    handle: update
  indicatesActionRequired: false
  createdAt: '2024-05-29T14:35:43-04:00'
  postedAt: '2024-06-28T09:00:00-04:00'
  updatedAt: '2024-06-19T10:37:59-04:00'
  effectiveAt: '2024-06-28T09:00:00-04:00'
---

June 28, 2024

Tags:

* Admin GraphQL API
* Customer Account API
* 2024-07

# Compare-and-swap (CAS) for the Metafields API

As of GraphQL Admin and Customer Account APIs version `2024-07`, you can now set metafields using compare-and-swap (CAS) through the new `compareDigest` field for the `metafieldsSet` mutation.

Using CAS will add support to properly handle concurrency requests.
