🔄Step 5 - Crypto conversion

User can convert one crypto to another. The conversion will be instantly credited on the wallet of the user.

1 - The conversion can be completed using the following endpoint. You will need to provide the AccountId, the token to be changed, the destination token and the quantity.

post
Authorizations
Body
Responses
200
OK
*/*
post
POST /v1/convert HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 370

{
  "jwt": {
    "tokenValue": "text",
    "issuedAt": "2025-07-02T04:39:39.443Z",
    "expiresAt": "2025-07-02T04:39:39.443Z",
    "headers": {
      "ANY_ADDITIONAL_PROPERTY": {}
    },
    "claims": {
      "ANY_ADDITIONAL_PROPERTY": {}
    },
    "id": "text",
    "issuer": "text",
    "notBefore": "2025-07-02T04:39:39.443Z",
    "subject": "text",
    "audience": [
      "text"
    ]
  },
  "tradingOrderView": {
    "accountId": "text",
    "from": "text",
    "to": "text",
    "quantity": 1
  }
}
200

OK

{
  "success": true,
  "data": [
    {
      "accountId": "text",
      "portfolioId": "text",
      "from": {
        "id": "text",
        "operationId": "text",
        "accountId": "text",
        "portfolioId": "text",
        "transactionSide": "CREDIT",
        "transactionType": "FEES",
        "asset": "text",
        "amount": 1,
        "creationTs": "2025-07-02T04:39:39.443Z"
      },
      "to": {
        "id": "text",
        "operationId": "text",
        "accountId": "text",
        "portfolioId": "text",
        "transactionSide": "CREDIT",
        "transactionType": "FEES",
        "asset": "text",
        "amount": 1,
        "creationTs": "2025-07-02T04:39:39.443Z"
      },
      "fees": {
        "id": "text",
        "operationId": "text",
        "accountId": "text",
        "portfolioId": "text",
        "transactionSide": "CREDIT",
        "transactionType": "FEES",
        "asset": "text",
        "amount": 1,
        "creationTs": "2025-07-02T04:39:39.443Z"
      }
    }
  ],
  "errorCode": 1,
  "errorMessage": "text"
}

OAuth: user_auth

2 - When you know the token you want to change, you can check all the related destination tokens using this endpoint:

get
Authorizations
Path parameters
fromSlugstringRequired
Responses
200
OK
*/*
get
GET /v1/convert/{fromSlug} HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
200

OK

{
  "success": true,
  "data": [
    {
      "slug": "text",
      "name": "text",
      "logoUrl": "text",
      "availableNetworks": [
        "text"
      ]
    }
  ],
  "errorCode": 1,
  "errorMessage": "text"
}

OAuth: client_auth

3 - You can also check all the trading pairs available on Stokn using:

get
Authorizations
Responses
200
OK
*/*
get
GET /v1/convert/tradingPairs HTTP/1.1
Host: 
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
200

OK

{
  "success": true,
  "data": [
    "text"
  ],
  "errorCode": 1,
  "errorMessage": "text"
}

OAuth: client_auth

Last updated