> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexprice.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Credit Grants

> Every credit-grants command in the Flexprice CLI, with flags, required fields and examples.

## create

Create credit grant

| Flag                         | Type    | Required | Description                                                                                                                                                                                                                                                      |
| ---------------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--addon_id`                 | string  |          |                                                                                                                                                                                                                                                                  |
| `--cadence`                  | string  | yes      |                                                                                                                                                                                                                                                                  |
| `--conversion_rate`          | string  |          | amount in the currency = number of credits \* conversion\_rate ex if conversion\_rate is 1, then 1 USD = 1 credit ex if conversion\_rate is 2, then 1 USD = 0.5 credits ex if conversion\_rate is 0.5, then 1 USD = 2 credits                                    |
| `--credits`                  | string  | yes      |                                                                                                                                                                                                                                                                  |
| `--end_date`                 | string  |          |                                                                                                                                                                                                                                                                  |
| `--expiration_duration`      | integer |          |                                                                                                                                                                                                                                                                  |
| `--expiration_duration_unit` | string  |          |                                                                                                                                                                                                                                                                  |
| `--expiration_type`          | string  |          |                                                                                                                                                                                                                                                                  |
| `--name`                     | string  | yes      |                                                                                                                                                                                                                                                                  |
| `--period`                   | string  |          |                                                                                                                                                                                                                                                                  |
| `--period_count`             | integer |          |                                                                                                                                                                                                                                                                  |
| `--plan_id`                  | string  |          |                                                                                                                                                                                                                                                                  |
| `--priority`                 | integer |          |                                                                                                                                                                                                                                                                  |
| `--scope`                    | string  | yes      |                                                                                                                                                                                                                                                                  |
| `--start_date`               | string  |          |                                                                                                                                                                                                                                                                  |
| `--subscription_id`          | string  |          |                                                                                                                                                                                                                                                                  |
| `--topup_conversion_rate`    | string  |          | topup\_conversion\_rate is the conversion rate for the topup to the currency ex if topup\_conversion\_rate is 1, then 1 USD = 1 credit ex if topup\_conversion\_rate is 2, then 1 USD = 0.5 credits ex if topup\_conversion\_rate is 0.5, then 1 USD = 2 credits |

<Note>
  These fields are nested and cannot be set with flags. Use `--edit` to fill in a pre-built request body, or `--data @file.json`.

  * `metadata` (object)
</Note>

```sh theme={null}
flexprice credit-grants create --cadence=<value> --credits=<value> --name=<value> --scope=<value>
```

## delete

Delete credit grant

| Flag               | Type   | Required | Description                                                                                      |
| ------------------ | ------ | -------- | ------------------------------------------------------------------------------------------------ |
| `--effective_date` | string |          | EffectiveDate is optional; when set (subscription scope) the grant end date is set to this time. |

```sh theme={null}
flexprice credit-grants delete
```

## for-addon

Get addon credit grants

```sh theme={null}
flexprice credit-grants for-addon
```

## for-plan

Get plan credit grants

```sh theme={null}
flexprice credit-grants for-plan
```

## retrieve

Get credit grant

```sh theme={null}
flexprice credit-grants retrieve
```

## update

Update credit grant

| Flag         | Type   | Required |
| ------------ | ------ | -------- |
| `--end_date` | string |          |
| `--name`     | string |          |

<Note>
  These fields are nested and cannot be set with flags. Use `--edit` to fill in a pre-built request body, or `--data @file.json`.

  * `metadata` (object)
</Note>

```sh theme={null}
flexprice credit-grants update
```
