Skip to content

Conversions

View and manage cryptocurrency conversion operations within your account.

List Conversions

This endpoint retrieves all conversions.

HTTP Request

GET /v1/conversions/

python
auto_conversions = uniwire_api_request('/v1/conversions/')
javascript
uniwire_api_request('/v1/conversions/').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});

The above command returns JSON structured like this:

json
{
  "result": [
    {
      "id": "<id>",
      "created_at": "2024-09-19T16:18:22.057617+00:00",
      "created_by": "<user_email>",
      "from_wallet": {
        "id": "<wallet_id>",
        "name": "Tron"
      },
      "from_kind": "USDT-TRX",
      "to_wallet": {
        "id": "<wallet_id>",
        "name": "Tron"
      },
      "to_kind": "USDC-TRX",
      "amount": "50",
      "to_amount": "49.5",
      "exchange": {
        "id": "<exchange_id>",
        "title": "Binance"
      },
      "status": "draft",
      "is_approved": false,
      "approved_by": null
    },
    {
      "id": "a667298e-ff10-4e16-bb06-4394552264ca",
      "created_at": "2024-09-19T16:18:22.057617+00:00",
      "created_by": "<user_email>",
      "from_wallet": {
        "id": "fce22564-bf58-481f-a66d-9bcb4dc764e1",
        "name": "Ethereum"
      },
      "from_kind": "ETH",
      "to_wallet": {
        "id": "fce22564-bf58-481f-a66d-9bcb4dc764e1",
        "name": "Ethereum"
      },
      "to_kind": "ETH_USDT",
      "amount": "0.01809803",
      "to_amount": "42.48",
      "exchange": {
        "id": "9994a4fe-1367-4143-a696-b236f34c653a",
        "title": null
      },
      "status": "draft",
      "is_approved": false,
      "approved_by": "<user_email>"
    }
  ]
}

Get Conversion

This endpoint retrieves a specific conversion.

HTTP Request

GET /v1/conversions/<ID>/

URL Parameters

ParameterDescription
IDThe ID of the conversion to retrieve
python
auto_conversions = uniwire_api_request('/v1/conversions/<id>/')
javascript
uniwire_api_request('/v1/conversions/<id>/').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});

The above command returns JSON structured like this:

json
{
  "result": {
    "id": "<id>",
    "created_at": "2024-09-19T16:18:22.057617+00:00",
    "created_by": "<user_email>",
    "from_wallet": {
      "id": "<wallet_id>",
      "name": "Tron"
    },
    "from_kind": "USDT-TRX",
    "to_wallet": {
      "id": "<wallet_id>",
      "name": "Tron"
    },
    "to_kind": "USDC-TRX",
    "amount": "50",
    "to_amount": "49.5",
    "exchange": {
      "id": "<exchange_id>",
      "title": "Binance"
    },
    "status": "draft",
    "is_approved": false,
    "approved_by": null,
    "transaction": null,
    "payout": null
  }
}

Create Conversion

This endpoint allows creating conversion. Only one conversion per wallet per kind is allowed. Editable fields: from_wallet,from_kind,to_wallet,to_kind,amount,exchange,is_approved.

HTTP Request

POST /v1/conversions/

Payload Parameters

ParameterDescriptionRequired
is_approvedApprove conversionNo
from_walletWallet IDYes
from_kindAvailable ValuesYes
to_walletWallet IDYes
to_kindAvailable ValuesYes
exchangeExchange IDNo
amountAmount to convertYes
python
import json

payload = {
    'is_approved': False,
    'from_wallet': '<wallet_id>',
    'from_kind': 'USDT-TRX',
    'to_wallet': '<wallet_id>',
    'to_kind': 'USDC-TRX',
    'amount': 50,
    'exchange': '<exchange_id>',
}
auto_conversion = uniwire_api_request('/v1/conversions/', payload, 'POST')
print(json.dumps(auto_conversion, indent=2))
javascript
var payload = {
  'is_approved': false,
  'from_wallet': '<wallet_id>',
  'from_kind': 'USDT-TRX',
  'to_wallet': '<wallet_id>',
  'to_kind': 'USDC-TRX',
  'amount': 50,
  'exchange': '<exchange_id>',
}
uniwire_api_request('/v1/conversions/', payload, 'POST').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});

JSON response for Create Automatic Conversion endpoint:

json
{
  "result": {
    "id": "<id>",
    "created_at": "2024-09-19T16:18:22.057617+00:00",
    "created_by": "<user_email>",
    "from_wallet": {
      "id": "<wallet_id>",
      "name": "Tron"
    },
    "from_kind": "USDT-TRX",
    "to_wallet": {
      "id": "<wallet_id>",
      "name": "Tron"
    },
    "to_kind": "USDC-TRX",
    "amount": "50",
    "to_amount": "49.5",
    "exchange": {
      "id": "<exchange_id>",
      "title": "Binance"
    },
    "is_approved": false
  }
}

Update Conversion

This endpoint allows updating conversion. Editable fields: to_wallet,to_kind,amount,exchange,is_approved.

HTTP Request

PUT https://api.uniwire.com/v1/conversions/<ID>/

URL Parameters

ParameterDescription
IDThe ID of the conversion to retrieve

Payload Parameters

ParameterDescription
is_approvedEnable / Disable conversion execution
to_walletWallet ID
to_kindAvailable Values
exchangeExchange ID
amountAmount to convert
python
import json

payload = {
    'is_approved': False,
    'to_wallet': '<wallet_id>',
    'to_kind': 'USDC-TRX',
    'amount': 50,
    'exchange': '<exchange_id>',
}
auto_conversion = uniwire_api_request('/v1/conversions/<id>', payload, 'PUT')
print(json.dumps(auto_conversion, indent=2))
javascript
var payload = {
  'is_approved': False,
  'to_wallet': '<wallet_id>',
  'to_kind': 'USDC-TRX',
  'amount': 50,
  'exchange': '<exchange_id>',
}
uniwire_api_request('/v1/conversions/<id>', payload, 'PUT').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});

JSON response for Create Automatic Conversion endpoint:

json
{
  "result": {
    "id": "<id>",
    "created_at": "2024-09-19T16:18:22.057617+00:00",
    "created_by": "<user_email>",
    "from_wallet": {
      "id": "<wallet_id>",
      "name": "Tron"
    },
    "from_kind": "USDT-TRX",
    "to_wallet": {
      "id": "<wallet_id>",
      "name": "Tron"
    },
    "to_kind": "USDC-TRX",
    "amount": "50",
    "to_amount": "49.5",
    "exchange": {
      "id": "<exchange_id>",
      "title": "Binance"
    },
    "is_approved": false
  }
}

Delete Conversion

This endpoint allows delete conversion.

HTTP Request

DELETE https://api.uniwire.com/v1/conversions/<ID>/

URL Parameters

ParameterDescription
IDThe ID of the conversion to delete
python
import json

payload = None
auto_conversion = uniwire_api_request('/v1/conversions/<id>', payload, 'DELETE')
print(json.dumps(auto_conversion, indent=2))
javascript
var payload = null
uniwire_api_request('/v1/conversions/<id>', payload, 'DELETE').then(function(response) {
  //
}).catch(function(error) {
  console.log(error);
});