1. General info

1.1. General API information

  • Utorg API provides public and private data, so some of endpoints will require authorisation (in documentation you’ll find header param X-token for those mehtods)

  • Base URL for endpoints: https://public-api.utorg.io/api/v1

  • If any issue occurs please contact us [email protected]

  • If you want to test endpoints on external tools you can find our Swagger specification

1.2. Rest convention

1.2.1. HTTP verbs

Speakers Service tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP verbs.

Verb

Usage

GET

Used to retrieve a resource

POST

Used to create a new resource

PATCH

Used to update an existing resource, including partial updates

PUT

Used to update an existing resource, full updates only

DELETE

Used to delete an existing resource

1.2.2. HTTP status codes

Speakers Service tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP status codes.

  • 200 (OK) Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action.

  • 201 (Created) The request has been fulfilled and resulted in a new resource being created.

  • 204 (No Content) The server successfully processed the request, but is not returning any content.

  • 400 (Bad Request) The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

  • 404 (Not Found) The requested resource could not be found but may be available again in the future. Subsequent requests by the client are permissible.

  • 409 (Conflict) The request could not be completed due to a conflict with the current state of the target resource.

  • 422 (Unprocessable Entity) Validation error has happened due to processing the posted entity.

1.3. How to get API access

1.3.1. Create your account

1.4. Begin to use API

For each request which requires authorization you will need to pass:

  • API ID (Header: X-api-sid)

  • API KEY (Header: X-api-key)

  • Checksum of request (Header: X-api-key-checksum) which is made from: RequestPayload as String encoded with HMAC_SHA_256 + ApiSecret

Payload example: {"amount":1,"marketId":1,"price":10,"side":"SELL","type":"LIMIT"}

Groovy examples:

  • Withdrawal An example contains data about withdrawal with authorisation via API key

  • Get An example contains data about method which is authorized, but has no params in request.

2. Use cases

2.1. Deposits and withdrawals processing

Here you will find common endpoints which are used to make deposits and withdrawals by payment methods which are integrated on utorg.io

List of available deposit/withdrawal methods can change in real time
If you want create withdrawal without email confirmation, use method: https://public-api.utorg.io/api/v1/payments/transparent/withdrawal request should not contain password or 2FA code.

2.2. Trading

Here you will find methods to work with trading

3. Rest API

3.1. Wallet controller

3.1.1. List wallets

Curl example
$ curl 'https://public-api.utorg.io/api/v1/wallets' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/wallets HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

3.1.2. List wallet deposit addresses

Curl example
$ curl 'https://public-api.utorg.io/api/v1/wallet/1/deposit/addresses' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/wallet/1/deposit/addresses HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

3.1.3. List account deposit addresses

Curl example
$ curl 'https://public-api.utorg.io/api/v1/deposit/addresses' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/deposit/addresses HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

3.1.4. Create wallet’s deposit address

Curl example
$ curl 'https://public-api.utorg.io/api/v1/wallet/1/deposit/address' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/wallet/1/deposit/address HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

3.1.5. Create wallet’s temporary deposit address

Contact [email protected] before using this method
Curl example
$ curl 'https://public-api.utorg.io/api/v1/wallet/1/deposit/address?temp=true' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/wallet/1/deposit/address?temp=true HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

3.1.6. Search wallet transactions

Curl example
$ curl 'https://public-api.utorg.io/api/v1/wallet/transactions?dateFrom=2019-01-01T00%3A00%3A00.000Z&dateTo=2019-01-10T00%3A00%3A00.000Z&limit=20&offset=0&currencyIds=1&currencyIds=2&currencyIds=3&type=DEPOSIT' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/wallet/transactions?dateFrom=2019-01-01T00%3A00%3A00.000Z&dateTo=2019-01-10T00%3A00%3A00.000Z&limit=20&offset=0&currencyIds=1&currencyIds=2&currencyIds=3&type=DEPOSIT HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

Request parameters
Parameter Description

dateFrom

Date and time from which to search transactions (optional) (ISO 8601)

dateTo

Date and time before which to search transactions (optional) (ISO 8601)

limit

Limit data

offset

Offset

currencyIds

List of currencies to search (optional)

type

Transaction type to search (DEPOSIT, WITHDRAWAL, REFUND) (optional)

How to work with Limit and Offset https://www.postgresql.org/docs/8.2/queries-limit.html

3.1.7. Get transaction details information

Curl example
$ curl 'https://public-api.utorg.io/api/v1/wallet/transaction/1' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/wallet/transaction/1 HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

3.2. Currency controller

3.2.1. Currencies list

Curl example
$ curl 'https://public-api.utorg.io/api/v1/currencies' -i -X GET
HTTP Request
GET /api/v1/currencies HTTP/1.1
Host: public-api.utorg.io
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 829

{
  "elements" : [ {
    "id" : 1,
    "code" : "USD",
    "title" : "Dollar",
    "precision" : 2,
    "type" : "FIAT",
    "isWalletEnabled" : true,
    "isActive" : true,
    "disabledMessage" : null,
    "withdrawUserFee" : null,
    "txExplorerUrl" : ""
  }, {
    "id" : 2,
    "code" : "ETH",
    "title" : "Ethereum",
    "precision" : 8,
    "type" : "CRYPTO_COIN",
    "isWalletEnabled" : true,
    "isActive" : true,
    "disabledMessage" : null,
    "withdrawUserFee" : null,
    "txExplorerUrl" : "https://kovan.etherscan.io/tx/"
  }, {
    "id" : 3,
    "code" : "PERL",
    "title" : "Perlin",
    "precision" : 4,
    "type" : "CRYPTO_FUTURES",
    "isWalletEnabled" : true,
    "isActive" : true,
    "disabledMessage" : null,
    "withdrawUserFee" : null,
    "txExplorerUrl" : ""
  } ],
  "totalElements" : 3
}
Response fields
Path Type Description

elements

Array

Currencies list

elements[].id

Number

Currency internal identifier

elements[].code

String

Currency code

elements[].title

String

Title of currency

elements[].precision

Number

Currency precision

elements[].type

String

Currency type (FIAT, CRYPTO_COIN, CRYPTO_TOKEN_ERC20, CRYPTO_FUTURES)

elements[].isWalletEnabled

Boolean

Can user create a wallet with this currency

elements[].isActive

Boolean

Is this currency enabled

elements[].disabledMessage

Null

Custom description provided from admin

elements[].txExplorerUrl

String

Internet resource to get information about transaction with this currency

elements[].withdrawUserFee

Null

FEE for withdrawal operation for this currency

totalElements

Number

Currencies count

3.3. Market controller

3.3.1. Markets list

Curl example
$ curl 'https://public-api.utorg.io/api/v1/markets' -i -X GET
HTTP Request
GET /api/v1/markets HTTP/1.1
Host: public-api.utorg.io
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 960

{
  "elements" : [ {
    "id" : 1,
    "baseCurrencyId" : 3,
    "quoteCurrencyId" : 1,
    "baseCurrencyCode" : "BTC",
    "quoteCurrencyCode" : "USD",
    "isActive" : true,
    "title" : "BTC_USD",
    "feeSetId" : 1,
    "disabled" : false,
    "minAmount" : 1.0E-7,
    "maxAmount" : 100000,
    "priceLimit" : 1000
  }, {
    "id" : 2,
    "baseCurrencyId" : 2,
    "quoteCurrencyId" : 1,
    "baseCurrencyCode" : "ETH",
    "quoteCurrencyCode" : "USD",
    "isActive" : true,
    "title" : "ETH_USD",
    "feeSetId" : 2,
    "disabled" : false,
    "minAmount" : 1.0E-7,
    "maxAmount" : 1000,
    "priceLimit" : 100
  }, {
    "id" : 3,
    "baseCurrencyId" : 4,
    "quoteCurrencyId" : 1,
    "baseCurrencyCode" : "RUB",
    "quoteCurrencyCode" : "USD",
    "isActive" : true,
    "title" : "RUB_USD",
    "feeSetId" : 3,
    "disabled" : false,
    "minAmount" : 30,
    "maxAmount" : 100000000,
    "priceLimit" : 100
  } ],
  "totalElements" : 3
}
Response fields
Path Type Description

