Skip to main content

Auction Houses

Create Shop

API Enpoint:

POST http://localhost:7292/dstapi/DSTV1/SaveDecShop

Request Params:

{
"Name": "Shop Name",
"DecShopURL": "tutorial-shop",
"Description": "My shop's description...",
"OwnerAddress": "Rabc123...",
"DecShopHostingType": 0,
"AutoUpdateNetworkDNS": true
}

Response:

{
"Success": true,
"Message": "Decentralized Auction Shop has been created with name Shop Name"
}

Code Example

const createShop = async () => {
const payload = {
Name: "Shop Name",
DecShopURL: "tutorial-shop",
Description: "My shop's description...",
OwnerAddress: "xDnL4MCGtgHu85JJHdN1fkXinHzKaqVQ59",
DecShopHostingType: 0,
AutoUpdateNetworkDNS: true,
};

const url = `${CLI_BASE_URL}/dstapi/DSTV1/SaveDecShop`;
const request = await fetch(url, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload),
});

const data = await request.json();

return data["Success"];
};

Publish Shop to Network

API Enpoint:

GET http://localhost:7292/dstapi/DSTV1/GetPublishDecShop

Response:

{
"Success": true
}

Code Example

const publishShop = async () => {
const url = `${CLI_BASE_URL}/dstapi/DSTV1/GetPublishDecShop`;
const request = await fetch(url);

const data = await request.json();

console.log(data);

return data["Success"];
};

Get My Shop

API Enpoint:

GET http://localhost:7292/dstapi/DSTV1/GetDecShop

Response:

{
"Success": true,
"DecShop": {
...
}
}

Code Example

const retrieveShop = async () => {
const url = `${CLI_BASE_URL}/dstapi/DSTV1/GetDecShop`;
const request = await fetch(url);

const data = await request.json();

if (data["Success"] == true) {
return data["DecShop"];
}

return null;
};

Update Shop

API Enpoint:

POST http://localhost:7292/dstapi/DSTV1/SaveDecShop

Request Params:

{
"Name": "Updated Shop Name",
"DecShopURL": "tutorial-shop",
"Description": "My updated shop's description...",
"OwnerAddress": "xDnL4MCGtgHu85JJHdN1fkXinHzKaqVQ59",
"DecShopHostingType": 0,
"AutoUpdateNetworkDNS": true
}

Response:

{
"Success": true,
"DecShop": {
...
}
}

Toggle Offline/Online

API Enpoint:

GET http://localhost:7292/dstapi/DSTV1/GetSetShopStatus

Code Example

const toggleShopOnline = async () => {
const url = `${CLI_BASE_URL}/dstapi/DSTV1/GetSetShopStatus`;
const request = await fetch(url);

const data = await request.json();

console.log(data);

if (data["Success"] == true) {
return data["Message"].replace("Is Offline? ", "") == "True";
}

return null;
};

Delete Shop from Network

API Enpoint:

GET http://localhost:7292/dstapi/DSTV1/GetDeleteDecShop

Code Example

const deleteNetworkShop = async () => {
const url = `${CLI_BASE_URL}/dstapi/DSTV1/GetDeleteDecShop`;
const request = await fetch(url);

const data = await request.json();

return data["Success"] == true;
};

Delete Shop Locally

API Enpoint:

GET http://localhost:7292/dstapi/DSTV1/GetDeleteLocalDecShop

Code Example

const deleteShop = async () => {
const url = `${CLI_BASE_URL}/dstapi/DSTV1/GetDeleteLocalDecShop`;
const request = await fetch(url);

const data = await request.json();

return data["Success"] == true;
};

Retrieve Network Shop

API Enpoint:

GET http://localhost:7292/dstapi/DSTV1/GetNetworkDecShopInfo/{url}

Code Example

const retrieveNetworkShop = async (shopUrl) => {
const url = `${CLI_BASE_URL}/dstapi/DSTV1/GetNetworkDecShopInfo/${shopUrl}`;
const request = await fetch(url);

const data = await request.json();

if (data["Success"] == true) {
return data["DecShop"];
}

return null;
};

URL Params:

url: URL of the shop (ie. rbx://tutorial-shop)

Response:

{
"Success": true,
"DecShop": {
...
}
}