# MarketplaceApi

All URIs are relative to *http://localhost:8080/api/v1*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**apiV1MarketplaceDownloadProductIdGet**](#apiv1marketplacedownloadproductidget) | **GET** /api/v1/marketplace/download/{product_id} | Get download URL|
|[**apiV1MarketplaceOrdersGet**](#apiv1marketplaceordersget) | **GET** /api/v1/marketplace/orders | List user orders|
|[**apiV1MarketplaceOrdersIdGet**](#apiv1marketplaceordersidget) | **GET** /api/v1/marketplace/orders/{id} | Get order details|
|[**apiV1MarketplaceOrdersPost**](#apiv1marketplaceorderspost) | **POST** /api/v1/marketplace/orders | Create a new order|
|[**apiV1MarketplaceProductsGet**](#apiv1marketplaceproductsget) | **GET** /api/v1/marketplace/products | List products|
|[**apiV1MarketplaceProductsIdPut**](#apiv1marketplaceproductsidput) | **PUT** /api/v1/marketplace/products/{id} | Update a product|
|[**apiV1MarketplaceProductsPost**](#apiv1marketplaceproductspost) | **POST** /api/v1/marketplace/products | Create a new product|

# **apiV1MarketplaceDownloadProductIdGet**
> { [key: string]: string; } apiV1MarketplaceDownloadProductIdGet()

Get a secure download URL for a purchased product

### Example

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

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

let productId: string; //Product ID (default to undefined)

const { status, data } = await apiInstance.apiV1MarketplaceDownloadProductIdGet(
    productId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **productId** | [**string**] | Product ID | defaults to undefined|


### Return type

**{ [key: string]: string; }**

### Authorization

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

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**403** | No license |  -  |
|**404** | 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)

# **apiV1MarketplaceOrdersGet**
> Array<VezaBackendApiInternalCoreMarketplaceOrder> apiV1MarketplaceOrdersGet()

Get all orders for the authenticated user

### Example

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

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

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

### Parameters
This endpoint does not have any parameters.


### Return type

**Array<VezaBackendApiInternalCoreMarketplaceOrder>**

### Authorization

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

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**401** | Unauthorized |  -  |
|**500** | Internal Error |  -  |

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

# **apiV1MarketplaceOrdersIdGet**
> VezaBackendApiInternalCoreMarketplaceOrder apiV1MarketplaceOrdersIdGet()

Get details of a specific order (only order owner can access)

### Example

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

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

let id: string; //Order ID (default to undefined)

const { status, data } = await apiInstance.apiV1MarketplaceOrdersIdGet(
    id
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **id** | [**string**] | Order ID | defaults to undefined|


### Return type

**VezaBackendApiInternalCoreMarketplaceOrder**

### Authorization

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

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**400** | Validation Error |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden - Not order owner |  -  |
|**404** | Order 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)

# **apiV1MarketplaceOrdersPost**
> VezaBackendApiInternalCoreMarketplaceOrder apiV1MarketplaceOrdersPost(order)

Purchase products

### Example

```typescript
import {
    MarketplaceApi,
    Configuration,
    InternalHandlersCreateOrderRequest
} from './api';

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

let order: InternalHandlersCreateOrderRequest; //Order items

const { status, data } = await apiInstance.apiV1MarketplaceOrdersPost(
    order
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **order** | **InternalHandlersCreateOrderRequest**| Order items | |


### Return type

**VezaBackendApiInternalCoreMarketplaceOrder**

### Authorization

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

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**201** | Created |  -  |
|**400** | Validation Error |  -  |
|**401** | Unauthorized |  -  |

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

# **apiV1MarketplaceProductsGet**
> Array<VezaBackendApiInternalCoreMarketplaceProduct> apiV1MarketplaceProductsGet()

List marketplace products with filters

### Example

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

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

let status: string; //Product status (optional) (default to undefined)
let sellerId: string; //Seller ID (optional) (default to undefined)
let q: string; //Search query (optional) (default to undefined)
let type: string; //Product type (track, pack, service) (optional) (default to undefined)
let minPrice: number; //Minimum price (optional) (default to undefined)
let maxPrice: number; //Maximum price (optional) (default to undefined)
let page: number; //Page number (optional) (default to undefined)
let limit: number; //Items per page (optional) (default to undefined)

const { status, data } = await apiInstance.apiV1MarketplaceProductsGet(
    status,
    sellerId,
    q,
    type,
    minPrice,
    maxPrice,
    page,
    limit
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **status** | [**string**] | Product status | (optional) defaults to undefined|
| **sellerId** | [**string**] | Seller ID | (optional) defaults to undefined|
| **q** | [**string**] | Search query | (optional) defaults to undefined|
| **type** | [**string**] | Product type (track, pack, service) | (optional) defaults to undefined|
| **minPrice** | [**number**] | Minimum price | (optional) defaults to undefined|
| **maxPrice** | [**number**] | Maximum price | (optional) defaults to undefined|
| **page** | [**number**] | Page number | (optional) defaults to undefined|
| **limit** | [**number**] | Items per page | (optional) defaults to undefined|


### Return type

**Array<VezaBackendApiInternalCoreMarketplaceProduct>**

### Authorization

No authorization required

### HTTP request headers

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


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

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

# **apiV1MarketplaceProductsIdPut**
> VezaBackendApiInternalCoreMarketplaceProduct apiV1MarketplaceProductsIdPut(product)

Update product details (only seller can update)

### Example

```typescript
import {
    MarketplaceApi,
    Configuration,
    InternalHandlersUpdateProductRequest
} from './api';

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

let id: string; //Product ID (default to undefined)
let product: InternalHandlersUpdateProductRequest; //Product updates

const { status, data } = await apiInstance.apiV1MarketplaceProductsIdPut(
    id,
    product
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **product** | **InternalHandlersUpdateProductRequest**| Product updates | |
| **id** | [**string**] | Product ID | defaults to undefined|


### Return type

**VezaBackendApiInternalCoreMarketplaceProduct**

### Authorization

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

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**400** | Validation Error |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden - Not product owner |  -  |
|**404** | Product 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)

# **apiV1MarketplaceProductsPost**
> VezaBackendApiInternalCoreMarketplaceProduct apiV1MarketplaceProductsPost(product)

Create a product (Track, Pack, Service) for sale

### Example

```typescript
import {
    MarketplaceApi,
    Configuration,
    InternalHandlersCreateProductRequest
} from './api';

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

let product: InternalHandlersCreateProductRequest; //Product info

const { status, data } = await apiInstance.apiV1MarketplaceProductsPost(
    product
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **product** | **InternalHandlersCreateProductRequest**| Product info | |


### Return type

**VezaBackendApiInternalCoreMarketplaceProduct**

### Authorization

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

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**201** | Created |  -  |
|**400** | Validation Error |  -  |
|**401** | Unauthorized |  -  |

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