elements

Array

Market list

elements[].id

Number

Market identifier

elements[].baseCurrencyId

Number

Base currency identifier

elements[].quoteCurrencyId

Number

Quote currency identifier

elements[].baseCurrencyCode

String

Base currency code

elements[].quoteCurrencyCode

String

Quote currency code

elements[].isActive

Boolean

Is market active

elements[].title

String

Market title

elements[].feeSetId

Number

Fee set identifier associated with market

elements[].disabled

Boolean

Is market disabled

elements[].minAmount

Number

Market’s min amount

elements[].maxAmount

Number

Market’s max amount

elements[].priceLimit

Number

Price limit

totalElements

Number

Markets count

3.3.2. Order book

Curl example
$ curl 'https://public-api.utorg.io/api/v1/market/1/orderbook' -i -X GET
HTTP Request
GET /api/v1/market/1/orderbook HTTP/1.1
Host: public-api.utorg.io

3.3.3. Last market price

Curl example
$ curl 'https://public-api.utorg.io/api/v1/market/1/price' -i -X GET
HTTP Request
GET /api/v1/market/1/price HTTP/1.1
Host: public-api.utorg.io

3.3.4. All markets stats

Curl example
$ curl 'https://public-api.utorg.io/api/v1/market/stats' -i -X GET
HTTP Request
GET /api/v1/market/stats HTTP/1.1
Host: public-api.utorg.io
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 3

[ ]

3.3.5. Market stats

Curl example
$ curl 'https://public-api.utorg.io/api/v1/market/stats?marketId=1' -i -X GET
HTTP Request
GET /api/v1/market/stats?marketId=1 HTTP/1.1
Host: public-api.utorg.io
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 3

[ ]

3.3.6. OHLCV history for market

Curl example
$ curl 'https://public-api.utorg.io/api/v1/market/1/ohlcv?resolution=1m&dateFrom=1570138940&dateTo=1570238940' -i -X GET
HTTP Request
GET /api/v1/market/1/ohlcv?resolution=1m&dateFrom=1570138940&dateTo=1570238940 HTTP/1.1
Host: public-api.utorg.io
Request parameters
Parameter Description

resolution

Stats resolution (default 1m)

dateFrom

Unix timestamp from which to search stats (optional)

dateTo

Unix timestamp before which to search stats (optional) (ISO 8601)

3.3.7. Trades history

Curl example
$ curl 'https://public-api.utorg.io/api/v1/markets/trade/history?markets=1&markets=2&markets=3&accountId=1&side=BUY&type=MARKET&dateFrom=2019-01-01T00%3A00%3A00.000Z&dateTo=2019-01-10T00%3A00%3A00.000Z&limit=20&offset=0' -i -X GET \
    -H 'X-token: X-JWT-Token-Value' \
    -H 'uuid: uuid'
HTTP Request
GET /api/v1/markets/trade/history?markets=1&markets=2&markets=3&accountId=1&side=BUY&type=MARKET&dateFrom=2019-01-01T00%3A00%3A00.000Z&dateTo=2019-01-10T00%3A00%3A00.000Z&limit=20&offset=0 HTTP/1.1
X-token: X-JWT-Token-Value
uuid: uuid
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

How to work with Limit and Offset https://www.postgresql.org/docs/8.2/queries-limit.html
Request parameters
Parameter Description

markets

List of markets to search (optional)

accountId

User account ID (optional)

side

Side (BUY, SELL) (optional)

type

Order type (MARKET, LIMIT) (optional)

dateFrom

Date and time from which to search trades (optional) (ISO 8601)

dateTo

Date and time before which to search trades (optional) (ISO 8601)

limit

Limit

offset

Offset to get data

3.3.8. Last trades for market

Curl example
$ curl 'https://public-api.utorg.io/api/v1/market/1/trades' -i -X GET
HTTP Request
GET /api/v1/market/1/trades HTTP/1.1
Host: public-api.utorg.io

3.4. Order controller

3.4.1. Open new order

Curl example
$ curl 'https://public-api.utorg.io/api/v1/orders' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-token: X-JWT-Token-Value' \
    -d '{
  "type" : "MARKET",
  "amount" : 1.2,
  "marketId" : 1,
  "price" : 61.0,
  "side" : "BUY"
}'
HTTP Request
POST /api/v1/orders HTTP/1.1
Content-Type: application/json
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Content-Length: 95

{
  "type" : "MARKET",
  "amount" : 1.2,
  "marketId" : 1,
  "price" : 61.0,
  "side" : "BUY"
}
Request headers
Name Description

X-token

Authorization JWT token

HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 596

{
  "id" : 123456,
  "marketId" : 1,
  "initialAmount" : 1.2,
  "amount" : 1.2,
  "reserved" : 1000,
  "initialReserved" : 10,
  "price" : 62.0,
  "accountId" : 1,
  "side" : "BUY",
  "isActive" : true,
  "feeSetId" : 1,
  "closeReason" : "OPEN",
  "type" : "MARKET",
  "closedAt" : 0,
  "uuid" : "0e7f6062-9276-4a4f-a761-67e305c898cb",
  "createdAt" : 1572935509399,
  "feeAmount" : 2.5,
  "processedAt" : 0,
  "matchedAmount" : 1.2,
  "state" : "STATE_PENDING",
  "feeSetValueId" : 3,
  "makerFee" : 1.11,
  "takerFee" : 1.09,
  "avgPrice" : 61.2,
  "currencyCode" : "USD",
  "tradeCount" : 3
}
Response fields
Path Type Description

id

Number

Order identifier

marketId

Number

Market identifier

initialAmount

Number

Initial amount

amount

Number

Order amount which was placed

reserved

Number

Reserved amount

initialReserved

Number

Initial reserved amount

price

Number

Price which used to place order

accountId

Number

Account ID of user who opened order

side

String

Order side (BUY, SELL)

isActive

Boolean

Is order active now

feeSetId

Number

Fee set id which was applied when order was placed

closeReason

String

Order Close reason (if it was closed)

type

String

Order type (MARKET, LIMIT)

closedAt

Number

Time when order was closed

uuid

String

Order UUID

createdAt

Number

Order creation time

feeAmount

Number

Fee value, which was applied for order (Used for closed order only)

processedAt

Number

Order processing time

matchedAmount

Number

Amount which was matched with order

state

String

Order state (STATE_ACTIVE, STATE_COMPLETED, STATE_PENDING)

feeSetValueId

Number

Order fee set value ID

makerFee

Number

Maker fee, %

takerFee

Number

Taker fee, %

avgPrice

Number

Average price (Used only fro closed orders)

currencyCode

String

Currency code

tradeCount

Number

How many trades was executed for order

3.4.2. Close order

Curl example
$ curl 'https://public-api.utorg.io/api/v1/order/1' -i -X DELETE \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
DELETE /api/v1/order/1 HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 601

{
  "id" : 1,
  "marketId" : 1,
  "initialAmount" : 1000.0,
  "amount" : 100.0,
  "reserved" : 1000,
  "initialReserved" : 10,
  "price" : 66.55,
  "accountId" : 1,
  "side" : "BUY",
  "isActive" : true,
  "feeSetId" : 1,
  "closeReason" : "OPEN",
  "type" : "MARKET",
  "closedAt" : 0,
  "uuid" : "87df220b-5032-4749-a451-e7395b65b282",
  "createdAt" : 1572935509141,
  "feeAmount" : 2.5,
  "processedAt" : 0,
  "matchedAmount" : 99.0,
  "state" : "STATE_COMPLETED",
  "feeSetValueId" : 3,
  "makerFee" : 1.11,
  "takerFee" : 1.09,
  "avgPrice" : 66.22,
  "currencyCode" : "USD",
  "tradeCount" : 3
}
Response fields
Path Type Description

id

Number

Order identifier

marketId

Number

Market identifier

initialAmount

Number

Initial amount

amount

Number

