# BenefitsApi

All URIs are relative to *https://admin-api.connected.dev*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createBenefit**](#createbenefit) | **POST** /benefits | Create a benefit|
|[**deleteBenefit**](#deletebenefit) | **DELETE** /benefits/{benefitId} | Delete a benefit|
|[**getBenefit**](#getbenefit) | **GET** /benefits/{benefitId} | Get a benefit|
|[**getBenefitClicks**](#getbenefitclicks) | **GET** /benefits/{benefitId}/clicks | List a benefit\&#39;s click events|
|[**getBenefits**](#getbenefits) | **GET** /benefits | List benefits|
|[**updateBenefit**](#updatebenefit) | **PUT** /benefits/{benefitId} | Update a benefit|

# **createBenefit**
> CreateBenefit200Response createBenefit(benefitCreateInputs)

Creates a new member benefit for the organization (or an event, when scoped), requiring the \"create\" permission on benefits; the created benefit is returned and its list cache is invalidated.

### Example

```typescript
import {
    BenefitsApi,
    Configuration,
    BenefitCreateInputs
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new BenefitsApi(configuration);

let benefitCreateInputs: BenefitCreateInputs; //

const { status, data } = await apiInstance.createBenefit(
    benefitCreateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **benefitCreateInputs** | **BenefitCreateInputs**|  | |


### Return type

**CreateBenefit200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **deleteBenefit**
> CreateAccountInvitations200Response deleteBenefit()

Permanently deletes the benefit identified by benefitId, requiring the \"del\" permission on benefits, and clears the benefit from cached list and detail queries.

### Example

```typescript
import {
    BenefitsApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new BenefitsApi(configuration);

let benefitId: string; //The benefit identifier (default to undefined)

const { status, data } = await apiInstance.deleteBenefit(
    benefitId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **benefitId** | [**string**] | The benefit identifier | defaults to undefined|


### Return type

**CreateAccountInvitations200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getBenefit**
> CreateBenefit200Response getBenefit()

Returns the details of a single benefit by its ID; requires \"read\" permission on \"benefits\".

### Example

```typescript
import {
    BenefitsApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new BenefitsApi(configuration);

let benefitId: string; //The benefit identifier (default to undefined)

const { status, data } = await apiInstance.getBenefit(
    benefitId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **benefitId** | [**string**] | The benefit identifier | defaults to undefined|


### Return type

**CreateBenefit200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getBenefitClicks**
> GetBenefitClicks200Response getBenefitClicks()

Returns a paginated list of click-tracking records for the given benefit, supporting search and ordering; requires \"read\" permission on \"benefits\".

### Example

```typescript
import {
    BenefitsApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new BenefitsApi(configuration);

let benefitId: string; //The benefit identifier (default to undefined)
let page: number; //Page number (optional) (default to 1)
let pageSize: number; //Number of items per page (optional) (default to 25)
let orderBy: string; //Field to order by (optional) (default to undefined)
let search: string; //Search query (optional) (default to undefined)

const { status, data } = await apiInstance.getBenefitClicks(
    benefitId,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **benefitId** | [**string**] | The benefit identifier | defaults to undefined|
| **page** | [**number**] | Page number | (optional) defaults to 1|
| **pageSize** | [**number**] | Number of items per page | (optional) defaults to 25|
| **orderBy** | [**string**] | Field to order by | (optional) defaults to undefined|
| **search** | [**string**] | Search query | (optional) defaults to undefined|


### Return type

**GetBenefitClicks200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getBenefits**
> GetBenefits200Response getBenefits()

Returns a paginated list of benefits for the organization, optionally filtered to a specific event, with support for search and ordering; requires \"read\" permission on \"benefits\".

### Example

```typescript
import {
    BenefitsApi,
    Configuration
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new BenefitsApi(configuration);

let eventId: string; //Filter by eventId (optional) (default to undefined)
let page: number; //Page number (optional) (default to 1)
let pageSize: number; //Number of items per page (optional) (default to 25)
let orderBy: string; //Field to order by (optional) (default to undefined)
let search: string; //Search query (optional) (default to undefined)

const { status, data } = await apiInstance.getBenefits(
    eventId,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **eventId** | [**string**] | Filter by eventId | (optional) defaults to undefined|
| **page** | [**number**] | Page number | (optional) defaults to 1|
| **pageSize** | [**number**] | Number of items per page | (optional) defaults to 25|
| **orderBy** | [**string**] | Field to order by | (optional) defaults to undefined|
| **search** | [**string**] | Search query | (optional) defaults to undefined|


### Return type

**GetBenefits200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **updateBenefit**
> CreateBenefit200Response updateBenefit(benefitTranslationUpdateInputs)

Updates the fields of the benefit identified by benefitId, requiring the \"update\" permission on benefits, and returns the updated benefit.

### Example

```typescript
import {
    BenefitsApi,
    Configuration,
    BenefitTranslationUpdateInputs
} from '@connectedxm/admin-sdk';

const configuration = new Configuration();
const apiInstance = new BenefitsApi(configuration);

let benefitId: string; //The benefit identifier (default to undefined)
let benefitTranslationUpdateInputs: BenefitTranslationUpdateInputs; //

const { status, data } = await apiInstance.updateBenefit(
    benefitId,
    benefitTranslationUpdateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **benefitTranslationUpdateInputs** | **BenefitTranslationUpdateInputs**|  | |
| **benefitId** | [**string**] | The benefit identifier | defaults to undefined|


### Return type

**CreateBenefit200Response**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth), [OrganizationId](../README.md#OrganizationId)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | Successful response |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

