# SdPublicProdApi.TradeEndpointsApi

All URIs are relative to *https://core-api.stardust.gg/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**tradeAcceptPost**](TradeEndpointsApi.md#tradeAcceptPost) | **POST** /trade/accept | Accept Trade
[**tradeCancelDelete**](TradeEndpointsApi.md#tradeCancelDelete) | **DELETE** /trade/cancel | Cancel Trade
[**tradeExecutePost**](TradeEndpointsApi.md#tradeExecutePost) | **POST** /trade/execute | Execute Trade
[**tradeGetAllGet**](TradeEndpointsApi.md#tradeGetAllGet) | **GET** /trade/get-all | Get All Trades
[**tradeGetGet**](TradeEndpointsApi.md#tradeGetGet) | **GET** /trade/get | Get Trade
[**tradeOfferPost**](TradeEndpointsApi.md#tradeOfferPost) | **POST** /trade/offer | Offer Trade

<a name="tradeAcceptPost"></a>
# **tradeAcceptPost**
> Empty tradeAcceptPost(body)

Accept Trade

Accept a Trade

### Example
```javascript
import {SdPublicProdApi} from 'sd_public_prod_api';
let defaultClient = SdPublicProdApi.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SdPublicProdApi.TradeEndpointsApi();
let body = new SdPublicProdApi.SDTradeAcceptRequest(); // SDTradeAcceptRequest | 

apiInstance.tradeAcceptPost(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SDTradeAcceptRequest**](SDTradeAcceptRequest.md)|  | 

### Return type

[**Empty**](Empty.md)

### Authorization

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

### HTTP request headers

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

<a name="tradeCancelDelete"></a>
# **tradeCancelDelete**
> Empty tradeCancelDelete(tradeId, cancelled)

Cancel Trade

Cancels a Trade

### Example
```javascript
import {SdPublicProdApi} from 'sd_public_prod_api';
let defaultClient = SdPublicProdApi.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SdPublicProdApi.TradeEndpointsApi();
let tradeId = "tradeId_example"; // String | Trade Id unsigned 32 bit integer
let cancelled = "cancelled_example"; // String | A boolean value to accept or deny a trade

apiInstance.tradeCancelDelete(tradeId, cancelled, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **tradeId** | **String**| Trade Id unsigned 32 bit integer | 
 **cancelled** | **String**| A boolean value to accept or deny a trade | 

### Return type

[**Empty**](Empty.md)

### Authorization

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

### HTTP request headers

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

<a name="tradeExecutePost"></a>
# **tradeExecutePost**
> Empty tradeExecutePost(body)

Execute Trade

Executes a Given Trade

### Example
```javascript
import {SdPublicProdApi} from 'sd_public_prod_api';
let defaultClient = SdPublicProdApi.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SdPublicProdApi.TradeEndpointsApi();
let body = new SdPublicProdApi.SDTradeExecuteRequest(); // SDTradeExecuteRequest | 

apiInstance.tradeExecutePost(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SDTradeExecuteRequest**](SDTradeExecuteRequest.md)|  | 

### Return type

[**Empty**](Empty.md)

### Authorization

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

### HTTP request headers

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

<a name="tradeGetAllGet"></a>
# **tradeGetAllGet**
> SDTradeGetAllResponses tradeGetAllGet(start, limit, opts)

Get All Trades

Get the List of Game Trades

### Example
```javascript
import {SdPublicProdApi} from 'sd_public_prod_api';
let defaultClient = SdPublicProdApi.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SdPublicProdApi.TradeEndpointsApi();
let start = "start_example"; // String | position in list
let limit = "limit_example"; // String | maximum templates returned in list
let opts = { 
  'playerId': "playerId_example" // String | A Games PlayerId to filter by player
};
apiInstance.tradeGetAllGet(start, limit, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **start** | **String**| position in list | 
 **limit** | **String**| maximum templates returned in list | 
 **playerId** | **String**| A Games PlayerId to filter by player | [optional] 

### Return type

[**SDTradeGetAllResponses**](SDTradeGetAllResponses.md)

### Authorization

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

### HTTP request headers

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

<a name="tradeGetGet"></a>
# **tradeGetGet**
> SDTradeGetResponse tradeGetGet(tradeId)

Get Trade

Get a Game Trade

### Example
```javascript
import {SdPublicProdApi} from 'sd_public_prod_api';
let defaultClient = SdPublicProdApi.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SdPublicProdApi.TradeEndpointsApi();
let tradeId = "tradeId_example"; // String | A Trade Id

apiInstance.tradeGetGet(tradeId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **tradeId** | **String**| A Trade Id | 

### Return type

[**SDTradeGetResponse**](SDTradeGetResponse.md)

### Authorization

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

### HTTP request headers

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

<a name="tradeOfferPost"></a>
# **tradeOfferPost**
> SDTradeOfferResponse tradeOfferPost(body)

Offer Trade

Adds a New Trade

### Example
```javascript
import {SdPublicProdApi} from 'sd_public_prod_api';
let defaultClient = SdPublicProdApi.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SdPublicProdApi.TradeEndpointsApi();
let body = new SdPublicProdApi.SDTradeOfferRequest(); // SDTradeOfferRequest | 

apiInstance.tradeOfferPost(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SDTradeOfferRequest**](SDTradeOfferRequest.md)|  | 

### Return type

[**SDTradeOfferResponse**](SDTradeOfferResponse.md)

### Authorization

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

### HTTP request headers

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

