V2

Documentation for API V2. Major update is addresses with exchange crypto to fiat and vice versa abilities.

General information

Api endpoint for all requests is:

https://app.wllxpay.io/api/v2

Deposit flow

  1. You obtain new address from WllxPay API (for some currencies it may be address and tag) and store it somewhere on your side. After that you show this address to your customer in order to make a deposit.

  2. Customer sends some funds to this address.

  3. When transaction is sent by a customer - WllxPay sends a callback to your callback url with transaction details. It contains status, address, currency, amount and fees. If status is successful, you should deposit respective amount to customer balance on your side.

Withdrawal flow

  1. You request to send amount of money to address.

  2. Your request is validated on our side. If signature is correct, address is valid and you have enough balance - WllxPay responds you with the transaction object.

  3. You will receive a callback when transaction status is updated.

Deposit with exchange flow

You don't want to touch or store cryptocurrency, but only use it as a payment method. Your customer deposits BTC, WllxPay instantly converts it to EUR so that you would receive EUR on your WllxPay account.

  1. You obtain new address from WllxPay API same as in deposit flow, but additionally pass another parameter "convert_to" in your request specifying resulting currency.

  2. When new deposit is arriving, WllxPay converts all arriving funds to destination funds, and sends notifications as in regular deposit

Withdrawal with exchange flow

You wish to send Cryptocurrency from your Fiat currency balance. For example you want to send EUR amount but your customer receives money in BTC.

  1. You do exactly same as in withdrawals, but you specify 2 currencies. One is a currency of your sending balance and Second is a cryptocurrency your Customer wishes to receive.

  2. Your request is validated on our side. If signature is correct, address is valid and you have enough balance - WllxPay responds you with the transaction object.

  3. You will receive a callback when transaction status is updated.

API Endpoints

Ping

GET https://app.wllxpay.io/api/v2/ping

Test if API is up and running and your authorization is working

{}

Body must be a valid json object or array, example: {}

Get list of supported currencies

POST https://app.wllxpay.io/api/v2/currencies/list

Get all supported currencies

{
  "data": [
    {
      "id": 1,
      "type": "crypto",
      "currency": "BTC",
      "minimum_amount": "0.001",
      "deposit_fee_percent": "0.99",
      "withdrawal_fee_percent": "0",
      "precision": 8
    }
  ]
}

Get list of exchangeable currency pairs

POST https://app.wllxpay.io/api/v2/currencies/pairs

Get a list of currency pairs if no parameters passed. Get particular pair and its price if currency parameters are passed.

Request Body

{
  "data": [
    {
      "currency_from": {
        "currency": "BTC",
        "type": "crypto",
        "min_amount": "0.00300000"
      },
      "currency_to": {
        "currency": "EUR",
        "type": "fiat"
      },
      "rate_from": "1",
      "rate_to": "8795.80000000"
    },
    {
      "currency_from": {
        "currency": "EUR",
        "type": "fiat",
        "min_amount": "25.00000000"
      },
      "currency_to": {
        "currency": "BTC",
        "type": "crypto"
      },
      "rate_from": "1",
      "rate_to": "8885.72951839"
    },
    {
      "currency_from": {
        "currency": "BCH",
        "type": "crypto",
        "min_amount": "0.00020000"
      },
      "currency_to": {
        "currency": "USD",
        "type": "fiat"
      },
      "rate_from": "1",
      "rate_to": "332.28264751"
    },
    {
      "currency_from": {
        "currency": "USD",
        "type": "fiat",
        "min_amount": "30.00000000"
      },
      "currency_to": {
        "currency": "BCH",
        "type": "crypto"
      },
      "rate_from": "1",
      "rate_to": "335.94361522"
    }
  ]
}

Get list of balances

POST https://app.wllxpay.io/api/v2/accounts/list

Get list of all the balances (including zero balances).

{
    "data": [
        {
            "currency": "DOGE",
            "balance": "13234.91276375"
        },
        {    
            "currency": "ADA",
            "balance": "7272.36400468"
        },
        {
            "currency": "EUR",
            "balance": "5973.97568920"
        },
        {
            "currency": "USDT",
            "balance": "0.00000000"
        }
    ]
}

Receive cryptocurrency

