HTTP API

Acquiring HTTP API

[GET] Account Balance

/private-api/balances/

Response Payload

{
  "balances": [
    {
      "id": "9a747ebd-1b42-4bd2-a72e-62ffedd3f4aa",
      "currency": {
        "id": "d9da4bdc-1c0b-4835-8ec6-a7118247340f",
        "ticker": "USDT",
        "is_fiat": false,
        "is_used_for_order_exchange": true,
        "icon": "https://media.whitepay.com/currency-default-icon.svg",
        "crm_icon": "https://media.whitepay.com/currency-default-icon.svg",
        "precision": 4,
        "title": "Tether US"
      },
      "value": "87.06441001"
    }
  ]
}

Check out Account balance entity reference for detailed description.

[GET] Exchange rates for a balance

/private-api/balances/{balanceId}

Response Payload

{
  "balance":{
    "id":"eebb66d9-1075-4db4-8a68-54d35689dd16",
    "currency":{
      "id":"d9da4bdc-1c0b-4835-8ec6-a7118247340f",
      "ticker":"USDT",
      "is_fiat":false,
      "is_stable":true,
      "is_used_for_order_exchange":true,
      "icon":"https://media.whitepay.com/c9409283-ed01-436f-bb6d-8763ff06ba54/USDT-(2).svg",
      "crm_icon":"https://media.whitepay.com/c9409283-ed01-436f-bb6d-8763ff06ba54/USDT-(2).svg",
      "precision":2,
      "title":"Tether US",
      "min_exchange_amount":"1.00"
    },
    "value":"249.07714917",
    "currencies":[
      {
        "id":"7b8ab62a-76fe-4d24-ae5f-c757bfce60f6",
        "precision":8,
        "exchange_rate":"0.00001723",
        "ticker":"BTC",
        "name":"Bitcoin",
        "title":"Bitcoin",
        "icon":"https://media.whitepay.com/6656e375-a881-4eb1-87a2-26d36971e434/BTC.svg"
      },
      {
        "id":"5992d102-05c8-4c02-8d59-f642fc25d0ca",
        "precision":8,
        "exchange_rate":"0.9978",
        "ticker":"USDC",
        "name":"USD Coin",
        "title":"USD Coin",
        "icon":"https://media.whitepay.com/3dc94acd-f27c-462e-aa60-418f8fdd0287/USDC.svg"
      }
    ]
  }
}

Check out Account balance entity reference for detailed description.

[POST] Create request for balance conversion

/private-api/balances/{balanceId}
  • {balanceID} - id of balance in requested currency
  • Authorization: Private API Token will be generated via Whitepay CRM
NameTypeRequiredDescription
currency_tostringY currency into which the balance willbe exchanged
amount_to_convertdecimalY the amount in the balance currency that will be converted

Request Payload

{
  "currency_to":"USDT",
  "amount_to_convert":"40"
}

Response Payload

{
  "transaction":{
    "id":"85fec40f-b4df-4b52-a725-6cffdea4cf0e",
    "type":"CONVERT",
    "currency":"DOGE",
    "value":"40",
    "status":"INIT",
    "hash":null,
    "is_internal":false,
    "created_at":"2024-07-11 09:36:46",
    "completed_at":null,
    "currency_from":"DOGE",
    "value_from":"40.00000000",
    "currency_to":"USDT",
    "value_to":"0.00000000"
  }
}

Check out Transaction entity reference for detailed description.

Previous
Static wallets