> 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](https://developer.firmhouse.com/graphql-api/api-reference/objects/apply-discount-code-input.md)!) | Parameters for ApplyDiscountCode |

### ApplyDiscountCodeInput Arguments

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

### Return fields

#### appliedPromotion ([AppliedPromotion](https://developer.firmhouse.com/graphql-api/api-reference/objects/applied-promotion.md))

#### cart ([Cart](https://developer.firmhouse.com/graphql-api/api-reference/objects/cart.md)!)

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