POST https://app.wllxpay.io/api/v2/addresses/take

Take address for depositing crypto and (it depends on specified params) exchange from crypto to fiat on-the-fly.

Request Body

{
  "data": {
    "id": 1,
    "currency": "BTC",
    "convert_to": "EUR",
    "address": "12983h13ro1hrt24it432t",
    "tag": "tag-123",
    "foreign_id": "user-id:2048"
  }
}

Business logic for using cryptocurrency as a deposit method: You are willing to let your customer fund his EUR balance on your platform or website. You will have to generate an address in the desired cryptocurrency and specify EUR as a "convert_to" currency. This will allow you to let your Customer pay if his favorite currency and fund his balance in EUR. At the same time you will see respective EUR amount in your WllxPay merchant account. Hint: you don't have to generate new address for this customer anymore, address can be reused unlimited amount of times.

Example of the customer facing interface for Deposits

  • Make sure to use Bitcoin URI format bitcoin: in QR. Works the same way as "mailto:".

  • We do recommend making this QR clickable as customers may have a wallet set up on their computer or mobile phone.

  • We recommend specifying approximate current exchange rate.

Withdraw cryptocurrency

POST https://app.wllxpay.io/api/v2/withdrawal/crypto

Withdraw in crypto to any specified address. You can send Cryptocurrency from your Fiat currency balance by using "convert_to" parameter.

Request Body

{
  "data": {
    "id": 1,
    "foreign_id": "122929",
    "type": "withdrawal",
    "status": "processing",
    "amount": "0.01000000",
    "sender_amount": "0.01000000",
    "sender_currency": "ETH",
    "receiver_amount": "0.01000000",
    "receiver_currency": "ETH"
  }
}

Recommendation: ask customer to specify his payout address even before allowing him to deposit, this will improve experience and help to avoid mistakes with withdrawals in future.

Business logic for using cryptocurrency as a withdrawal method: Your customer requests a payout in Cryptocurrency from his EUR balance on your platform. You have to specify withdrawal amount in EUR and specify Cryptocurrency and its destination (sometimes it is not only Address). Example of such request <Send 3500 EUR to Bitcoin 3D2V3tushw7VLJYnK6vZVDpNcNmEG2a7QK">.

Calculate exchange rates

POST https://app.wllxpay.io/api/v2/exchange/calculate

Get info about exchange rates.

Request Body

{
  "data": {
    "sender_amount": 1,
    "sender_currency": "BTC",
    "receiver_amount": "8549.81680000",
    "receiver_currency": "EUR",
    "fee_amount": "85.49816800",    
    "fee_currency": "BTC",
    "price": "8549.81680000",
    "ts_fixed": 1564293159,
    "ts_release": 1564293219,
    "fix_period": 60
  }
}

Exchange on fixed rate

POST https://app.wllxpay.io/api/v2/exchange/fixed

Make exchange on a given fixed exchange rate.

Request Body

{
  "data": {
    "id": 7,
    "foreign_id": "kwDN186awpoWoWTJ",
    "type": "exchange",
    "sender_amount": "0.10000000",    
    "sender_currency": "BTC",
    "receiver_amount": "8549.81680000",    
    "receiver_currency": "EUR",
    "fee_amount": "85.49816800",    
    "fee_currency": "BTC",
    "price": "89.64326482",    
    "status": "processing"
  }
}

Exchange regardless the exchange rate

POST https://app.wllxpay.io/api /v2/exchange/now

Make exchange without mentioning the price.

Request Body

{
  "data": {
    "id": 7,
    "foreign_id": "kwDN186awpoWoWTJ",    
    "type": "exchange",
    "sender_amount": "0.10000000",    
    "sender_currency": "BTC",
    "receiver_amount": "8549.81680000",
    "receiver_currency": "EUR",
    "fee_amount": "85.49816800",    
    "fee_currency": "BTC",
    "price": "89.64326482",    
    "status": "processing"
  }
}

Transaction statuses

Transitions

Deposit Callbacks

To provide authentication for the callback, WllxPay API signs the POST your api key and secret:

  1. X-Processing-Key – Your public key

  2. X-Processing-Signature – POST body, signed by the your secret key HMAC-SHA512

