---
updatedAt: 2025-11-11T23:14:36.000Z
agentTools:
  projectIndex: https://developers.fortresstrust.com/llms.txt
---

# Buy/Sell crypto (Auth)

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Trading Api",
    "version": "1.0"
  },
  "paths": {
    "/api/trust/v1/trades": {
      "post": {
        "tags": [
          "Trades"
        ],
        "summary": "Buy/Sell crypto (Auth)",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "The idempotency key for the endpoint",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "description": "Buy/sell crypto request model",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TradeRequestModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TradeRequestModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TradeRequestModel"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Buy/sell crypto process started successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TradeResponseModel"
                }
              }
            }
          },
          "400": {
            "description": "Bad request model data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "Example 1": {
                    "summary": "Bad request result",
                    "value": {
                      "title": "string",
                      "status": 400,
                      "traceId": "string",
                      "path": "string",
                      "errors": {
                        "00000000-0000-0000-0000-000000000000": [
                          "Validation error"
                        ]
                      }
                    }
                  },
                  "Example 2": {
                    "summary": "Invalid data",
                    "value": {
                      "title": "One or more validation errors occured.",
                      "status": 400,
                      "traceId": "string",
                      "path": "string",
                      "errors": {
                        "string": [
                          "string"
                        ]
                      }
                    }
                  },
                  "Example 3": {
                    "summary": "Exeption",
                    "value": {
                      "title": "string",
                      "status": 400,
                      "traceId": "string",
                      "path": "string",
                      "errors": {}
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Custodial account was not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "Example 1": {
                    "summary": "Validation exception",
                    "value": {
                      "title": "string",
                      "status": 404,
                      "traceId": "string",
                      "path": "string",
                      "errors": {
                        "00000000-0000-0000-0000-000000000000": [
                          "Validation error"
                        ]
                      }
                    }
                  },
                  "Example 2": {
                    "summary": "Not found",
                    "value": {
                      "type": "string",
                      "title": "Not Found",
                      "status": 404,
                      "traceId": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "Bearer": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AssetData": {
        "type": "object",
        "properties": {
          "asset": {
            "$ref": "#/components/schemas/ModelAssetFiatType"
          },
          "network": {
            "$ref": "#/components/schemas/ModelNetworkChain"
          }
        },
        "additionalProperties": false,
        "description": "Asset data"
      },
      "AssetDataFrom": {
        "type": "object",
        "properties": {
          "asset": {
            "$ref": "#/components/schemas/ModelAssetFiatType"
          },
          "network": {
            "$ref": "#/components/schemas/ModelNetworkChain"
          },
          "amount": {
            "type": "number",
            "description": "Gets amount.",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Asset data from"
      },
      "FundsStorageResponseModel": {
        "type": "object",
        "properties": {
          "identityId": {
            "type": "string",
            "description": "Identity identifier",
            "format": "uuid",
            "nullable": true
          },
          "custodialAccountId": {
            "type": "string",
            "description": "Custodial account identifier",
            "format": "uuid",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Funds storage response model"
      },
      "ModelAssetFiatType": {
        "enum": [
          "usd",
          "btc",
          "eth",
          "matic",
          "usdc",
          "sol",
          "ada",
          "xlm",
          "dot",
          "link",
          "algo",
          "bnb",
          "busd",
          "avax",
          "ltc",
          "uni",
          "crv",
          "aave",
          "eos",
          "bch",
          "xtz",
          "comp",
          "bat",
          "shib",
          "doge",
          "grt",
          "sushi",
          "sand",
          "enj",
          "axs",
          "mana",
          "mkr",
          "yfi",
          "atom",
          "ape",
          "dai",
          "usdt",
          "near",
          "trx",
          "ftm",
          "xrp",
          "flrns",
          "flow",
          "qnt",
          "hbar",
          "chz",
          "gala",
          "smtf",
          "pol",
          "gold",
          "silver"
        ],
        "type": "string",
        "description": "Asset fiat type"
      },
      "ModelNetworkChain": {
        "enum": [
          "mainnet",
          "bnbSmartChainMainnet",
          "eosMainnet",
          "bnbSmartChainTestnet",
          "polygonMainnet",
          "fantomMainnet",
          "eosTestnet",
          "bitcoinMainnet",
          "cosmosHub",
          "cosmosHubTestnet",
          "bitcoinTestnet",
          "bchMainnet",
          "bchTestnet",
          "solanaMainnet",
          "solanaDevnet",
          "polkadotMainnet",
          "polkadotWestend",
          "cardanoMainnet",
          "cardanoTestnet",
          "algorandMainnet",
          "algorandTestnet",
          "stellarMainnet",
          "stellarTestnet",
          "litecoinMainnet",
          "litecoinTestnet",
          "tezosMainnet",
          "tezosTestnet",
          "arbitrumMainnet",
          "avalancheFuji",
          "avalancheMainnet",
          "polygonMumbai",
          "polygonAmoy",
          "rippleMainnet",
          "rippleTestnet",
          "arbitrumSepolia",
          "dogeTestnet",
          "dogeMainnet",
          "nearMainnet",
          "nearTestnet",
          "tronMainnet",
          "tronTestnet",
          "flowMainnet",
          "flowTestnet",
          "hederaMainnet",
          "hederaTestnet",
          "sepolia"
        ],
        "type": "string",
        "description": "Supported networks"
      },
      "ModelOrderType": {
        "enum": [
          "market",
          "limit",
          "swap"
        ],
        "type": "string",
        "description": "Order type"
      },
      "PaymentStatus": {
        "enum": [
          "new",
          "completed",
          "approvalNeeded",
          "rejected"
        ],
        "type": "string",
        "description": "Payment status"
      },
      "PaymentType": {
        "enum": [
          "internal",
          "cardDeposit",
          "cardWithdrawal",
          "achDeposit",
          "achWithdrawal",
          "wireDeposit",
          "wireWithdrawal",
          "buyCrypto",
          "sellCrypto",
          "depositCrypto",
          "withdrawalCrypto",
          "internalCrypto",
          "privateSecurityDeposit",
          "privateSecurityWithdrawal",
          "privateSecurityInternal",
          "incomingAchDeposit",
          "incomingAchWithdrawal",
          "checkDeposit",
          "buyPreciousMetal",
          "sellPreciousMetal",
          "swapCrypto"
        ],
        "type": "string",
        "description": "Payment type"
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": {}
      },
      "TradeRequestModel": {
        "required": [
          "accountId",
          "from",
          "to"
        ],
        "type": "object",
        "properties": {
          "accountId": {
            "minLength": 1,
            "type": "string",
            "description": "Custodial account identifier",
            "format": "uuid"
          },
          "type": {
            "$ref": "#/components/schemas/ModelOrderType"
          },
          "from": {
            "$ref": "#/components/schemas/AssetDataFrom"
          },
          "to": {
            "$ref": "#/components/schemas/AssetData"
          },
          "comment": {
            "maxLength": 1000,
            "type": "string",
            "description": "Gets or sets the comment.",
            "nullable": true
          },
          "spreadBasisPoints": {
            "type": "number",
            "description": "Integrator spread basis points",
            "format": "double",
            "nullable": true
          },
          "spreadFiatPerUnit": {
            "type": "number",
            "description": "Integrator spread fixed amount (for PM trading ONLY)",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Buy/sell crypto request model"
      },
      "TradeResponseModel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Payment identifier",
            "format": "uuid"
          },
          "type": {
            "$ref": "#/components/schemas/PaymentType"
          },
          "status": {
            "$ref": "#/components/schemas/PaymentStatus"
          },
          "source": {
            "$ref": "#/components/schemas/FundsStorageResponseModel"
          },
          "destination": {
            "$ref": "#/components/schemas/FundsStorageResponseModel"
          },
          "comment": {
            "type": "string",
            "description": "Comment",
            "nullable": true
          },
          "funds": {
            "type": "number",
            "description": "Funds",
            "format": "double",
            "nullable": true
          },
          "cryptoAmount": {
            "type": "number",
            "description": "Crypto amount",
            "format": "double",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "Precious metal quantity",
            "format": "double",
            "nullable": true
          },
          "sourceAmount": {
            "type": "number",
            "description": "Source amount for swap payments",
            "format": "double",
            "nullable": true
          },
          "currency": {
            "$ref": "#/components/schemas/ModelAssetFiatType"
          },
          "sourceCurrency": {
            "$ref": "#/components/schemas/ModelAssetFiatType"
          },
          "destinationCurrency": {
            "$ref": "#/components/schemas/ModelAssetFiatType"
          },
          "assetTypeId": {
            "type": "string",
            "description": "Id of Asset type (for Private Security)",
            "format": "uuid",
            "nullable": true
          },
          "network": {
            "$ref": "#/components/schemas/ModelNetworkChain"
          },
          "sourceNetwork": {
            "$ref": "#/components/schemas/ModelNetworkChain"
          },
          "destinationNetwork": {
            "$ref": "#/components/schemas/ModelNetworkChain"
          },
          "spreadBasisPoints": {
            "type": "number",
            "description": "Integrator spread basis points",
            "format": "double",
            "nullable": true
          },
          "spreadFiatPerUnit": {
            "type": "number",
            "description": "Integrator spread fiat per unit",
            "format": "double",
            "nullable": true
          },
          "txHash": {
            "type": "string",
            "description": "Transaction hash",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Payment response model"
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "apiKey",
        "description": "Put access token in the box below.<br>For example: <b>Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6I</b>",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "Bearer": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```