Call createCart by graphql include discountCodes success but discountCodes not apply

Topic summary

A GraphQL createCart mutation successfully includes discount codes in the API response, showing them as applicable. However, these codes fail to apply when users reach the checkout page.

Key Details:

  • The implementation worked correctly until recently
  • Response indicates discountCodes are applicable
  • Screenshots show the GraphQL query/response and checkout page behavior

Suggested Solutions:

  1. Verify discount code compatibility with cartCreate API
  2. Explicitly pass discount codes in the checkout URL rather than relying solely on cart response
  3. Consider using checkoutCreate API as an alternative if not handling redirects manually

Status: The issue remains unresolved with one proposed workaround provided.

Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

Call createCart by graphql include discountCodes. Got success and discountCodes in response was applicable but not apply in checkout page. Some days ago, it work fine

1 Like

Hi,

Hope this will help

  • Make sure your discount code works with cartCreate
  • Don’t trust cart response only, and always pass discount code in checkout URL
  • Or use checkoutCreate API instead if you’re not redirecting manually