# Discount codes, groups, and combination A discount code is a buyer-entered way to request a promotion. Creating a code does not create or attach a cart discount automatically. The discount must reference the intended code resource and its own rules must still match. ## Code and discount configuration The code resource contains its code strings and optional usage and validity limits. The cart discount defines eligibility, target, value, and whether a code is required. Keep those responsibilities separate when diagnosing a code that produces no saving. Check both schedules, the code-to-discount relationship, the cart predicate, and the target. The code may exist while the cart is below the threshold or has no eligible line. ## Overlapping offers Groups, ordering, stacking mode, and apply policy control how eligible cart discounts combine. Configure these explicitly when campaigns overlap. Test the combination you intend instead of depending on creation order or adding advertised percentages together. See [StackingMode](/api/admin-graphql/enums/stacking-mode) and [ApplyPolicy](/api/admin-graphql/enums/apply-policy) for supported choices. ## Limits can change before completion A code that was eligible when the cart was reviewed can fail later if its allowance has been consumed. Handle the returned business error and refresh the cart. Do not promise a saving until the response actually includes the relevant application. Use [Create a discount campaign](/guides/operations/discount-campaign) for creation, attachment, testing, and retirement of a code-backed offer.