# InvoicesApi

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

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**createInvoice**](#createinvoice) | **POST** /invoices | Create an invoice|
|[**deleteInvoice**](#deleteinvoice) | **DELETE** /invoices/{invoiceId} | Delete an invoice|
|[**getInvoice**](#getinvoice) | **GET** /invoices/{invoiceId} | Get an invoice|
|[**getInvoiceLineItem**](#getinvoicelineitem) | **GET** /invoices/{invoiceId}/items/{lineItemId} | Get an invoice line item|
|[**getInvoiceLineItems**](#getinvoicelineitems) | **GET** /invoices/{invoiceId}/items | List an invoice\&#39;s line items|
|[**getInvoicePayments**](#getinvoicepayments) | **GET** /invoices/{invoiceId}/payments | List an invoice\&#39;s payments|
|[**getInvoices**](#getinvoices) | **GET** /invoices | List invoices|
|[**sendInvoice**](#sendinvoice) | **PUT** /invoices/{invoiceId}/send | Send an invoice|
|[**updateInvoice**](#updateinvoice) | **PUT** /invoices/{invoiceId} | Update an invoice|
|[**voidInvoice**](#voidinvoice) | **PUT** /invoices/{invoiceId}/void | Void an invoice|

# **createInvoice**
> CreateInvoice200Response createInvoice(invoiceCreateInputs)

Creates a new invoice for the organization, optionally linked to an account, event, and payment integration, and requires the \"create\" permission on invoices.

### Example

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

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

let invoiceCreateInputs: InvoiceCreateInputs; //

const { status, data } = await apiInstance.createInvoice(
    invoiceCreateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **invoiceCreateInputs** | **InvoiceCreateInputs**|  | |


### Return type

**CreateInvoice200Response**

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

# **deleteInvoice**
> CreateAccountInvitations200Response deleteInvoice()

Permanently deletes the specified invoice from the organization and requires the \"delete\" permission on invoices.

### Example

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

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

let invoiceId: string; //The invoice identifier (default to undefined)

const { status, data } = await apiInstance.deleteInvoice(
    invoiceId
);
```

### Parameters

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

# **getInvoice**
> CreateInvoice200Response getInvoice()

Retrieves a single invoice by ID or alternate ID for the organization, including its line items, and requires the \"read\" permission on invoices.

### Example

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

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

let invoiceId: string; //The invoice identifier (default to undefined)

const { status, data } = await apiInstance.getInvoice(
    invoiceId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **invoiceId** | [**string**] | The invoice identifier | defaults to undefined|


### Return type

**CreateInvoice200Response**

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

# **getInvoiceLineItem**
> CreateInvoiceLineItem200Response getInvoiceLineItem()

Retrieves a single line item belonging to the given invoice by its ID, and requires the \"read\" permission on invoices.

### Example

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

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

let invoiceId: string; //The invoice identifier (default to undefined)
let lineItemId: string; //The lineItem identifier (default to undefined)

const { status, data } = await apiInstance.getInvoiceLineItem(
    invoiceId,
    lineItemId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **invoiceId** | [**string**] | The invoice identifier | defaults to undefined|
| **lineItemId** | [**string**] | The lineItem identifier | defaults to undefined|


### Return type

**CreateInvoiceLineItem200Response**

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

# **getInvoiceLineItems**
> GetInvoiceLineItems200Response getInvoiceLineItems()

Returns a paginated list of line items belonging to the given invoice, with optional search across item name and description and ordering; requires the read permission on invoices.

### Example

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

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

let invoiceId: string; //The invoice 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.getInvoiceLineItems(
    invoiceId,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **invoiceId** | [**string**] | The invoice 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

**GetInvoiceLineItems200Response**

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

# **getInvoicePayments**
> GetAccountPayments200Response getInvoicePayments()

Returns a paginated list of payments recorded against the given invoice, with optional search and ordering; requires the read permission on invoices.

### Example

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

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

let invoiceId: string; //The invoice 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.getInvoicePayments(
    invoiceId,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **invoiceId** | [**string**] | The invoice 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

**GetAccountPayments200Response**

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

# **getInvoices**
> GetInvoices200Response getInvoices()

Returns a paginated list of invoices for the organization, optionally filtered by status, account, or event, with search and ordering support; requires the read permission on invoices.

### Example

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

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

let accountId: string; //Filter by accountId (optional) (default to undefined)
let eventId: string; //Filter by eventId (optional) (default to undefined)
let status: InvoiceStatus; //Filter by status (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.getInvoices(
    accountId,
    eventId,
    status,
    page,
    pageSize,
    orderBy,
    search
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] | Filter by accountId | (optional) defaults to undefined|
| **eventId** | [**string**] | Filter by eventId | (optional) defaults to undefined|
| **status** | **InvoiceStatus** | Filter by status | (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

**GetInvoices200Response**

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

# **sendInvoice**
> CreateInvoice200Response sendInvoice()

Marks a draft or void invoice as sent, requiring it to already have an account and at least one line item, and requires the \"update\" permission on invoices.

### Example

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

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

let invoiceId: string; //The invoice identifier (default to undefined)

const { status, data } = await apiInstance.sendInvoice(
    invoiceId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **invoiceId** | [**string**] | The invoice identifier | defaults to undefined|


### Return type

**CreateInvoice200Response**

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

# **updateInvoice**
> CreateInvoice200Response updateInvoice(invoiceUpdateInputs)

Updates the fields of an existing, unpaid invoice such as its account, event, payment integration, or status, and requires the \"update\" permission on invoices.

### Example

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

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

let invoiceId: string; //The invoice identifier (default to undefined)
let invoiceUpdateInputs: InvoiceUpdateInputs; //

const { status, data } = await apiInstance.updateInvoice(
    invoiceId,
    invoiceUpdateInputs
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **invoiceUpdateInputs** | **InvoiceUpdateInputs**|  | |
| **invoiceId** | [**string**] | The invoice identifier | defaults to undefined|


### Return type

**CreateInvoice200Response**

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

# **voidInvoice**
> CreateInvoice200Response voidInvoice()

Marks a previously sent invoice as void, which is only allowed while the invoice\'s status is \"sent\", and requires the \"update\" permission on invoices.

### Example

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

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

let invoiceId: string; //The invoice identifier (default to undefined)

const { status, data } = await apiInstance.voidInvoice(
    invoiceId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **invoiceId** | [**string**] | The invoice identifier | defaults to undefined|


### Return type

**CreateInvoice200Response**

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

