> For the complete documentation index, see [llms.txt](https://developer.firmhouse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.firmhouse.com/graphql-api/api-reference/mutations/apply-discount-code.md).

# applyDiscountCode

Applies a discount code to a cart.

### Arguments

| Argument                                                                                           | Description                      |
| -------------------------------------------------------------------------------------------------- | -------------------------------- |
| input ([ApplyDiscountCodeInput](/graphql-api/api-reference/objects/apply-discount-code-input.md)!) | Parameters for ApplyDiscountCode |

### ApplyDiscountCodeInput Arguments

| Argument                                                               | Description                                                                      |
| ---------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| discountCode ([String](/graphql-api/api-reference/objects/string.md)!) | The discount code to apply to the cart.                                          |
| subscriptionId ([ID](/graphql-api/api-reference/objects/id.md))        | ID of the subscription to update. Required when authenticated through a project. |

### Return fields

#### appliedPromotion ([AppliedPromotion](/graphql-api/api-reference/objects/applied-promotion.md))

#### cart ([Cart](/graphql-api/api-reference/objects/cart.md)!)

#### errors (\[[ModelValidationError](/graphql-api/api-reference/objects/model-validation-error.md)!]!)