Order amount which was placed

reserved

Number

Reserved amount

initialReserved

Number

Initial reserved amount

price

Number

Price which used to place order

accountId

Number

Account ID of user who opened order

side

String

Order side (BUY, SELL)

isActive

Boolean

Is order active now

feeSetId

Number

Fee set id which was applied when order was placed

closeReason

String

Order Close reason (if it was closed)

type

String

Order type (MARKET, LIMIT)

closedAt

Number

Time when order was closed

uuid

String

Order UUID

createdAt

Number

Order creation time

feeAmount

Number

Fee value, which was applied for order (Used for closed order only)

processedAt

Number

Order processing time

matchedAmount

Number

Amount which was matched with order

state

String

Order state (STATE_ACTIVE, STATE_COMPLETED, STATE_PENDING)

feeSetValueId

Number

Order fee set value ID

makerFee

Number

Maker fee, %

takerFee

Number

Taker fee, %

avgPrice

Number

Average price (Used only fro closed orders)

currencyCode

String

Currency code

tradeCount

Number

How many trades was executed for order

3.4.3. Search open orders

Curl example
$ curl 'https://public-api.utorg.io/api/v1/orders?dateFrom=2019-01-01T00%3A00%3A00.000Z&dateTo=2019-01-10T00%3A00%3A00.000Z&side=BUY&limit=20&offset=0&markets=1&markets=2&markets=3&orderType=LIMIT&closeReason=MARKET_ORDER_NOT_FILLED&state=STATE_PENDING' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/orders?dateFrom=2019-01-01T00%3A00%3A00.000Z&dateTo=2019-01-10T00%3A00%3A00.000Z&side=BUY&limit=20&offset=0&markets=1&markets=2&markets=3&orderType=LIMIT&closeReason=MARKET_ORDER_NOT_FILLED&state=STATE_PENDING HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

Request parameters
Parameter Description

dateFrom

Date and time from which to search orders (optional) (ISO 8601)

dateTo

Date and time before which to search orders (optional) (ISO 8601)

side

Side (BUY, SELL) (optional)

limit

Limit

offset

Offset

markets

List of markets to search (optional)

orderType

Order type (MARKET, LIMIT) (optional)

closeReason

Close reason (COMPLETED, CANCELLED, ERROR, MARKET_ORDER_NOT_FILLED, PARTIALLY_FILLED, EMPTY_AMOUNT, TOO_LOW_AMOUNT, TOO_LOW_MATCH, MARKET_DISABLED, TIME_EXPIRED, OPEN) (optional)

state

Order state (STATE_ACTIVE, STATE_COMPLETED, STATE_PENDING) (optional)

How to work with Limit and Offset https://www.postgresql.org/docs/8.2/queries-limit.html
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 61

{
  "elements" : [ ],
  "cursor" : 0,
  "totalElements" : 0
}
Response fields
Path Type Description

elements

Array

Orders list

cursor

Number

Current cursor position

totalElements

Number

Total orders by search criteria

3.4.4. Search closed orders

Curl example
$ curl 'https://public-api.utorg.io/api/v1/orders/history?dateFrom=2019-01-01T00%3A00%3A00.000Z&dateTo=2019-01-10T00%3A00%3A00.000Z&side=BUY&limit=20&offset=0&markets=1&markets=2&markets=3&orderType=LIMIT&closeReason=MARKET_ORDER_NOT_FILLED&state=STATE_PENDING' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/orders/history?dateFrom=2019-01-01T00%3A00%3A00.000Z&dateTo=2019-01-10T00%3A00%3A00.000Z&side=BUY&limit=20&offset=0&markets=1&markets=2&markets=3&orderType=LIMIT&closeReason=MARKET_ORDER_NOT_FILLED&state=STATE_PENDING HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

Request parameters
Parameter Description

dateFrom

Date and time from which to search orders (optional) (ISO 8601)

dateTo

Date and time before which to search orders (optional) (ISO 8601)

side

Side (BUY, SELL) (optional)

limit

Limit

offset

Offset

markets

List of markets to search (optional)

orderType

Order type (MARKET, LIMIT) (optional)

closeReason

Close reason (COMPLETED, CANCELLED, ERROR, MARKET_ORDER_NOT_FILLED, PARTIALLY_FILLED, EMPTY_AMOUNT, TOO_LOW_AMOUNT, TOO_LOW_MATCH, MARKET_DISABLED, TIME_EXPIRED, OPEN) (optional)

state

Order state (STATE_ACTIVE, STATE_COMPLETED, STATE_PENDING) (optional)

HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 61

{
  "elements" : [ ],
  "cursor" : 0,
  "totalElements" : 0
}
Response fields
Path Type Description

elements

Array

Orders list

cursor

Number

Current cursor position

totalElements

Number

Total orders by search criteria

3.4.5. Order details

Curl example
$ curl 'https://public-api.utorg.io/api/v1/order/1' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/order/1 HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

3.4.6. Last trades by order

Curl example
$ curl 'https://public-api.utorg.io/api/v1/order/1' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/order/1 HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

3.5. Payment controller

3.5.1. Payment methods list

Curl example
$ curl 'https://public-api.utorg.io/api/v1/payments/methods' -i -X GET
HTTP Request
GET /api/v1/payments/methods HTTP/1.1
Host: public-api.utorg.io
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 492

{
  "methods" : [ {
    "id" : 1,
    "type" : "DEPOSIT",
    "provider" : "CAPITALIST",
    "methodType" : "MASTERCARD",
    "currencyId" : 1,
    "systemFeePercent" : 1.1,
    "systemFeeAmount" : 10,
    "minAmount" : 10,
    "maxAmount" : 9999.99,
    "kycRequired" : false,
    "corporateVerified" : false,
    "active" : true,
    "currencyCode" : "USD",
    "feeOnTop" : true,
    "systemFeeMinAmount" : 2,
    "countries" : "Russia, Ukraine",
    "feeDepositFromAmount" : false
  } ]
}
Response fields
Path Type Description

methods

Array

Payment methods list

methods[].id

Number

Payment method identifier

methods[].type

String

Payment method’s transaction type

methods[].provider

String

Payment provider name

methods[].methodType

String

Payment method type

methods[].currencyId

Number

Currency ID

methods[].systemFeePercent

Number

Relative fee - %

methods[].systemFeeAmount

Number

Absolute fee

methods[].minAmount

Number

Min transaction amount

methods[].maxAmount

Number

Max transaction amount

methods[].kycRequired

Boolean

Should user pass KYC check to use this method or not

methods[].corporateVerified

Boolean

Should user pass corporate KYC check to use this method or not

methods[].active

Boolean

Is payment method active

methods[].currencyCode

String

Currency code

methods[].feeOnTop

Boolean

Fee on top or not

methods[].systemFeeMinAmount

Number

Min amount of fee which will be collected

methods[].countries

String

Cards only, from which countries cards are accepted

methods[].feeDepositFromAmount

Boolean

Fee for deposit from requested amount

3.5.2. Create FIAT deposit order

Curl example
$ curl 'https://public-api.utorg.io/api/v1/payments/deposit' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-token: X-JWT-Token-Value' \
    -H 'uuid: uuid' \
    -d '{
  "methodId" : 1,
  "amount" : 100
}'
HTTP Request
POST /api/v1/payments/deposit HTTP/1.1
Content-Type: application/json
X-token: X-JWT-Token-Value
uuid: uuid
Host: public-api.utorg.io
Content-Length: 38

{
  "methodId" : 1,
  "amount" : 100
}
Request headers
Name Description

X-token

Authorization JWT token

3.5.3. Create withdrawal request

Curl example
$ curl 'https://public-api.utorg.io/api/v1/payments/withdrawal' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-token: X-JWT-Token-Value' \
    -H 'uuid: uuid' \
    -d '{
  "password" : "PassW0RD",
  "methodId" : 1,
  "twofaCode" : "123456",
  "amount" : 100,
  "receivingAddress" : "1BoatSLRHtKNngkdXEeobR76b53LETtpyT",
  "currencyId" : 1,
  "method" : "CRYPTO"
}'
HTTP Request
POST /api/v1/payments/withdrawal HTTP/1.1
Content-Type: application/json
X-token: X-JWT-Token-Value
uuid: uuid
Host: public-api.utorg.io
Content-Length: 195

