The ApiVersion::LATEST constant has been removed to prevent semantic versioning (semver) breaking changes. Previously, this constant would automatically update every quarter when new API versions were released, causing unintended breaking changes for apps.
If you were using the constant directly:
// Before (v5 and earlier)
$apiVersion = ApiVersion::LATEST;
// After (v6+)
$apiVersion = '2025-07'; // Explicitly specify the version you want to useIn your Context::initialize():
The apiVersion parameter is now required in Context::initialize(). You must explicitly specify which API version you want to use:
// Before (v5 and earlier)
Context::initialize(
apiKey: $_ENV['SHOPIFY_API_KEY'],
apiSecretKey: $_ENV['SHOPIFY_API_SECRET'],
scopes: $_ENV['SHOPIFY_APP_SCOPES'],
hostName: $_ENV['SHOPIFY_APP_HOST_NAME'],
sessionStorage: new FileSessionStorage('/tmp/php_sessions'),
// apiVersion was optional with default ApiVersion::LATEST
);
// After (v6+)
Context::initialize(
apiKey: $_ENV['SHOPIFY_API_KEY'],
apiSecretKey: $_ENV['SHOPIFY_API_SECRET'],
scopes: $_ENV['SHOPIFY_APP_SCOPES'],
hostName: $_ENV['SHOPIFY_APP_HOST_NAME'],
sessionStorage: new FileSessionStorage('/tmp/php_sessions'),
apiVersion: '2025-07', // Now required - explicitly specify the version
);Finding the right API version:
You can reference the available API versions in the ApiVersion class:
use Shopify\ApiVersion;
// Available constants (as of this release):
ApiVersion::UNSTABLE // "unstable"
ApiVersion::JULY_2025 // "2025-07"
ApiVersion::APRIL_2025 // "2025-04"
ApiVersion::JANUARY_2025 // "2025-01"
ApiVersion::OCTOBER_2024 // "2024-10"
// ... and older versionsOr you can use string literals directly:
Context::initialize(
// ... other parameters
apiVersion: '2025-07',
);Why this change?
By requiring explicit version specification, apps can:
- Control when they upgrade to new API versions
- Test thoroughly before upgrading
- Avoid unexpected breaking changes from automatic version updates
- Follow semantic versioning principles more accurately
Recommended approach:
- Review the Shopify API Changelog to understand changes between versions
- Choose the API version that best suits your app's needs
- Explicitly specify that version in your
Context::initialize()call - Test your app thoroughly with the chosen version
- Upgrade to newer versions on your own schedule after proper testing