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.

[POST] Create request for automated withdrawal

This request should be executed to initiate automated withdrawal request.

/private-api/{slug}/withdrawal

{slug} – unique instance name defined for the company.

Parameters

NameTypeRequiredDescription
amountstringY amount to withdraw
walletstringY card number (for fiat currency) or wallet address (for cryptocurrency)
networkstringY, in case if balance is stored in crypto currency cryptocurrency network
memostringY, in case if currencies network requires memo memo tag
external_idstringN external id for withdrawal operation
commentstringN description for withdrawal operation

Request Payload

{
   "amount":"100",
   "wallet":"djfhku2h345h43l63jh423j4v2",
   "network":"TRC20",
   "external_id":"123456",
   "comment":"comment for withdrawal"
}

Response Payload

{
  "request_id":"123",
  "transactions":[
    {
      "id":"123",
      "currency":{
        "id":"123",
        "ticker":"USDT",
        "is_fiat":true,
        "is_used_for_order_exchange":true,
        "icon":"https://icon.svg",
        "precision":2,
        "title":"Tether US"
      },
      "value":"77",
      "status":"PENDING_WITHDRAWAL",
      "type":"CRYPTO_WALLET",
      "network":null,
      "fee":"1",
      "created_at":"2022-11-18 14:27:36",
      "completed_at":null
    }
  ]
}

Check out Transaction entity reference for detailed description.

[POST] Create request for IBAN withdrawal

This request should be executed to initiate funds withdrawal to IBAN.

/private-api/withdrawal-iban

Parameters

AttributeTypeRequiredDescription
amountstringY amount to withdraw
messagestringY data on bank account (IBAN, address etc)
exchange_currencystringY/N currency of exchange after withdrawal. required in case if main balance is in crypto.
external_idstringN external id for withdrawal operation
commentstringN

Request Payload

{
  "amount":"200",
  "message":"IBAN address",
  "exchange_currency":"EUR",
  "external_id":"1234external123",
  "comment":"comment"
}

Response Payload

{
  "request_id": "baa8c39a-2c95-4967-8437-7920513041a1"
}
Previous
Crypto top-up