# FundingSourcesApi

All URIs are relative to *http://localhost:8889/api*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**sell**](#sell) | **POST** /fundingsources/{fundingSourceId}:sell | Performs the sell of a funding share owned by an investor. Investors can sell the total share or only a part of the investment. In case of a partial sale, multiple operations can be performed until the entire investment is sold. For the seller, money will be deposited in the funding account, for the buyers money will be withdrawn from provided accounts.|

# **sell**
> Array<DepositTransaction> sell(sellFundingSourceAction)


### Example

```typescript
import {
    FundingSourcesApi,
    Configuration,
    SellFundingSourceAction
} from './api';

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

let fundingSourceId: string; //Id/Encoded key of the funding source (default to undefined)
let sellFundingSourceAction: SellFundingSourceAction; //List of purchases containing details about buyer, price, amount
let idempotencyKey: string; //Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. (optional) (default to undefined)

const { status, data } = await apiInstance.sell(
    fundingSourceId,
    sellFundingSourceAction,
    idempotencyKey
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **sellFundingSourceAction** | **SellFundingSourceAction**| List of purchases containing details about buyer, price, amount | |
| **fundingSourceId** | [**string**] | Id/Encoded key of the funding source | defaults to undefined|
| **idempotencyKey** | [**string**] | Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. | (optional) defaults to undefined|


### Return type

**Array<DepositTransaction>**

### Authorization

[basic](../README.md#basic)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/vnd.mambu.v2+json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**102** | Your idempotent request was already submitted and is currently being processed, try again later. |  -  |
|**200** | Sell funding source action posted |  -  |
|**400** | A validation error occurred |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden |  -  |
|**404** | Funding source not found |  -  |

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