{
    "id": 1,
    "type": "deposit",
    "crypto_address": {
        "id": 1,
        "currency": "BTC",
        "address": "39mFf3X46YzUtfdwVQpYXPCMydc74ccbAZ",
        "foreign_id": "user-id:2048",
        "tag": null
    },
    "currency_sent": {
        "currency": "BTC",
        "amount": "6.53157512"
    },
    "currency_received": {
        "currency": "BTC",
        "amount": "6.53157512",
        "amount_minus_fee": "6.5119800"
    },
    "transactions": [
        {
            "id": 1,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "deposit",
            "address": "39mFf3X46YzUtfdwVQpYXPCMydc74ccbAZ",
            "tag": null,
            "amount": "6.53157512",
            "txid": "3950ad8149421a850d01dff88f024810e363ac18c9e8dd9bc0b9116e7937ad93",
            "riskscore": "0.5",
            "confirmations": 3
        }
    ],
    "fees": [
        {
            "type": "deposit",
            "currency": "BTC",
            "amount": "0.01959472"
        }
    ],
    "error": "",
    "status": "confirmed"
}

"riskscore" is used for coin compliance analysis and to reveal and track malicious behavior. Available for deposits and deposits with exchange in BTC, BCH, ETH.

Withdraw Callbacks

{
    "id": 1,
    "foreign_id": "10",
    "type": "withdrawal",
    "crypto_address": {
        "id": 1,
        "currency": "BTC",
        "address": "115Mn1jCjBh1CNqug7yAB21Hq2rw8PfmTA",
        "tag": null
    },
    "currency_sent": {
        "currency": "BTC",
        "amount": "0.02000000"
    },
    "currency_received": {
        "currency": "BTC",
        "amount": "0.02000000"
    },
    "transactions": [
        {
            "id": 1,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "withdrawal",
            "address": "115Mn1jCjBh1CNqug7yAB21Hq2rw8PfmTA",
            "tag": null,
            "amount": "0.02",
            "txid": "bb040d895ef7141ea0b06b04227d8f5dd4ee12d5b890e6e5633f6439393a666b",
            "confirmations": 3
        }
    ],
    "fees": [
        {
            "type": "mining",
            "currency": "BTC",
            "amount": "0.00007402"
        },
        {
            "type": "withdrawal",
            "currency": "BTC",
            "amount": "0.00002000"
        }
    ],
    "error": "",
    "status": "confirmed"
}

Exchange Callbacks

{
    "id": 2686900,
    "type": "exchange",
    "currency_sent": {
        "currency": "EUR",
        "amount": "26.75248865"
    },
    "currency_received": {
        "currency": "BTC",
        "amount": "0.00300000"
    },
    "transactions": [
        {
            "id": 715072,
            "currency": "EUR",
            "currency_to": "BTC",
            "transaction_type": "exchange",
            "type": "exchange",
            "amount": "26.75248865",
            "amount_to": "0.00300000"
        }
    ],
    "fees": [
        {
            "type": "exchange",
            "currency": "EUR",
            "amount": "0.26752489"
        }
    ],
    "error": "",
    "status": "confirmed"
}

Callbacks with other statuses

{
    "id": 2686579,
    "type": "deposit",
    "crypto_address": {
        "id": 381711,
        "currency": "BTC",
        "address": "2N9zXNdiT8ucZp7zZSrucqYGCD6xYF8F3di",
        "tag": null,
        "foreign_id": "991904"
    },
    "currency_sent": {
        "currency": "BTC",
        "amount": "0.01000000"
    },
    "currency_received": {
        "currency": "BTC",
        "amount": "0.01000000",
        "amount_minus_fee": "0.01000000"
    },
    "transactions": [
        {
            "id": 714680,
            "currency": "BTC",
            "transaction_type": "blockchain",
            "type": "deposit",
            "address": "2N9zXNdiT8ucZp7zZSrucqYGCD6xYF8F3di",
            "tag": null,
            "amount": "0.01000000",
            "txid": "998c4d9bb7145aafd88658b292f41fe05973c217f7adcd6052bcafe2309e7e02",
            "confirmations": "0"
        }
    ],
    "fees": [],
    "error": "",
    "status": "not_confirmed"
}

Last updated