# `Polarex.BenefitGrants`
[🔗](https://github.com/giusdp/polarex/blob/main/lib/polarex/operations/benefit_grants.ex#L1)

Provides API endpoints related to benefit grants

# `benefit_grants_list`

```elixir
@spec benefit_grants_list(opts :: keyword()) ::
  {:ok, Polarex.ListResourceBenefitGrant.t()}
  | {:error, Polarex.HTTPValidationError.t()}
```

List Benefit Grants

List benefit grants across all benefits accessible to the authenticated subject.

**Scopes**: `benefits:read` `benefits:write`

## Options

  * `organization_id`: Filter by organization ID.
  * `customer_id`: Filter by customer ID.
  * `external_customer_id`: Filter by customer external ID.
  * `is_granted`: Filter by granted status. If `true`, only granted benefits will be returned. If `false`, only revoked benefits will be returned. 
  * `page`: Page number, defaults to 1.
  * `limit`: Size of a page, defaults to 10. Maximum is 100.
  * `sorting`: Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order.

# `customer_portal_benefit_grants_get`

```elixir
@spec customer_portal_benefit_grants_get(id :: String.t(), opts :: keyword()) ::
  {:ok,
   Polarex.CustomerBenefitGrantCustom.t()
   | Polarex.CustomerBenefitGrantDiscord.t()
   | Polarex.CustomerBenefitGrantDownloadables.t()
   | Polarex.CustomerBenefitGrantFeatureFlag.t()
   | Polarex.CustomerBenefitGrantGitHubRepository.t()
   | Polarex.CustomerBenefitGrantLicenseKeys.t()
   | Polarex.CustomerBenefitGrantMeterCredit.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}
```

Get Benefit Grant

Get a benefit grant by ID for the authenticated customer.

**Scopes**: `customer_portal:read` `customer_portal:write`

# `customer_portal_benefit_grants_list`

```elixir
@spec customer_portal_benefit_grants_list(opts :: keyword()) ::
  {:ok, Polarex.ListResourceCustomerBenefitGrant.t()}
  | {:error, Polarex.HTTPValidationError.t()}
```

List Benefit Grants

List benefits grants of the authenticated customer.

**Scopes**: `customer_portal:read` `customer_portal:write`

## Options

  * `query`: Filter by benefit description.
  * `type`: Filter by benefit type.
  * `benefit_id`: Filter by benefit ID.
  * `checkout_id`: Filter by checkout ID.
  * `order_id`: Filter by order ID.
  * `subscription_id`: Filter by subscription ID.
  * `member_id`: Filter by member ID.
  * `page`: Page number, defaults to 1.
  * `limit`: Size of a page, defaults to 10. Maximum is 100.
  * `sorting`: Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign `-` before the criteria name to sort by descending order.

# `customer_portal_benefit_grants_update`

```elixir
@spec customer_portal_benefit_grants_update(
  id :: String.t(),
  body ::
    Polarex.CustomerBenefitGrantCustomUpdate.t()
    | Polarex.CustomerBenefitGrantDiscordUpdate.t()
    | Polarex.CustomerBenefitGrantDownloadablesUpdate.t()
    | Polarex.CustomerBenefitGrantFeatureFlagUpdate.t()
    | Polarex.CustomerBenefitGrantGitHubRepositoryUpdate.t()
    | Polarex.CustomerBenefitGrantLicenseKeysUpdate.t()
    | Polarex.CustomerBenefitGrantMeterCreditUpdate.t(),
  opts :: keyword()
) ::
  {:ok,
   Polarex.CustomerBenefitGrantCustom.t()
   | Polarex.CustomerBenefitGrantDiscord.t()
   | Polarex.CustomerBenefitGrantDownloadables.t()
   | Polarex.CustomerBenefitGrantFeatureFlag.t()
   | Polarex.CustomerBenefitGrantGitHubRepository.t()
   | Polarex.CustomerBenefitGrantLicenseKeys.t()
   | Polarex.CustomerBenefitGrantMeterCredit.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.NotPermitted.t()
     | Polarex.ResourceNotFound.t()}
```

Update Benefit Grant

Update a benefit grant for the authenticated customer.

**Scopes**: `customer_portal:write`

## Request Body

**Content Types**: `application/json`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
