# SdPublicProdApi.PurchasableEndpointsApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**purchasableBuyPost**](PurchasableEndpointsApi.md#purchasableBuyPost) | **POST** /purchasable/buy | Buy Purchasable
[**purchasableCreatePost**](PurchasableEndpointsApi.md#purchasableCreatePost) | **POST** /purchasable/create | Create Purchasable
[**purchasableGetAllGet**](PurchasableEndpointsApi.md#purchasableGetAllGet) | **GET** /purchasable/get-all | Get All Purchasables
[**purchasableGetGet**](PurchasableEndpointsApi.md#purchasableGetGet) | **GET** /purchasable/get | Get Purchasable
[**purchasableMaxAvailabilityGet**](PurchasableEndpointsApi.md#purchasableMaxAvailabilityGet) | **GET** /purchasable/max-availability | Get Purchasable Availability
[**purchasableMutatePut**](PurchasableEndpointsApi.md#purchasableMutatePut) | **PUT** /purchasable/mutate | Mutate Purchasable
[**purchasableRemoveDelete**](PurchasableEndpointsApi.md#purchasableRemoveDelete) | **DELETE** /purchasable/remove | Remove Purchasable

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

Buy Purchasable

Buys some amount of an purchasable

### 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.PurchasableEndpointsApi();
let body = new SdPublicProdApi.SDPurchasableBuyRequest(); // SDPurchasableBuyRequest | 

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SDPurchasableBuyRequest**](SDPurchasableBuyRequest.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="purchasableCreatePost"></a>
# **purchasableCreatePost**
> SDPurchasableCreateResponse purchasableCreatePost(body)

Create Purchasable

Adds a new purchasable that can be purchased

### 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.PurchasableEndpointsApi();
let body = new SdPublicProdApi.SDPurchasableCreateRequest(); // SDPurchasableCreateRequest | 

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

### Parameters

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

### Return type

[**SDPurchasableCreateResponse**](SDPurchasableCreateResponse.md)

### Authorization

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

### HTTP request headers

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

<a name="purchasableGetAllGet"></a>
# **purchasableGetAllGet**
> SDPurchasableGetAllResponses purchasableGetAllGet(opts)

Get All Purchasables

Get the list of game purchasables

### 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.PurchasableEndpointsApi();
let opts = { 
  'start': "start_example", // String | position in list
  'templateId': "templateId_example", // String | Template ID Number (unsigned 32 bit integer)
  'limit': "limit_example" // String | maximum returned in list
};
apiInstance.purchasableGetAllGet(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 | [optional] 
 **templateId** | **String**| Template ID Number (unsigned 32 bit integer) | [optional] 
 **limit** | **String**| maximum returned in list | [optional] 

### Return type

[**SDPurchasableGetAllResponses**](SDPurchasableGetAllResponses.md)

### Authorization

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

### HTTP request headers

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

<a name="purchasableGetGet"></a>
# **purchasableGetGet**
> SDPurchasableGetResponse purchasableGetGet(purchasableId)

Get Purchasable

Get a Purchasable from a Game

### 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.PurchasableEndpointsApi();
let purchasableId = "purchasableId_example"; // String | Purchasable ID Number (unsigned 32 bit integer)

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **purchasableId** | **String**| Purchasable ID Number (unsigned 32 bit integer) | 

### Return type

[**SDPurchasableGetResponse**](SDPurchasableGetResponse.md)

### Authorization

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

### HTTP request headers

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

<a name="purchasableMaxAvailabilityGet"></a>
# **purchasableMaxAvailabilityGet**
> SDPurchasableMaxAvailabilityResponse purchasableMaxAvailabilityGet(purchasableId)

Get Purchasable Availability

Returns the Maxiumum Availability of a Purchasable

### 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.PurchasableEndpointsApi();
let purchasableId = "purchasableId_example"; // String | Purchasable ID Number (unsigned 32 bit integer)

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **purchasableId** | **String**| Purchasable ID Number (unsigned 32 bit integer) | 

### Return type

[**SDPurchasableMaxAvailabilityResponse**](SDPurchasableMaxAvailabilityResponse.md)

### Authorization

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

### HTTP request headers

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

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

Mutate Purchasable

Change a purchasables data

### 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.PurchasableEndpointsApi();
let body = new SdPublicProdApi.SDPurchasableMutateRequest(); // SDPurchasableMutateRequest | 

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**SDPurchasableMutateRequest**](SDPurchasableMutateRequest.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="purchasableRemoveDelete"></a>
# **purchasableRemoveDelete**
> Empty purchasableRemoveDelete(purchasableId)

Remove Purchasable

Delete (hide) a games Purchasable

### 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.PurchasableEndpointsApi();
let purchasableId = "purchasableId_example"; // String | The id of the purchasable

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **purchasableId** | **String**| The id of the purchasable | 

### Return type

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

### Authorization

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

### HTTP request headers

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