{
  "password" : "PassW0RD",
  "methodId" : 1,
  "twofaCode" : "123456",
  "amount" : 100,
  "receivingAddress" : "1BoatSLRHtKNngkdXEeobR76b53LETtpyT",
  "currencyId" : 1,
  "method" : "CRYPTO"
}
Request headers
Name Description

X-token

Authorization JWT token

3.5.4. Create withdrawal request using API

Curl example
$ curl 'https://public-api.utorg.io/api/v1/payments/transparent/withdrawal' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-api-key: API-key-value' \
    -H 'X-api-sid: API-secret' \
    -H 'X-api-key-checksum: 282401a653ebc33406680e4f05a78d76b5297d70898112fd9b850eb6ab80c38d' \
    -d '{
  "password" : null,
  "methodId" : 1,
  "twofaCode" : null,
  "amount" : 100,
  "receivingAddress" : "1BoatSLRHtKNngkdXEeobR76b53LETtpyT",
  "currencyId" : 1,
  "method" : "CRYPTO"
}'
HTTP Request
POST /api/v1/payments/transparent/withdrawal HTTP/1.1
Content-Type: application/json
X-api-key: API-key-value
X-api-sid: API-secret
X-api-key-checksum: 282401a653ebc33406680e4f05a78d76b5297d70898112fd9b850eb6ab80c38d
Host: public-api.utorg.io
Content-Length: 185

{
  "password" : null,
  "methodId" : 1,
  "twofaCode" : null,
  "amount" : 100,
  "receivingAddress" : "1BoatSLRHtKNngkdXEeobR76b53LETtpyT",
  "currencyId" : 1,
  "method" : "CRYPTO"
}
Request headers
Name Description

X-api-sid

API key secret

X-api-key

API key value

X-api-key-checksum

Payload checksum (HMAC-SHA256 with key API-SID)

3.5.5. Get withdrawal usage

Users withdrawal amounts during day/month in Usd ===== Curl example

$ curl 'https://public-api.utorg.io/api/v1/payments/withdrawal/usage' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/payments/withdrawal/usage HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

3.5.6. Confirm withdrawal request

Curl example
$ curl 'https://public-api.utorg.io/api/v1/payments/withdrawal/1/confirm/token' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-token: X-JWT-Token-Value' \
    -H 'uuid: uuid'
HTTP Request
POST /api/v1/payments/withdrawal/1/confirm/token HTTP/1.1
Content-Type: application/json
X-token: X-JWT-Token-Value
uuid: uuid
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

3.6. User controller

3.6.1. Sign up

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/signup' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "password" : "PassW0RD",
  "captchaResponseToken" : "token",
  "address" : "",
  "firstName" : "FirstName",
  "lastName" : "LastName",
  "locale" : "ru_RU",
  "country" : "Russia",
  "confirmationType" : "DEFAULT",
  "username" : "username",
  "refId" : null,
  "email" : "[email protected]",
  "phoneNumber" : "+791111111111"
}'
HTTP Request
POST /api/v1/user/signup HTTP/1.1
Content-Type: application/json
Host: public-api.utorg.io
Content-Length: 328

{
  "password" : "PassW0RD",
  "captchaResponseToken" : "token",
  "address" : "",
  "firstName" : "FirstName",
  "lastName" : "LastName",
  "locale" : "ru_RU",
  "country" : "Russia",
  "confirmationType" : "DEFAULT",
  "username" : "username",
  "refId" : null,
  "email" : "[email protected]",
  "phoneNumber" : "+791111111111"
}
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
X-token: X-JWT-Token-Value
Content-Type: application/json;charset=UTF-8
Content-Length: 1047

{
  "user" : {
    "uuid" : "34c209c4-0434-4b38-af59-78fcff0186a5",
    "username" : "username",
    "phoneNumber" : "+791111111111",
    "email" : "[email protected]",
    "isGoogleAuthEnabled" : false,
    "isPhoneAuthEnabled" : false,
    "isEmailConfirmed" : true,
    "isActive" : true,
    "hasAPIAccess" : false,
    "registeredAt" : 1572935498273,
    "markets" : null,
    "kycStatus" : "NOT_VERIFIED",
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "address" : "",
    "country" : "Russia",
    "accounts" : [ 1 ],
    "chatAdmin" : false,
    "isUsernameUpdated" : true,
    "paymentPlan" : {
      "id" : 1,
      "title" : "Default payment plan",
      "currencyCode" : "USD",
      "currencyId" : 1,
      "verificationStatus" : "NOT_VERIFIED",
      "isActive" : true,
      "isPublic" : true,
      "isDefault" : true
    },
    "kycUserStatus" : "NEW",
    "locale" : "ru_RU",
    "isWithdrawActive" : false,
    "accountId" : 1,
    "checkIpAddress" : true
  },
  "token" : "X-JWT-Token-Value",
  "nextStep" : "NO"
}
Response headers
Name Description

X-token

Authorization JWT token

Response fields
Path Type Description

user

Object

User object

user.uuid

String

User UUID

user.username

String

User nickname

user.phoneNumber

String

User phone number

user.email

String

User email

user.isGoogleAuthEnabled

Boolean

Google 2FA authorization enabled flag

user.isPhoneAuthEnabled

Boolean

SMS 2FA authorization enabled flag

user.isEmailConfirmed

Boolean

Email confirmed or not

user.isActive

Boolean

Is user enabled

user.hasAPIAccess

Boolean

Does user enable API access or not

user.registeredAt

Number

User registration datetime

user.markets

Null

List of favourite markets

user.kycStatus

String

User KYC status

user.firstName

String

User first name

user.lastName

String

User last name

user.address

String

User address

user.country

String

User country

user.accounts

Array

User account list (DEPRECATED)

user.chatAdmin

Boolean

Is user chat admin or not

user.isUsernameUpdated

Boolean

Is username update enabled or not

user.kycUserStatus

String

KYC verification status

user.locale

String

User locale

user.isWithdrawActive

Boolean

Could user make withdrawal operations or not

user.accountId

Number

User account ID

user.checkIpAddress

Boolean

Allow user to check IP address or not

user.paymentPlan

Object

Active payment plan for user

user.paymentPlan.id

Number

Payment plan ID

user.paymentPlan.title

String

Payment plan name

user.paymentPlan.currencyCode

String

Payment plan’s currency code

user.paymentPlan.currencyId

Number

Payment plan’s currency ID

user.paymentPlan.verificationStatus

String

Verification status for this payment plan

user.paymentPlan.isActive

Boolean

Is payment plan enabled now or not

user.paymentPlan.isPublic

Boolean

Is payment plan for public use

user.paymentPlan.isDefault

Boolean

Is it default payment plan

token

String

Authorization token

nextStep

String

Next sign up step (if needed)

3.6.2. Sign in

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/login' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "password" : "PassW0RD",
  "captchaResponseToken" : "captcha",
  "email" : "[email protected]"
}'
HTTP Request
POST /api/v1/user/login HTTP/1.1
Content-Type: application/json
Host: public-api.utorg.io
Content-Length: 96

{
  "password" : "PassW0RD",
  "captchaResponseToken" : "captcha",
  "email" : "[email protected]"
}
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
X-token: X-JWT-Token-Value
Content-Type: application/json;charset=UTF-8
Content-Length: 1047

