Access denied for cartTransformCreate field

We are currently having trouble running the cartTransformCreate function on our live Shopify Plus store. We followed the same processes on our partner development store, which we had no trouble with but our live store seems to be having some problems.

The GraphQL mutation we are trying to use:

mutation {
  cartTransformCreate(functionId: "XXXXXX") {
    cartTransform {
      id
      functionId
    }
    userErrors {
      field
      message
    }
  }
}

With functionId referenced from our new custom app’s .env file, that was created following the steps mentioned here: https://shopify.dev/docs/apps/selling-strategies/bundles/add-a-customized-bundle.

This always returns:
“Access denied for cartTransformCreate field. Required access: write_cart_transforms access scope. Also: The user must have products and preferences permission to create a cart transform function.”

We have tried running this function via:

  • Shopify GraphiQL app - With all Admin permissions given to the app, and used on both my staff account with the above errors’ mentioned user permissions and also the owner’s account.
  • CURL - Using a custom app access token that was installed on the store with all Admin permissions allowed(temporarily given all Admin Api permissions for testing).

My user’s permissions on the store:

GraphiQL temporarily opened all permissions (which has write_cart_transforms permission) to test:

Any help or advice would be greatly appreciated.

Thanks!

2 Likes

Hey @Tuckey

Has the store upgraded to Checkout Extensibility?

1 Like

Hi @SBD ,

Had to double check but yes it looks like it is turned on:

1 Like

@SBD Would one-page checkout being turned on possibly cause this error?

1 Like

Thanks @Tuckey Can you please DM me the store details?

In case anyone else has this issue and finds this post, some other apps can cause incompatibilities for Cart Transforms which SBD_ confirmed for me in DMs.

To find this I ran the below query:

{
  shop {
    features {
      bundles {
        eligibleForBundles
        sellsBundles
        ineligibilityReason
      }
    }
  }
}

Which returned “Shopify Bundles isn’t available yet for this store.”, which after Googling led me to finding SimpleBundles help article which stated that having certain apps installed can cause incompatibility.

In my case, I had one of these installed. So if you’re sure that you have the right permissions, and are blocked by:

"Access denied for cartTransformCreate field. Required access: `write_cart_transforms` access scope. Also: The user must have products and preferences permission to create a cart transform function."

You may have a similar issue.

2 Likes

To clarify were you able to uninstall one of those and that got you access to run your cartTransformCreate function?

“Shopify Bundles isn’t available yet for this store.”> > having certain apps installed can cause incompatibility

Interesting find, wild other ?apps? cause not just incompatibility, but it makes the api spit out a misleading error message that it’s a pending eligibility issue for a platform level feature that is available ; if uninstalls of third-party stuff resolves the issue.

I laughed hard when I read this in that Simplebundles article

Unpublish any Shopify Scripts that your store hasn't installed or **never had**.

Never had, what? :upside_down_face: rofl.

For anyone else getting this error, it is worth double checking your app permissions even if you specified them during install. In my case I installed GraphiQL with every access scope selected and I was still getting the “Access denied for cartTransformCreate field…” error, even though I had no conflicting apps installed. When I double checked the access scopes I found that none of them had been granted to GraphiQL for some reason. I re-installed the app and it worked fine. You can check all the app access scopes like this:

query {
    appInstallations(first: 25) {
      nodes {
        app {
          id
          title
        }
        accessScopes {
          handle
          description
        }
      }
    }
  }

As for the conflicting app issue, there are a few major apps on that list like Recharge. Many of our clients currently use Recharge as well as custom scripts in the Script Editor. They will need to switch from the Script Editor to cart transforms at some point soon, but they will still need to offer subscriptions. Does anyone know if/when this app conflict thing will be resolved?

1 Like

Recharge(our problematic app) updated within 2 weeks of me posting this post with an email stating that they were now compatible with Shopify Function Bundles, which thankfully allowed us to install our custom bundle code, so you should be fine on that front.

1 Like

Yes and no, Recharge(our problematic app) updated their app before we could test uninstalling/installing as it was a mission critical app for our store. Recharge sent out an email stating their compatibility with the new functions which resolved my create function error.

“Shopify Bundles isn’t available yet for this store.”> > having certain apps installed can cause incompatibility> > Interesting find, wild other ?apps? cause not just incompatibility, but it makes the api spit out a misleading error message that it’s a pending eligibility issue for a platform level feature that is available ; if uninstalls of third-party stuff resolves the issue.

Yep, probably the most frustrating part of the experience was the error reported was wrong, and not in line with the eligible query .

I feel that the error for cartTransformCreate should consider eligibility / compatibility before permissions in its checking too which would’ve saved a bit of time for me.

1 Like

Also to add to this: The permissions actually come from the ShopifyQL install - not your user account. So you may have to uninstall and reinstall ShopifyQl App with the cart_transform enabled in the ShopifyQl app permissions! ( Didn’t just waste 3 days trying to figure that out. )

1 Like

Is anyone find a solution to this issue?