v1/purchase

This endpoint is dedicated to production usage of BrickVerse & not recommended for 3rd Party applications due to cookie requirement & way we handle data on this endpoint.

GET https://api.brickverse.co/v1/asset/purchase

This endpoint allows you to purchase a asset.

Query Parameters

NameTypeDescription

id*

Int

Asset ID

success

Due to this endpoint not returning JSON, you can parse the body with Javascript. Heres a example.

var xhr = new XMLHttpRequest();
xhr.open('GET', "/api/v1/asset/purchase?id=1", true);

xhr.onload = function() {
    var data = xhr.response;
    
    if (data.startsWith("success")) {
        console.log("Purchase successful!");
    } else {
        var reason = data.split(":")[1];
        console.log("Purchase failed for " + reason);
    }
};

xhr.send();

This endpoint is used for purchasing user-created assets such as Hats, Shirts, Pants, etc.

Last updated