{
  "user" : {
    "uuid" : "34c209c4-0434-4b38-af59-78fcff0186a5",
    "username" : "username",
    "phoneNumber" : "+791111111111",
    "email" : "[email protected]",
    "isGoogleAuthEnabled" : false,
    "isPhoneAuthEnabled" : false,
    "isEmailConfirmed" : true,
    "isActive" : true,
    "hasAPIAccess" : false,
    "registeredAt" : 1572935498273,
    "markets" : null,
    "kycStatus" : "NOT_VERIFIED",
    "firstName" : "FirstName",
    "lastName" : "LastName",
    "address" : "",
    "country" : "Russia",
    "accounts" : [ 1 ],
    "chatAdmin" : false,
    "isUsernameUpdated" : true,
    "paymentPlan" : {
      "id" : 1,
      "title" : "Default payment plan",
      "currencyCode" : "USD",
      "currencyId" : 1,
      "verificationStatus" : "NOT_VERIFIED",
      "isActive" : true,
      "isPublic" : true,
      "isDefault" : true
    },
    "kycUserStatus" : "NEW",
    "locale" : "ru_RU",
    "isWithdrawActive" : false,
    "accountId" : 1,
    "checkIpAddress" : true
  },
  "token" : "X-JWT-Token-Value",
  "nextStep" : "NO"
}
Response headers
Name Description

X-token

Authorization JWT token

Response fields
Path Type Description

user

Object

User object

user.uuid

String

User UUID

user.username

String

User nickname

user.phoneNumber

String

User phone number

user.email

String

User email

user.isGoogleAuthEnabled

Boolean

Google 2FA authorization enabled flag

user.isPhoneAuthEnabled

Boolean

SMS 2FA authorization enabled flag

user.isEmailConfirmed

Boolean

Email confirmed or not

user.isActive

Boolean

Is user enabled

user.hasAPIAccess

Boolean

Does user enable API access or not

user.registeredAt

Number

User registration datetime

user.markets

Null

List of favourite markets

user.kycStatus

String

User KYC status

user.firstName

String

User first name

user.lastName

String

User last name

user.address

String

User address

user.country

String

User country

user.accounts

Array

User account list (DEPRECATED)

user.chatAdmin

Boolean

Is user chat admin or not

user.isUsernameUpdated

Boolean

Is username update enabled or not

user.kycUserStatus

String

KYC verification status

user.locale

String

User locale

user.isWithdrawActive

Boolean

Could user make withdrawal operations or not

user.accountId

Number

User account ID

user.checkIpAddress

Boolean

Allow user to check IP address or not

user.paymentPlan

Object

Active payment plan for user

user.paymentPlan.id

Number

Payment plan ID

user.paymentPlan.title

String

Payment plan name

user.paymentPlan.currencyCode

String

Payment plan’s currency code

user.paymentPlan.currencyId

Number

Payment plan’s currency ID

user.paymentPlan.verificationStatus

String

Verification status for this payment plan

user.paymentPlan.isActive

Boolean

Is payment plan enabled now or not

user.paymentPlan.isPublic

Boolean

Is payment plan for public use

user.paymentPlan.isDefault

Boolean

Is it default payment plan

token

String

Authorization token

nextStep

String

Next sign up step (if needed)

3.6.3. Logout

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/logout' -i -X POST \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
POST /api/v1/user/logout HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 26

{
  "isLoggedOut" : true
}

3.6.4. Start enabling Google 2FA

Returns secret and QR’s code URL to scan with app. Current password is required to bind 2FA.

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/auth/2fa/google' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-token: X-JWT-Token-Value' \
    -d '{
  "password" : "PassW0RD"
}'
HTTP Request
POST /api/v1/user/auth/2fa/google HTTP/1.1
Content-Type: application/json
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Content-Length: 29

{
  "password" : "PassW0RD"
}
Request headers
Name Description

X-token

Authorization JWT token

HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 43

{
  "secret" : "secret",
  "qrURL" : "qr"
}

3.6.5. Enable Google 2FA

Checks a code from Google Authenticator app and enables 2FA if it’s correct.

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/auth/2fa/google/bind' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-token: X-JWT-Token-Value' \
    -d '{
  "code" : "123456"
}'
HTTP Request
POST /api/v1/user/auth/2fa/google/bind HTTP/1.1
Content-Type: application/json
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Content-Length: 23

{
  "code" : "123456"
}

3.6.6. Sign in with Google 2FA

Errors:

  • UNAUTHORIZED

  • ACCESS_DENIED

  • VALIDATION_ERROR

  • TWO_FACTOR_INVALID_TOKEN

  • TWO_FACTOR_VECTOR_DISABLED

  • TWO_FACTOR_TOKEN_EXPIRED

  • TWO_FACTOR_INVALID_CODE

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/auth/2fa/google/login' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "token" : "2FA-Token",
  "code" : "123456"
}'
HTTP Request
POST /api/v1/user/auth/2fa/google/login HTTP/1.1
Content-Type: application/json
Host: public-api.utorg.io
Content-Length: 48

{
  "token" : "2FA-Token",
  "code" : "123456"
}

3.6.7. Disable Google 2FA

Code and current password are required for this call.

Errors:

  • VALIDATION_ERROR

  • TWO_FACTOR_VECTOR_DISABLED

  • TWO_FACTOR_INVALID_CODE

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/auth/2fa/google' -i -X DELETE \
    -H 'Content-Type: application/json' \
    -H 'X-token: X-JWT-Token-Value' \
    -d '{
  "password" : "PassW0RD",
  "code" : "123456"
}'
HTTP Request
DELETE /api/v1/user/auth/2fa/google HTTP/1.1
Content-Type: application/json
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Content-Length: 50

{
  "password" : "PassW0RD",
  "code" : "123456"
}
Request headers
Name Description

X-token

Authorization JWT token

3.6.8. Confirm email

Errors:

  • VALIDATION_ERROR

  • INVALID_LOGIN_OR_PASSWORD

  • EMAIL_ALREADY_CONFIRMED

  • EMAIL_CONFIRM_TOKEN_EXPIRED

  • EMAIL_CONFIRM_BAD_TOKEN

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/email/confirmation/confirm' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "token" : "token"
}'
HTTP Request
POST /api/v1/user/email/confirmation/confirm HTTP/1.1
Content-Type: application/json
Host: public-api.utorg.io
Content-Length: 23

{
  "token" : "token"
}

3.6.9. Resend email confirmation

Errors:

  • VALIDATION_ERROR

  • TOO_OFTEN

  • INVALID_LOGIN_OR_PASSWORD

  • EMAIL_ALREADY_CONFIRMED

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/email/confirmation/resend' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "confirmationType" : "DEFAULT",
  "email" : "[email protected]"
}'
HTTP Request
POST /api/v1/user/email/confirmation/resend HTTP/1.1
Content-Type: application/json
Host: public-api.utorg.io
Content-Length: 65

{
  "confirmationType" : "DEFAULT",
  "email" : "[email protected]"
}

3.6.10. Change password

Errors:

  • ACCESS_DENIED

  • INVALID_PASSWORD

  • PASSWORDS_ARE_SAME

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/password/change' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-token: X-JWT-Token-Value' \
    -d '{
  "oldPassword" : "PassW0RD",
  "code" : "123456",
  "newPassword" : "NeWPassW0RD"
}'
HTTP Request
POST /api/v1/user/password/change HTTP/1.1
Content-Type: application/json
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Content-Length: 86

{
  "oldPassword" : "PassW0RD",
  "code" : "123456",
  "newPassword" : "NeWPassW0RD"
}
Request headers
Name Description

X-token

Authorization JWT token

3.6.11. Reset password request

Errors:

  • VALIDATION_ERROR

  • USER_NOT_FOUND

  • TOO_OFTEN

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/password/reset' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "confirmationType" : "DEFAULT",
  "email" : "[email protected]"
}'
HTTP Request
POST /api/v1/user/password/reset HTTP/1.1
Content-Type: application/json
Host: public-api.utorg.io
Content-Length: 65

{
  "confirmationType" : "DEFAULT",
  "email" : "[email protected]"
}

3.6.12. Set a new password

Errors:

  • VALIDATION_ERROR

  • USER_NOT_FOUND

  • EXPIRED_TOKEN

  • BAD_TOKEN

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/password/reset/change' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "token" : "Password-token",
  "email" : "[email protected]",
  "newPassword" : "NeWPassW0RD"
}'
HTTP Request
POST /api/v1/user/password/reset/change HTTP/1.1
Content-Type: application/json
Host: public-api.utorg.io
Content-Length: 94

