Cart transform API and discount codes

Topic summary

A developer is trying to detect applied discount codes using the Cart Transform API but encountering limitations.

The Problem:

  • The RunInput query being used doesn’t reflect discount amounts when customers enter coupon codes
  • This differs from Cart & Checkout Validation, where discount amounts are visible
  • The developer cannot determine whether discounts are being applied at checkout

Current Approach:
They’re querying cart line items with fields including:

  • Line item ID, quantity, and cost details
  • Product variants and merchandise information
  • Various amount fields (total, subtotal, per-quantity amounts)
  • Currency codes

Status: The issue remains unresolved with no responses yet. The developer needs guidance on accessing discount information through the Cart Transform API.

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

Hello!

I’m looking for a way to access to discounts which will be applied to a line item using Cart Transform.
I’m using the following RunInput, but, unlike Cart & Checkout Validation, the amounts do not vary when the user enters discount coupons. Which does not allow me to detect if they are applying discounts at checkout or not.

query RunInput {
  cart {
    lines {
      id
      quantity
      cost {
        amountPerQuantity {
          amount
          currencyCode
        }
        compareAtAmountPerQuantity  {
          amount
          currencyCode
        }
        subtotalAmount  {
          amount
          currencyCode
        }
        totalAmount  {
          amount
          currencyCode
        }
      }
      merchandise {
        ... on ProductVariant {
          id
        }
      }
    }
  }
}