--- title: >- The Storefront API's Cart object now exposes warnings for non-applicable discount codes - 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/add-warnings-for-discount-codes' md: 'https://shopify.dev/changelog/add-warnings-for-discount-codes.md' metadata: effectiveApiVersion: 2025-07 affectedApi: - displayName: Storefront GraphQL API handle: storefront-graphql primaryTag: displayName: API handle: api secondaryTag: displayName: New handle: new indicatesActionRequired: false createdAt: '2025-05-12T13:26:36-04:00' postedAt: '2025-05-22T12:00:00-04:00' updatedAt: '2025-05-16T14:06:09-04:00' effectiveAt: '2025-05-19T12:00:00-04:00' --- May 22, 2025 Tags: * Storefront GraphQL API * 2025-07 # The Storefront API's Cart object now exposes warnings for non-applicable discount codes As of version 2025-07 of the GraphQL Storefront API, the `Cart` object now provides detailed warnings for non-applicable [`CartDiscountCodes`](https://shopify.dev/docs/api/storefront/latest/objects/CartDiscountCode). Previously, when a discount code could not be applied, the `CartDiscountCode` was returned with `applicable: false`, and no additional details. This lack of information made it difficult for developers to provide helpful feedback to buyers. With the introduction of the new [`CartWarning`](https://shopify.dev/docs/api/storefront/2025-07/objects/CartWarning) types, you can now clearly identify the specific reasons why a discount code isn't applicable.