{
  "token" : "Password-token",
  "email" : "[email protected]",
  "newPassword" : "NeWPassW0RD"
}

3.6.13. Get user activity information

Errors:

  • ACCESS_DENIED

Table 1. Activity types:

Type

Description

SIGNUP

Sing up

PASSWORD_LOGIN

Login

SMS_2FA_LOGIN

Login with SMS 2FA

SMS_2FA_START_ENABLE

Start enabling SMS 2FA

SMS_2FA_ENABLE

Enable SMS 2FA

SMS_2FA_START_DISABLE

Start disabling SMS 2FA

SMS_2FA_DISABLE

Disable SMS 2FA

GOOGLE_2FA_LOGIN

Login with Google Authenticator 2FA

GOOGLE_2FA_START_ENABLE

Statr enabling Google Authenticator 2FA

GOOGLE_2FA_ENABLE

Enable Google Authenticator 2FA

GOOGLE_2FA_START_DISABLE

Start disabling Google Authenticator 2FA

GOOGLE_2FA_DISABLE

Disable Google Authenticator 2FA

EMAIL_CONFIRMATION_REQUEST

Request of email confirmation

EMAIL_CONFIRM

Confirm email address

PASSWORD_RESET_REQUEST

Request of password reset

PASSWORD_CHANGE

Change password

REGISTERED_NEW_IP

New user’s IP address registered

PROFILE_UPDATED

Update profile

ORDER_CREATED

Create order

ORDER_CANCELLED

Cancel order

DEPOSIT_ADDR_REQUESTED

Request deposit address

WITHDRAWAL_REQUESTED

Request withdrawal

WITHDRAWAL_CANCELLED

Cancel withdrawal

API_KEY_EMAIL_CONFIRMATION_REQUEST

Request of API key email confirmation

API_KEY_EMAIL_CONFIRMATION

Confirm API key email

LOGOUT

Logout

ORDER_EXPIRATION_TIME_UPDATED

Update order’s expiration time

PASSWORD_RESET

Reset password

KYC_IDENTITY_VERIFICATION_SENT

Send KYC identity verification data

KYC_IDENTITY_VERIFICATION_PASSED

Pass KYC identity verification

KYC_IDENTITY_VERIFICATION_REJECTED

Reject KYC identity verification

KYC_IDENTITY_VERIFICATION_IN_PROGRESS

KYC in progress

KYC_IDENTITY_VERIFICATION_CORRECTIONS_REQUESTED

AML officer requests KYC identity verification corrections

KYC_IDENTITY_VERIFICATION_APPLICATION_UPDATED

Update KYC identity verification application

API_KEY_DISABLED

Deprecated

API_KEY_ENABLED

Deprecated

API_KEY_REVOKE_CONFIRMATION_REQUEST

Request revoke of API key

API_KEY_REVOKE_CONFIRMATION

Revoke API key confirmation

VOUCHER_CREATED

Create voucher

VOUCHER_CONFIRMED

Confirm voucher

VOUCHER_REDEEMED

R edeem voucher

API_KEY_STATE_CHANGED

Change API key state

FREEZE_ACCOUNT

Freeze account

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/activity?dateFrom=2019-01-01T00%3A00%3A00.000Z&dateTo=2019-01-10T00%3A00%3A00.000Z&type=ORDER_CREATED&limit=10&offset=0' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/user/activity?dateFrom=2019-01-01T00%3A00%3A00.000Z&dateTo=2019-01-10T00%3A00%3A00.000Z&type=ORDER_CREATED&limit=10&offset=0 HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

Request parameters
Parameter Description

dateFrom

Date and time from which to search for activities (optional) (ISO 8601)

dateTo

Date and time before which to search for activities (optional) (ISO 8601)

type

Type of activity (optional)

limit

Max activities to show in response (optional)

offset

Start offset of activity list (optional)

3.6.14. Update user settings

Errors:

  • ACCESS_DENIED

  • VALIDATION_ERROR

  • USERNAME_UPDATED_TOO_OFTEN

  • DUPLICATED_USERNAME

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/update' -i -X PATCH \
    -H 'Content-Type: application/json' \
    -H 'X-token: X-JWT-Token-Value' \
    -d '{
  "checkIpAddress" : false,
  "address" : "address",
  "firstName" : "FirstName",
  "lastName" : "LastName",
  "locale" : "ru_RU",
  "country" : null,
  "username" : null,
  "phoneNumber" : "+791111111111"
}'
HTTP Request
PATCH /api/v1/user/update HTTP/1.1
Content-Type: application/json
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Content-Length: 209

{
  "checkIpAddress" : false,
  "address" : "address",
  "firstName" : "FirstName",
  "lastName" : "LastName",
  "locale" : "ru_RU",
  "country" : null,
  "username" : null,
  "phoneNumber" : "+791111111111"
}
Request headers
Name Description

X-token

Authorization JWT token

3.6.15. Get user settings

Errors:

  • ACCESS_DENIED

  • VALIDATION_ERROR

  • USERNAME_UPDATED_TOO_OFTEN

  • DUPLICATED_USERNAME

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/settings' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/user/settings HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

3.6.16. Toggle a favorite market

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/markets/favorite/1' -i -X POST \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
POST /api/v1/user/markets/favorite/1 HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

3.6.17. Get favorite markets list

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/markets/favorite' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/user/markets/favorite HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 3

[ ]

3.6.18. Check user exists

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/exists' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "username" : "username",
  "email" : "[email protected]"
}'
HTTP Request
POST /api/v1/user/exists HTTP/1.1
Content-Type: application/json
Host: public-api.utorg.io
Content-Length: 58

{
  "username" : "username",
  "email" : "[email protected]"
}

3.6.19. Freeze user

Curl example
$ curl 'https://public-api.utorg.io/api/v1/user/freeze?tid=1.token' -i -X POST
HTTP Request
POST /api/v1/user/freeze?tid=1.token HTTP/1.1
Host: public-api.utorg.io
Content-Type: application/x-www-form-urlencoded

tid=1.token
Request parameters
Parameter Description

tid

Freeze token value

HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 64

{
  "accountId" : 1,
  "frozenAt" : "2019-11-05T06:31:55+0000"
}
Response fields
Path Type Description

accountId

Number

Account ID

frozenAt

String

Time when user was frozen

3.7. Vouchers controller

3.7.1. Create new voucher

Curl example
$ curl 'https://public-api.utorg.io/api/v1/vouchers' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-token: X-JWT-Token-Value' \
    -d '{
  "password" : "PassW0RD",
  "methodId" : 1,
  "twofaCode" : "[email protected]",
  "amount" : 100.0
}'
HTTP Request
POST /api/v1/vouchers HTTP/1.1
Content-Type: application/json
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Content-Length: 150

{
  "password" : "PassW0RD",
  "methodId" : 1,
  "twofaCode" : "[email protected]",
  "amount" : 100.0
}
Request headers
Name Description

X-token

Authorization JWT token

HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 238

{
  "id" : 123456,
  "code" : "UTORG_BTC_6f87a6ecb41d7f30a836dae0c6ea8eff",
  "status" : "VOUCHER_CREATED",
  "createdAt" : 1572935513937,
  "confirmedAt" : 0,
  "redeemedAt" : 0,
  "currencyId" : 2,
  "amount" : 100.0,
  "methodId" : 1
}
Response fields
Path Type Description

id

Number

Voucher internal identifier

code

String

Voucher code (can be pass to another user)

status

String

Voucher status (VOUCHER_CREATED, VOUCHER_CONFIRMED, VOUCHER_REDEEMED)

createdAt

Number

Creation timestamp

confirmedAt

Number

Timestamp of confirm

redeemedAt

Number

Timestamp of redeem

currencyId

Number

Voucher currency’s ID

amount

Number

Voucher amount

methodId

Number

Voucher method ID

3.7.2. Create voucher using API

