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

Quick trade

PreviousOffersNextTransaction history

Last updated 3 days ago

Create a quick trade

post

Creates a quick trade transaction based on the specified listings and offers, confirming that the quick trade can be executed. When the quick trade is created, the listings and offers are reserved for some time. The items are released when the quick trade is cancelled, executed, or expires.

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

Identifier for the environment that this request should interact with

Body
exchangeRateTokenstringRequired

A token that identifies and confirms the authenticity of the exchange rate.

Example: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3Mzg3Mjg4NjgsImJhc2UiOiJNWVRIIiwicmF0ZXMiOnsiVVNEIjoxLjU2fX0.WLo4h7JoJcJyXJZceOBlr84DJ_k1cGWBJhqbzKcPbcWHzMgrXcsnEFNr_hrDKUVeI-x_qQn1XfcUSLsWh1qDZg
operationIdstringRequired

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

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

User on whose behalf the trade is being executed.

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/quick-trade HTTP/1.1
Host: 
Authorization: Bearer JWT
x-mythical-environment-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 493

{
  "exchangeRateToken": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3Mzg3Mjg4NjgsImJhc2UiOiJNWVRIIiwicmF0ZXMiOnsiVVNEIjoxLjU2fX0.WLo4h7JoJcJyXJZceOBlr84DJ_k1cGWBJhqbzKcPbcWHzMgrXcsnEFNr_hrDKUVeI-x_qQn1XfcUSLsWh1qDZg",
  "give": [
    {
      "exchangeRateToken": "text",
      "itemId": "text",
      "offerId": "text",
      "tradeToken": "text"
    }
  ],
  "operationId": "123e4567-e89b-12d3-a456-426614174000",
  "receive": [
    {
      "exchangeRateToken": "text",
      "listingId": "text",
      "tradeToken": "text"
    }
  ],
  "traderId": "123e4567-e89b-12d3-a456-426614174000"
}
{}

Cancel a quick trade

post

Cancelling a quick trade releases the offers and listings involved so that other users on the marketplace can interact with them. If a user prematurely leaves the quick trade flow, the quick trade should be cancelled.

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

Identifier for the environment that this request should interact with

Body
operationIdstringRequired

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

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

User on whose behalf the trade is being executed.

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/quick-trade/cancel HTTP/1.1
Host: 
Authorization: Bearer JWT
x-mythical-environment-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 104

{
  "operationId": "123e4567-e89b-12d3-a456-426614174000",
  "traderId": "123e4567-e89b-12d3-a456-426614174000"
}
{}

Execute a quick trade

post

The offers and listings in the quick trade will be accepted and purchases on behalf of the user. The user will be charged/credited according to whether the quick trade creates a currency deficit/surplus.

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

Identifier for the environment that this request should interact with

Body
operationIdstringRequired

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

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

User on whose behalf the trade is being executed.

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/quick-trade/execute HTTP/1.1
Host: 
Authorization: Bearer JWT
x-mythical-environment-id: 123e4567-e89b-12d3-a456-426614174000
Content-Type: application/json
Accept: */*
Content-Length: 104

{
  "operationId": "123e4567-e89b-12d3-a456-426614174000",
  "traderId": "123e4567-e89b-12d3-a456-426614174000"
}
{}

Check quick trade

get

Check the status of a given quick trade 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
Success
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/quick-trade/{operationId}/status HTTP/1.1
Host: 
Authorization: Bearer JWT
x-mythical-environment-id: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
{
  "status": "Running"
}
  • POSTCreate a quick trade
  • POSTCancel a quick trade
  • POSTExecute a quick trade
  • GETCheck quick trade