Mythical Platform
Mythical Platform
  • The Mythical Platform API
  • Quick start
    • Authenticate
    • Create a guest player
    • Create an item type
    • Grant an item to a player
    • Update item metadata
    • Use webhooks for real time messages
    • Buy a listed item
  • API Reference
    • Players
    • Item Types
    • Items
    • Marketplace
      • Listings
      • Offers
      • Quick trade
      • Transaction history
      • Exchange rate
    • Webhook management
    • System
Powered by GitBook
On this page
  1. API Reference
  2. Marketplace

Listings

PreviousMarketplaceNextOffers

Last updated 3 days ago

Check purchase status

get

Check the status of a given purchase operation.

Authorizations
Path parameters
operationIdstringRequired

A unique identifier for the idempotent execution and tracing the request (UUID)

Header parameters
x-mythical-environment-idstring · uuidRequired

Identifier for the environment that this request should interact with

Responses
200
Offers and other data
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
get
GET /v1/listings/purchase/{operationId}/status HTTP/1.1
Host: 
Authorization: Bearer JWT
x-mythical-environment-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
{
  "status": "Running"
}
  • POSTSearch market listings
  • POSTPurchase a listing
  • GETCheck purchase status

Search market listings

post

Retrieve a list of marketplace listings. Supports filtering, sorting, and pagination.

Authorizations
Header parameters
x-mythical-environment-idstring · uuidRequired

Identifier for the environment that this request should interact with

Body
cursorstringRequired

Cursor controls the starting point within the dataset.

limitintegerRequired

Limit controls the number of results returned.

Example: 100
playerIdstringRequired

id of the player to find listings for.

Example: 123e4567-e89b-12d3-a456-426614174000
Responses
200
Listings and other data
application/json
400
Bad Request
application/json
401
Unauthorized
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
post
POST /v1/listings/search HTTP/1.1
Host: 
Authorization: Bearer JWT
x-mythical-environment-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 198

{
  "cursor": "",
  "filter": {
    "background": [
      "Green",
      "turquoise"
    ],
    "team": [
      "Connecticut pigs",
      "Polissya"
    ]
  },
  "limit": 100,
  "playerId": "123e4567-e89b-12d3-a456-426614174000",
  "sort": [
    {
      "asc": true,
      "field": "price"
    }
  ]
}
{
  "MYTHtoUSD": {
    "expiresAt": 1738728868,
    "rate": "0.33",
    "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3Mzg3Mjg4NjgsImJhc2UiOiJNWVRIIiwicmF0ZXMiOnsiVVNEIjoxLjU2fX0.WLo4h7JoJcJyXJZceOBlr84DJ_k1cGWBJhqbzKcPbcWHzMgrXcsnEFNr_hrDKUVeI-x_qQn1XfcUSLsWh1qDZg"
  },
  "cursor": "U3dhZ2dlciByb2Nrcw==",
  "listings": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "item": {
        "id": "text",
        "itemTypeId": "text",
        "ownerPlayerId": "text",
        "tokenId": 1,
        "state": "pending",
        "metadataUrl": "http://url.com/1",
        "metadata": {
          "name": "text",
          "description": "text",
          "image": "text",
          "attributes": [
            {
              "type": "attributeName",
              "value": "attrValue",
              "displayType": "number, boolean, string",
              "maxValue": 255
            }
          ]
        },
        "tags": [
          "text"
        ]
      },
      "price": {
        "myth": "4.2",
        "usd": "42.5"
      },
      "purchase": {
        "expiresAt": 1738728868,
        "fee": {
          "amount": {
            "myth": "4.2",
            "usd": "42.5"
          }
        },
        "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3Mzg3Mjg4NjgsImxpZCI6IjEyM2U0NTY3LWU4OWItMTJkMy1hNDU2LTQyNjYxNDE3NDAwMCIsInVpZCI6IjEyM2U0NTY3LWU4OWItMTJkMy1hNDU2LTQyNjYxNDE3NDAwMSIsImZlZSI6MC40Mn0.Vi7A31IZbNhoW72d5oimpTU1M7puaFV4AkdP-ljCKBclk8ntvOR60bV7KifsLQOW1VZqpxMzqEiB7w6mi59gLg"
      },
      "trade": {
        "expiresAt": 1738728868,
        "fee": {
          "amount": {
            "myth": "4.2",
            "usd": "42.5"
          }
        },
        "token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3Mzg3Mjg4NjgsImxpZCI6IjEyM2U0NTY3LWU4OWItMTJkMy1hNDU2LTQyNjYxNDE3NDAwMCIsInVpZCI6IjEyM2U0NTY3LWU4OWItMTJkMy1hNDU2LTQyNjYxNDE3NDAwMSIsImZlZSI6MC40Mn0.Vi7A31IZbNhoW72d5oimpTU1M7puaFV4AkdP-ljCKBclk8ntvOR60bV7KifsLQOW1VZqpxMzqEiB7w6mi59gLg"
      },
      "version": 5
    }
  ]
}