Curl example
$ curl 'https://public-api.utorg.io/api/v1/vouchers/transparent/create' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'X-api-key: API-key-value' \
    -H 'X-api-sid: API-secret' \
    -H 'X-api-key-checksum: a32c848c7498200bd95a50666938c079b47c9de219a0d283f9c57b9028501d0a' \
    -d '{
  "password" : "PassW0RD",
  "methodId" : 1,
  "twofaCode" : "[email protected]",
  "amount" : 100.0
}'
HTTP Request
POST /api/v1/vouchers/transparent/create HTTP/1.1
Content-Type: application/json
X-api-key: API-key-value
X-api-sid: API-secret
X-api-key-checksum: a32c848c7498200bd95a50666938c079b47c9de219a0d283f9c57b9028501d0a
Host: public-api.utorg.io
Content-Length: 150

{
  "password" : "PassW0RD",
  "methodId" : 1,
  "twofaCode" : "[email protected]",
  "amount" : 100.0
}
Request headers
Name Description

X-api-sid

API key secret

X-api-key

API key value

X-api-key-checksum

Payload checksum (HMAC-SHA256 with key API-SID)

HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 238

{
  "id" : 123456,
  "code" : "UTORG_BTC_6f87a6ecb41d7f30a836dae0c6ea8eff",
  "status" : "VOUCHER_CREATED",
  "createdAt" : 1572935514109,
  "confirmedAt" : 0,
  "redeemedAt" : 0,
  "currencyId" : 2,
  "amount" : 100.0,
  "methodId" : 1
}
Response fields
Path Type Description

id

Number

Voucher internal identifier

code

String

Voucher code (can be pass to another user)

status

String

Voucher status (VOUCHER_CREATED, VOUCHER_CONFIRMED, VOUCHER_REDEEMED)

createdAt

Number

Creation timestamp

confirmedAt

Number

Timestamp of confirm

redeemedAt

Number

Timestamp of redeem

currencyId

Number

Voucher currency’s ID

amount

Number

Voucher amount

methodId

Number

Voucher method ID

3.7.3. Check voucher

Curl example
$ curl 'https://public-api.utorg.io/api/v1/vouchers/UTORG_BTC_6f87a6ecb41d7f30a836dae0c6ea8eff' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/vouchers/UTORG_BTC_6f87a6ecb41d7f30a836dae0c6ea8eff HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

Path parameters
Table 2. /api/v1/vouchers/{code}
Parameter Description

code

Voucher code

HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 236

{
  "id" : 123456,
  "code" : "UTORG_BTC_6f87a6ecb41d7f30a836dae0c6ea8eff",
  "status" : "VOUCHER_CREATED",
  "createdAt" : 1572935514062,
  "confirmedAt" : 0,
  "redeemedAt" : 0,
  "currencyId" : 2,
  "amount" : 100,
  "methodId" : 1
}
Response fields
Path Type Description

id

Number

Voucher internal identifier

code

String

Voucher code (can be pass to another user)

status

String

Voucher status (VOUCHER_CREATED, VOUCHER_CONFIRMED, VOUCHER_REDEEMED)

createdAt

Number

Creation timestamp

confirmedAt

Number

Timestamp of confirm

redeemedAt

Number

Timestamp of redeem

currencyId

Number

Voucher currency’s ID

amount

Number

Voucher amount

methodId

Number

Voucher method ID

3.7.4. Redeem voucher

Curl example
$ curl 'https://public-api.utorg.io/api/v1/vouchers/UTORG_BTC_6f87a6ecb41d7f30a836dae0c6ea8eff/redeem' -i -X POST \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
POST /api/v1/vouchers/UTORG_BTC_6f87a6ecb41d7f30a836dae0c6ea8eff/redeem HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
Request headers
Name Description

X-token

Authorization JWT token

Path parameters
Table 3. /api/v1/vouchers/{code}/redeem
Parameter Description

code

Voucher code

HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 236

{
  "id" : 123456,
  "code" : "UTORG_BTC_6f87a6ecb41d7f30a836dae0c6ea8eff",
  "status" : "VOUCHER_CREATED",
  "createdAt" : 1572935514022,
  "confirmedAt" : 0,
  "redeemedAt" : 0,
  "currencyId" : 2,
  "amount" : 100,
  "methodId" : 1
}
Response fields
Path Type Description

id

Number

Voucher internal identifier

code

String

Voucher code (can be pass to another user)

status

String

Voucher status (VOUCHER_CREATED, VOUCHER_CONFIRMED, VOUCHER_REDEEMED)

createdAt

Number

Creation timestamp

confirmedAt

Number

Timestamp of confirm

redeemedAt

Number

Timestamp of redeem

currencyId

Number

Voucher currency’s ID

amount

Number

Voucher amount

methodId

Number

Voucher method ID

3.8. Settings controller

3.8.1. Get application settings

Curl example
$ curl 'https://public-api.utorg.io/api/v1/settings' -i -X GET
HTTP Request
GET /api/v1/settings HTTP/1.1
Host: public-api.utorg.io
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 320

{
  "customMaintenanceMessage" : "Maintenance",
  "isAccessDisabled" : false,
  "isLoginDisabled" : false,
  "isWithdrawActive" : true,
  "isTradeActive" : true,
  "isGoogleRecaptchaEnabled" : false,
  "basicCurrencyId" : 1,
  "isSignupDisabled" : false,
  "isDepositActive" : true,
  "recaptchaPublicKey" : "SOME-KEY"
}
Response fields
Path Type Description

isGoogleRecaptchaEnabled

Boolean

Is Google Recaptcha enabled

recaptchaPublicKey

String

Google Recaptcha public key

isAccessDisabled

Boolean

Is access to terminal disabled now

customMaintenanceMessage

String

Maintenance message

isTradeActive

Boolean

Is trading enabled now

isDepositActive

Boolean

Can user make a deposit

isWithdrawActive

Boolean

Can user make a withdrawal

basicCurrencyId

Number

Basic currency ID in system

isLoginDisabled

Boolean

Is login disabled now

isSignupDisabled

Boolean

Is sign up operation disabled now

3.9. Referral controller

3.9.1. Get users referral program information

Curl example
$ curl 'https://public-api.utorg.io/api/v1/referral/info' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/referral/info HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 41

{
  "fee" : 0.02,
  "refereesCount" : 0
}
Response fields
Path Type Description

refereesCount

Number

Account referees count

fee

Number

Account referral commission

3.9.2. Get referral program payouts list for current month

Curl example
$ curl 'https://public-api.utorg.io/api/v1/referral/current' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/referral/current HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 92

{
  "totals" : {
    "elements" : {
      "USD" : "10",
      "BTC" : "0.000011"
    }
  }
}
Response fields
Path Type Description

totals

Object

Totals payout list for period

totals.elements

Object

Totals payout list for period (currency → sum)

totals.elements.*

String

Currency and sum

3.9.3. Get referral program payouts list for previous month

Curl example
$ curl 'https://public-api.utorg.io/api/v1/referral/previous' -i -X GET \
    -H 'X-token: X-JWT-Token-Value'
HTTP Request
GET /api/v1/referral/previous HTTP/1.1
X-token: X-JWT-Token-Value
Host: public-api.utorg.io
HTTP Response
Success HTTP responses
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 92

{
  "totals" : {
    "elements" : {
      "USD" : "10",
      "BTC" : "0.000011"
    }
  }
}
Response fields
Path Type Description

totals

Object

Totals payout list for period

totals.elements

Object

Totals payout list for period (currency → sum)

totals.elements.*

String

Currency and sum

3.10. Examples

  • To run script on the local machine:  

  • Get Homebrew

  • Install groovy → Run in terminal: brew install groovy

  • Go to DIR with the file of groovy example, and run with commands described in the example

3.10.1. Withdrawal

Crypto: groovy withdraw.groovy -d -s "Your API key id (SID)" -k "your API key" -e "your secret" -a amount  -m "CRYPTO" -c currency_id -r "wallet address"
Fiat (methodID added): groovy withdraw.groovy -d -s "Your API key id (SID)" -k "your API key" -e "your secret" -a amount -i 6  -m "CRYPTO" -c currency_id -r "wallet address"
#!/usr/bin/env groovy

