# createDiscountCode

### Arguments

| Argument                                                                                                                                                        | Description                       |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| input ([CreateDiscountCodeInput](https://developer.firmhouse.com/~/changes/v7t3tfYrVBDkXZZGoQGP/graphql-api/api-reference/objects/create-discount-code-input)!) | Parameters for CreateDiscountCode |

### CreateDiscountCodeInput Arguments

| Argument                                                                                                                     | Description                                                                         |
| ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| metadata ([JSON](https://developer.firmhouse.com/~/changes/v7t3tfYrVBDkXZZGoQGP/graphql-api/api-reference/objects/json))     | Metadata that can be used by developers to store additional information on objects. |
| promotionId ([ID](https://developer.firmhouse.com/~/changes/v7t3tfYrVBDkXZZGoQGP/graphql-api/api-reference/objects/id)!)     | The promotion to attach to this discount code                                       |
| code ([String](https://developer.firmhouse.com/~/changes/v7t3tfYrVBDkXZZGoQGP/graphql-api/api-reference/objects/string)!)    | The code that can be applied when creating a subscription                           |
| maxTimesUsed ([Int](https://developer.firmhouse.com/~/changes/v7t3tfYrVBDkXZZGoQGP/graphql-api/api-reference/objects/int)!)  | The max times this discount code can be used                                        |
| autoSelectPlanId ([ID](https://developer.firmhouse.com/~/changes/v7t3tfYrVBDkXZZGoQGP/graphql-api/api-reference/objects/id)) | The discount code can only be applied to this plan                                  |

### Return fields

#### discountCode ([DiscountCode](https://developer.firmhouse.com/~/changes/v7t3tfYrVBDkXZZGoQGP/graphql-api/api-reference/objects/discount-code))

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