# OrganizationEntitiesApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createOrganizationEntity**](#createorganizationentity) | **POST** /organization/entities | Create an organization legal entity|
|[**deleteOrganizationEntity**](#deleteorganizationentity) | **DELETE** /organization/entities/{entityId} | Delete an organization legal entity|
|[**getOrganizationEntities**](#getorganizationentities) | **GET** /organization/entities | List an organization\&#39;s legal entities|
|[**getOrganizationEntity**](#getorganizationentity) | **GET** /organization/entities/{entityId} | Get an organization legal entity|
|[**setPrimaryOrganizationEntity**](#setprimaryorganizationentity) | **POST** /organization/entities/{entityId}/primary | Set an organization legal entity as primary|
|[**updateOrganizationEntity**](#updateorganizationentity) | **PUT** /organization/entities/{entityId} | Update an organization legal entity|

# **createOrganizationEntity**
> CreateOrganizationEntity200Response createOrganizationEntity(organizationEntityCreateInputs)

Creates a legal entity that can sell on behalf of the organization, carrying its own registered address and VAT registration. The entity is not made primary on creation - use the set-primary route for that.

### Example

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

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

let organizationEntityCreateInputs: OrganizationEntityCreateInputs; //

const { status, data } = await apiInstance.createOrganizationEntity(
    organizationEntityCreateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **organizationEntityCreateInputs** | **OrganizationEntityCreateInputs**|  | |


### Return type

**CreateOrganizationEntity200Response**

### 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)

# **deleteOrganizationEntity**
> CreateAccountInvitations200Response deleteOrganizationEntity()

Permanently deletes a legal entity. The organization\'s primary entity can never be deleted - set another entity as primary first, which is also why an organization always retains at least one entity.

### Example

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

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

let entityId: string; //The entity identifier (default to undefined)

const { status, data } = await apiInstance.deleteOrganizationEntity(
    entityId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **entityId** | [**string**] | The entity 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)

# **getOrganizationEntities**
> GetOrganizationEntities200Response getOrganizationEntities()

Returns a paginated, searchable list of the legal entities that sell on behalf of the organization, each carrying its registered address and VAT registration.

### Example

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

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

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.getOrganizationEntities(
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **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

**GetOrganizationEntities200Response**

### 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)

# **getOrganizationEntity**
> CreateOrganizationEntity200Response getOrganizationEntity()

Retrieves a single legal entity by ID, including its registered address and VAT registration details.

### Example

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

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

let entityId: string; //The entity identifier (default to undefined)

const { status, data } = await apiInstance.getOrganizationEntity(
    entityId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **entityId** | [**string**] | The entity identifier | defaults to undefined|


### Return type

**CreateOrganizationEntity200Response**

### 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)

# **setPrimaryOrganizationEntity**
> CreateOrganizationEntity200Response setPrimaryOrganizationEntity()

Marks the specified entity as the organization\'s primary selling entity, clearing primary status from whichever entity held it before. This is the fallback entity used when an event has no entity of its own.

### Example

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

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

let entityId: string; //The entity identifier (default to undefined)

const { status, data } = await apiInstance.setPrimaryOrganizationEntity(
    entityId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **entityId** | [**string**] | The entity identifier | defaults to undefined|


### Return type

**CreateOrganizationEntity200Response**

### 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)

# **updateOrganizationEntity**
> CreateOrganizationEntity200Response updateOrganizationEntity(organizationEntityUpdateInputs)

Updates the identity, registered address or VAT registration of a legal entity. Primary status cannot be changed here - use the set-primary route.

### Example

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

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

let entityId: string; //The entity identifier (default to undefined)
let organizationEntityUpdateInputs: OrganizationEntityUpdateInputs; //

const { status, data } = await apiInstance.updateOrganizationEntity(
    entityId,
    organizationEntityUpdateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **organizationEntityUpdateInputs** | **OrganizationEntityUpdateInputs**|  | |
| **entityId** | [**string**] | The entity identifier | defaults to undefined|


### Return type

**CreateOrganizationEntity200Response**

### 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)