@Grab('commons-codec:commons-codec:1.12')
import org.apache.commons.codec.digest.HmacAlgorithms
import org.apache.commons.codec.digest.HmacUtils

CliBuilder cli = new CliBuilder(usage: 'withdrawal.groovy [options]')
cli.with {
  h longOpt: 'help', 'Show usage information'
  _(longOpt: 'host', args: 1, argName: 'host', 'Use given host to query')
  _(longOpt: 'protocol', args: 1, argName: 'protocol', 'Use given protocol to query')
  d longOpt: 'debug', 'Enable debug output'

  s(longOpt: 'sid', args: 1, argName: 'sid', 'Your SID value')
  k(longOpt: 'key', args: 1, argName: 'key', 'Your APIKEY value')
  e(longOpt: 'secret', args: 1, argName: 'secret', 'Your secret value')

  a longOpt: 'amount', args: 1, argName: 'amount', 'Use given amount to query'
  i longOpt: 'methodId', args: 1, argName: 'id', 'Use given methodId to query'
  m longOpt: 'method', args: 1, argName: 'method', 'Use give method to query (FIAT/CRYPTO)'
  c longOpt: 'currencyId', args: 1, argName: 'id', 'Use given currencyId to query'
  r longOpt: 'receivingAddress', args: 1, argName: 'address', 'Use given receiving address to query'
}

def options = cli.parse(args)
if (!options || options.h) {
  cli.usage()
  return
}

class UtorgApi {
  String host = 'public-api.dev.0hub.io'
  String protocol = 'https'
  boolean debug = false
  String sid
  String apiKey
  String secret
}

class Withdrawal {
  BigDecimal amount
  Integer currencyId
  String method
  Integer methodId
  String receivingAddress
}

def globalOpt = new UtorgApi(
  host: options.host ?: 'public-api.dev.0hub.io',
  protocol: options.protocol ?: 'https',
  debug: options.debug ?: false,
  sid: options.sid,
  apiKey: options.key,
  secret: options.secret
)
def withdrawal = new Withdrawal(
  amount: options.amount?.trim() ? new BigDecimal(options.amount) : null,
  currencyId: options.currencyId as Integer,
  method: options.m,
  receivingAddress: options.r ?: ''
)
if (options.i) {
  withdrawal.methodId = options.i as Integer
}
makeWithdrawal(globalOpt, withdrawal)
System.exit(0)

def makeWithdrawal(UtorgApi globalOpt, Withdrawal opt) {
  def api = '/api/v1/payments/transparent/withdrawal'
  def payload = [
    amount: opt.amount.toString(),
    currencyId: opt.currencyId,
    method: opt.method,
    methodId: opt.methodId,
    receivingAddress: opt.receivingAddress,
    password: '',
    twofaCode: ''
  ]

  apiPostCall(globalOpt, api, payload)
}

def apiPostCall(UtorgApi globalOpt, def api, def payload) {
  def json = groovy.json.JsonOutput.toJson(payload)
  if (globalOpt.debug) {
    println json
  }

  def request = new URL("${globalOpt.protocol}://${globalOpt.host}$api").openConnection()
  request.setRequestMethod('POST')
  request.setDoOutput(true)
  request.setRequestProperty('Content-type', 'application/json')
  request.setRequestProperty('X-api-sid', globalOpt.sid)
  request.setRequestProperty('X-api-key', globalOpt.apiKey)
  def checksum = new HmacUtils(HmacAlgorithms.HMAC_SHA_256, globalOpt.secret).hmacHex(json)
  request.setRequestProperty('X-api-key-checksum', checksum)
  request.getOutputStream().write(json.getBytes("UTF-8"))

  responseCode = request.getResponseCode()
  if (globalOpt.debug) {
    println responseCode
  }
  def stream = responseCode >= 200 && responseCode < 300 ? request.getInputStream() : request.getErrorStream()
  println stream.getText()
}

3.10.2. Get

wallets.groovy
#!/usr/bin/env groovy

@Grab('commons-codec:commons-codec:1.12')
import org.apache.commons.codec.digest.HmacAlgorithms
import org.apache.commons.codec.digest.HmacUtils

def host = 'https://public-api.0hub.io'
def api = '/api/v1/wallets'
def payload = ''

def sid = '-YOUR-API-KEY-ID-VALUE-'  (1)
def apiKey = '-YOUR-API-KEY-VALUE-'  (2)
def secret = '-YOUR-SECRET-VALUE-'   (3)

def request = new URL("$host$api").openConnection()
request.setRequestMethod('GET')
request.setDoOutput(true)
request.setRequestProperty('Content-type', 'application/json')
request.setRequestProperty('X-api-sid', sid)
request.setRequestProperty('X-api-key', apiKey)
def chksum = new HmacUtils(HmacAlgorithms.HMAC_SHA_256, secret).hmacHex(payload)  (4)
request.setRequestProperty('X-api-key-checksum', chksum)
request.connect()

def responseCode = request.getResponseCode()
println responseCode
def stream = responseCode >= 200 && responseCode < 300
    ? request.getInputStream()
    : request.getErrorStream()
println stream.getText()
1 Your SID value here
2 Your API key here
3 Your secret value here
4 Checksum calculation

4. WebSockets

Host to access web sockets: wss://ws-service.utorg.io/ws

You can use https://www.websocket.org/echo.html tool for testing

4.1. Public channels

Usage example:

  • Connect to WS

  • Subscribe to EVENT with market data

{
  "type":"MARKET_SUBSCRIBE",
  "arguments":{
    "marketId":2
  }
}

TYPE

ARGUMENTS

EVENTS

DATA

SYSTEM_SUBSCRIBE

N/A

MARKET_CHANGED

marketId, "isActive":is market Active "disabled":is trading disabled for pair}

Exchange settings

MARKET_SUBSCRIBE / MARKET_UNSUBSCRIBE

marketId

MARKET_TICKER

{marketId, lastPrice}

MARKET_STATS

{marketid, dailyOpen, dailyHigh, dailyLow, dailyVolumeQuote}

ALL_MARKETS_SUBSCRIBE / ALL_MARKETS_UNSUBSCRIBE

N/A

ALL_MARKET_TICKERS

{marketId, lastPrice}

ALL_MARKET_STATS

{marketId, dailyOpen, dailyHigh, dailyLow, dailyVolumeQuote}

OHLCV_SUBSCRIBE

marketId, resolution

OHLCV_DATA_UPDATE

2, "1m", 1565362980000, 11855.98, 11855.98, 11855.98, 11855.98, 86.8590435564

time, open, high, low, close, volume

ORDERBOOK_SUBSCRIBE / ORDERBOOK_UNSUBSCRIBEE

marketId, precision

ORDER_BOOK

{marketId, precision, buy, sell}

ORDER_BOOK_DIFF

{marketId, precision, buy, sell}

TRADES_SUBSCRIBE / TRADES_UNSUBSCRIBE

marketId

TRADE_HISTORY_UPDATE

marketId, items

4.2. Private data

Usage example:

  • Connect to WS

  • Subscribe to "LOGIN" event

{
  "type":"LOGIN",
  "arguments":{
    "accountId":your_user_account_id,
    "jwt": "your x-token"
   }
 }
TYPE ARGUMENTS EVENT EVENT DATA

Login

accountId, jwt

USER_LOGOUT

{accountId, frozen}

BALANCE_UPDATED

{id, available, reserved}

ORDER_OPENED

{id, amount, closeReason, closedAt, createdAt, feeAmount, initialAmount, initialReserved, isActive, market, matchedAmount, price, avgPrice, processedAt, reserved, side, type}

ORDER_CLOSED

{id, marketId, initialAmount, , price, , , , side, type, reason}

ORDER_PARTIALLY_FILLED

{id, marketId, initialAmount, leftAmount, price, , , side, type}

DEPOSIT_CONFIRMED

{ currencyCode, amount }

ACCOUNTS_TRADE

{id, orderId, market, price, amount, matchedAt, side, type,}