Purchase a listing

post

Purchase the specified listing from the Mythical Marketplace on behalf of the given player. Will only succeed if the provided mythToUsd rate has not deviated too far from when the price was quoted, and the version of the listing has not changed.

Authorizations
Header parameters
x-mythical-environment-idstring · uuidRequired

Identifier for the environment that this request should interact with

Body
buyerPlayerIdstringRequired

User on whose behalf the purchase is being executed.

Example: 123e4567-e89b-12d3-a456-426614174000
exchangeRateTokenstringRequired

A token that identifies and confirms the authenticity of the exchange rate at which the terms of the purchase were displayed.

Example: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3Mzg3Mjg4NjgsImJhc2UiOiJNWVRIIiwicmF0ZXMiOnsiVVNEIjoxLjU2fX0.WLo4h7JoJcJyXJZceOBlr84DJ_k1cGWBJhqbzKcPbcWHzMgrXcsnEFNr_hrDKUVeI-x_qQn1XfcUSLsWh1qDZg
purchaseTokenstringRequired

A token that identifies and confirms the authenticity of the purchase terms.

Example: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3Mzg3Mjg4NjgsImxpZCI6IjEyM2U0NTY3LWU4OWItMTJkMy1hNDU2LTQyNjYxNDE3NDAwMCIsInVpZCI6IjEyM2U0NTY3LWU4OWItMTJkMy1hNDU2LTQyNjYxNDE3NDAwMSIsImZlZSI6MC40Mn0.Vi7A31IZbNhoW72d5oimpTU1M7puaFV4AkdP-ljCKBclk8ntvOR60bV7KifsLQOW1VZqpxMzqEiB7w6mi59gLg
listingIdstringRequired

UUID of the listing to purchase.

Example: 123e4567-e89b-12d3-a456-426614174000
operationIdstringRequired

A unique identifier for the idempotent execution and tracing the request.

Example: 123e4567-e89b-12d3-a456-426614174000
Responses
200
Success
application/json
Responseobject
400
Bad Request
application/json
401
Unauthorized
application/json
404
Not Found
application/json
500
Internal Server Error
application/json
post
POST /v1/listings/purchase HTTP/1.1
Host: 
Authorization: Bearer JWT
x-mythical-environment-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 680

{
  "buyerPlayerId": "123e4567-e89b-12d3-a456-426614174000",
  "exchangeRateToken": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3Mzg3Mjg4NjgsImJhc2UiOiJNWVRIIiwicmF0ZXMiOnsiVVNEIjoxLjU2fX0.WLo4h7JoJcJyXJZceOBlr84DJ_k1cGWBJhqbzKcPbcWHzMgrXcsnEFNr_hrDKUVeI-x_qQn1XfcUSLsWh1qDZg",
  "purchaseToken": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3Mzg3Mjg4NjgsImxpZCI6IjEyM2U0NTY3LWU4OWItMTJkMy1hNDU2LTQyNjYxNDE3NDAwMCIsInVpZCI6IjEyM2U0NTY3LWU4OWItMTJkMy1hNDU2LTQyNjYxNDE3NDAwMSIsImZlZSI6MC40Mn0.Vi7A31IZbNhoW72d5oimpTU1M7puaFV4AkdP-ljCKBclk8ntvOR60bV7KifsLQOW1VZqpxMzqEiB7w6mi59gLg",
  "listingId": "123e4567-e89b-12d3-a456-426614174000",
  "operationId": "123e4567-e89b-12d3-a456-426614174000"
}
{}