extension not using latest api_version

Topic summary

Developers creating Shopify app extensions with cart-transform and product discount functions encounter a version mismatch issue. When generating extensions using shopify app generate extension, the created shopify.extension.toml file defaults to an older API version (2024-01 or 2024-04) despite the main app using a newer version (2024-04 or 2024-07).

The Problem:

  • Manually updating api_version in shopify.extension.toml doesn’t automatically update the generated TypeScript types
  • Newer API properties (like attributes in MergeOperation or CartLineTarget) remain unavailable
  • Simple rebuilding or regenerating doesn’t resolve the issue

The Solution:
After updating api_version in shopify.extension.toml, two additional commands are required:

  1. shopify app function schema - updates the schema
  2. shopify app function typegen - regenerates TypeScript types

This three-step process successfully updates the extension to use the specified API version and makes newer properties accessible. The issue is now resolved for the participants.

Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

Hi, im on the process on create an app extension with cart-transform functions. im facing the following problem when trying to update attributes when merging products.

First i create a shopify app with npm init @Shopify_77 [email removed] (Current Shopify CLI version: 3.60.1)

After setting that up a shopify.app.toml file is created that has api_version=‘2024-04’

Then upon creating and extension with shopify app generate extension, an extension is created, but within this one, the shopify.extension.toml file says it uses api_version="2024-01’ which is breaking my app because i require to use new properties that where introduced in 2024-04.

https://shopify.dev/docs/api/functions/reference/cart-transform/graphql/common-objects/mergeoperation

Im trying to use the attribute property of the mergeOperation. This exists in 2024-04 but not on 2024-01. Upon manually changing the api_version in shopify.extension.toml, i expect the file inside generated/api.ts to have the updated mergeOperation attributes allowing for me to use attributes field, but this is not happening.

How can i assure that my extension is in fact at the time of building and deploying using version 2024-04?

Thanks!

1 Like

I’m having a similar problem with a different function - particularly the product discount function.

The CartLineTarget isn’t available until 2024-07, but the default shopify app generate extension produces an extension with a shopify.extension.toml of 2024-04.

I attempted to update the api_version in the shopify.extension.toml to 2024-07 manually, then regenerated the GraphQL types, but no luck. Still stuck.

Then I tried rebuilding the extension, but again no update.

I found the solution, you need to update the schema after updating the api_version field.

Here’s the documentation on how to do that:

https://shopify.dev/docs/apps/build/functions/input-output#api-versions

  1. Update the api_version in your shopify.extension.toml file

  2. Run shopify app function schema

  3. Run shopify app function typegen

Then your extensions API version will be updated.

3 Likes

Thank you @dylanpierce . This was exactly what was needed.