Converter

Endpoint specification

The converter endpoint allows you to receive information on a transaction without going through the execution flow.


Request method: POST

Endpoint URL:

Sandbox: https://sandbox.wert.io/api/v3/partners/convert
Production: https://widget.wert.io/api/v3/partners/convert

Headers:

'X-Partner-ID: YOUR_PARTNER_ID' //string, required
'Content-Type: application/json'

The following properties are used when making a request:

PropertyRequiredTypeDescription
fromyesstringBase asset ( Fiat or Crypto) e.g BTC, ETH, USD, EUR
networkyesstringBase asset network
toyesstringQuote asset ( Fiat or Crypto) e.g BTC, ETH, USD, EUR
amountyesnumericalBase asset amount
payment_methodsnoarray of stringsPayment methods to calculate fees for (e.g. ["cards", "ach"])
partner_datarequired for smart contractobjectPartner data object
sc_addressrequired for smart contractstringThe address of your smart contract
sc_input_datarequired for smart contractstringInput data that will be used for the smart contract execution in hex format
signaturerequired for smart contractstringA digital signature used to encrypt the request to ensure you have sent it

Payment methods behavior

If payment_methods is not provided or is null, the system calculates fees using default logic.

If payment_methods is provided, the response will include separate fee calculations per payment method.

If an unsupported payment method is passed, the request will return an error.


Sample request for a crypto transaction

curl -X POST \
--url 'https://sandbox.wert.io/api/v3/partners/convert' \
-H 'Content-Type: application/json' \
-H 'X-Partner-ID: your-partner-id' \
-d '{
    "from": "ETH",
    "network": "sepolia",
    "to": "USD",
    "amount": 0.05,
    "payment_methods": ["cards", "ach"]
    }'

Sample request for a smart contract transaction

curl -X POST \
--url 'https://sandbox.wert.io/api/v3/partners/convert' \
-H 'Content-Type: application/json' \
-H 'X-Partner-ID: your-partner-id' \
-d '{
    "from": "ETH",
    "network": "sepolia",
    "to": "USD",
    "amount": 0.05,
    "payment_methods": ["cards"],
    "partner_data": {
      "sc_address": "0xC545CEae428785a5AE77bfF262600deC7F7d76d2",
      "sc_input_data": "0x9dae76ea000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000",
      "signature": "0xd035046e8eda9b2c9c4413bfd31ed42b7df056108c83110aa8ae70f9ca167e1a2047d1b906afa66a770939dd074d1eff27b029ec2c27b39dc30a076e31221209"
    }
}'

Response

The endpoint will return the following information:

Parameter

Description

ticker

The rate at which cryptocurrency is being sold.

fee_percent

% fee taken by the service.

fee_fixed

Fixed fee in fiat taken by the service.

currency_amount

The final amount in fiat that the user will pay.

fee_amount

Amount paid in fiat to cover the service fee.

commodity_amount

The amount of cryptocurrency that the user will receive.

purchase_amount

The amount of fiat that will be used to purchase cryptocurrency
( purchase_amount = currency_amount - fee_amount - currency_miner_fee)

miner_fee

The amount of crypto that will be used to cover blockchain fees.

currency_miner_fee

Price of miner fee in fiat (currency_miner_fee = miner_feeticker).


Sample response:

{
  "status": "ok",
  "body": {
    "results": [
      {
        "payment_method": "cards",
        "details": {
          "ticker": "0.69054",
          "fee_ticker": "0.69054",
          "fee_percent": 0.07,
          "fee_fixed": 1,
          "currency_amount": 0.7,
          "fee_amount": 1.05,
          "commodity_amount": 0.94087432,
          "purchase_amount": 0.65,
          "miner_fee": 0.000418,
          "currency_miner_fee": 0
        }
      },
      {
        "payment_method": "ach",
        "details": {
          "ticker": "0.76",
          "fee_ticker": "0.76",
          "fee_percent": 0.01,
          "fee_fixed": 1,
          "currency_amount": 0.1,
          "fee_amount": 1.05,
          "commodity_amount": 0.23579696,
          "purchase_amount": 0.28,
          "miner_fee": 0.000324,
          "currency_miner_fee": 0
        }
      }
    ]
  }
}


Documentation related to this page