Private User API Documentation

The private User API allows read / trade access to your private account. First generate Api Keys.


All calls to the trading API are sent via HTTP using POST parameters to https://altsbit.com/uapi/method-name and must contain the following headers:


        Key - Your User API Public Key.
        Sign - The query's POST data signed by your Secret Key according to the HMAC-SHA512 method.

Additionally, all queries must include a "nonce" POST parameter. The nonce parameter is an integer.


All responses from the trading API are in JSON/XML format. In the event of an error, the response will always be of the following format:


        { "error": "<error message>" }

There are several methods accepted by the User Private API:

POST https://altsbit.com/uapi/get-balances

echo -n "nonce=1234567890&view;=complete" | \
        openssl sha512 -hmac "your-secret-api-key"
curl -i -X POST -d "nonce=1234567890&view;=complete" -H "Accept:application/json" \
        -H "Key: your-public-key" \
        -H "Sign: 913a6badyr39136b6754cd73738d980c349edd8a9870c9f0abmj200ff245e24c142f6e" \
        https://altsbit.com/uapi/get-balances        

Returns all of your balances.

Input fields

view can be empty or "complete" (optional)

Output fields

available coins not reserved in orders

openOrders coins in open orders (optional)

unconfirmed coins in pending deposits (optional)

estBTC estimated sum in BTC (optional)

Response JSON

{
    ...
    "BTC":{
        "available":"1.23000000",
    },
    ...
}

Response JSON (view=complete)

{
    ...
    "BTC":{
        "available":"1.23000000",
        "openOrders":"5.67000000",
        "unconfirmed":"0.10000000",
        "estBTC":"7.00000000"
    },
    ...
}

POST https://altsbit.com/uapi/get-deposit-addresses

echo -n "nonce=1234567890" | \
        openssl sha512 -hmac "your-secret-api-key"
curl -i -X POST -d "nonce=1234567890" -H "Accept:application/json" \
        -H "Key: your-public-key" \
        -H "Sign: 913a6badyr39136b6754cd73738d980c349edd8a9870c9f0abmj200ff245e24c142f6e" \
        https://altsbit.com/uapi/get-deposit-addresses        

Returns all of your deposit addresses. Some currencies use a common deposit address.

Input fields

none

Output fields

address

Response JSON

{
    ...
    "BTC":"38dsj4volrkeUWRitkfwekfrcoz935koZXI",
    ...
}

POST https://altsbit.com/uapi/gen-new-hash

echo -n "nonce=1234567890¤cy=BTC" | \
        openssl sha512 -hmac "your-secret-api-key"
curl -i -X POST -d "nonce=1234567890¤cy=BTC" -H "Accept:application/json" \
        -H "Key: your-public-key" \
        -H "Sign: 913a6badyr39136b6754cd73738d980c349edd8a9870c9f0abmj200ff245e24c142f6e" \
        https://altsbit.com/uapi/gen-new-hash        

Generates a new deposit address for the currency specified by the "currency" POST parameter.

Input fields

currency must be a symbol of currency. List of all currency symbols can be received by GET https://altsbit.com/api/currencies

Output fields

address

Response JSON

{
    "hash":"38dsj4volrkeUWRitkfwekfrcoz935koZXI"
}

POST https://altsbit.com/uapi/get-deposits-withdrawals

echo -n "nonce=1234567890&from=1234567890&to=1234567891&limit=500" | \
        openssl sha512 -hmac "your-secret-api-key"
curl -i -X POST -d "nonce=1234567890&from=1234567890&to=1234567891&limit=500" -H "Accept:application/json" \
        -H "Key: your-public-key" \
        -H "Sign: 913a6badyr39136b6754cd73738d980c349edd8a9870c9f0abmj200ff245e24c142f6e" \
        https://altsbit.com/uapi/get-deposits-withdrawals        

Returns your deposit and withdrawal history within a range window, specified by the "from" and "to" POST parameters, both of which should be given as UNIX timestamps.

Input fields

from the start date of the range window in UNIX timestamp format (optional)

to the end date of the range window in UNIX timestamp format. Must be greater than from (optional)

limit limit of history entries, min is 10, max is 5000 (optional, default = 500)

Output fields

id id transaction in exchange

timestamp the timestamp in UNIX timestamp format of when this operation was created

currency symbol of currency

status the status of the operation

address the address to which this deposit/withdrawal was sent

txid the blockchain transaction ID of this operation

amount the total value of this operation

confirmations the total number of confirmations (only for deposits)

fee the total fee of this operation (only for withdrawals)

Response JSON

{
    "deposits":[
        ...
        {
            "id":"123",
            "timestamp":"1234567890",
            "currency":"BTC",
            "status":"pending",
            "address":"38dsj4volrkeUWRitkfwekfrcoz935koZXI",
            "txid":"0e3kdoitjeockwerjweimOfejworJoewr453jf8sm424823fdjfj324mfskojrwer",
            "amount":"0.51300000",
            "confirmations":"5"
        },
        ...
    ],
    "withdrawals":[
        ...
        {
            "id":"234",
            "timestamp":"1234567890",
            "currency":"BTC",
            "status":"completed",
            "address":"38dsj4volrkeUWRitkfwekfrcoz935koZXI",
            "txid":"0e3kdoitjeockwerjweimOfejworJoewr453jf8sm424823fdjfj324mfskojrwer",
            "amount":"0.51300000",
            "fee":"0.00500000"
        },
        ...
    ]
}

POST https://altsbit.com/uapi/get-orders

echo -n "nonce=1234567890&status=history&pair=ARRR-BTC" | \
        openssl sha512 -hmac "your-secret-api-key"
curl -i -X POST -d "nonce=1234567890&status=history&pair=ARRR-BTC" -H "Accept:application/json" \
        -H "Key: your-public-key" \
        -H "Sign: 913a6badyr39136b6754cd73738d980c349edd8a9870c9f0abmj200ff245e24c142f6e" \
        https://altsbit.com/uapi/get-orders        

Returns your open orders for a given market, specified by the "pair" POST parameter.

Input fields

from the start date of the range window in UNIX timestamp format (optional)

to the end date of the range window in UNIX timestamp format. Must be greater than from (optional)

limit limit of history entries, min is 10, max is 5000 (optional, default = 100)

pair the major and minor currency that define this market (optional)

status "history" for closed orders, and empty for active orders (optional)

Output fields

order_id the number uniquely identifying this order

type denotes this order as a 'buy' or 'sell'

price price per unit in base units

amount the amount left to fill in this order

initial_amount the initial amount in this order

progress progress in percents of this order

timestamp the timestamp in UNIX timestamp format of when this order was created

Response JSON

{
    ...
    "ARRR-BTC":[
        ...
        {
            "order_id":12345,
            "type":"buy",
            "price":"0.10000000",
            "amount":"50.00000000",
            "initial_amount":"100.00000000",
            "progress":"50.00000000",
            "timestamp":1234567890
        },
        ...
    ],
    ...
}

POST https://altsbit.com/uapi/get-trades

echo -n "nonce=1234567890&pair=ARRR-BTC" | \
        openssl sha512 -hmac "your-secret-api-key"
curl -i -X POST -d "nonce=1234567890&pair=ARRR-BTC" -H "Accept:application/json" \
        -H "Key: your-public-key" \
        -H "Sign: 913a6badyr39136b6754cd73738d980c349edd8a9870c9f0abmj200ff245e24c142f6e" \
        https://altsbit.com/uapi/get-trades        

Returns your trade history for given market or order.

Input fields

from the start date of the range window in UNIX timestamp format (optional)

to the end date of the range window in UNIX timestamp format. Must be greater than from (optional)

limit limit of history entries, min is 10, max is 5000 (optional, default = 100)

pair the major and minor currency that define this market (optional)

order_id the order id whose trades you wish to query. If "order_id" is set then "pair" parameter is ignoring (optional)

Output fields

id the number uniquely identifying this trade

price the price at which this trade executed

amount the amount transacted in this trade

total the total cost in base units of this trade

fee the fee paid for this trade

order_id the order id number to which this trade is associated

type denotes a 'buy' or a 'sell' execution

timestamp the timestamp in UNIX timestamp format of when this order was created

Response JSON

{
    ...
    "ARRR-BTC":[
        ...
        {
            "id":12345,
            "price":"0.00000620",
            "amount":"20000.00000000",
            "total":"0.12400000",
            "fee":"0.00024800",
            "order_id":23456,
            "type":"sell",
            "timestamp":1234567890
        },
        ...
    ],
    ...
}

POST https://altsbit.com/uapi/get-order-status

echo -n "nonce=1234567890&order_id=12345" | \
        openssl sha512 -hmac "your-secret-api-key"
curl -i -X POST -d "nonce=1234567890&order_id=12345" -H "Accept:application/json" \
        -H "Key: your-public-key" \
        -H "Sign: 913a6badyr39136b6754cd73738d980c349edd8a9870c9f0abmj200ff245e24c142f6e" \
        https://altsbit.com/uapi/get-order-status        

Returns the status of a given order.

Input fields

order_id order unique id

Output fields

order_id the order id number

pair the major and minor currency that define market of this order

type denotes this order as a 'buy' or 'sell'

price price per unit in base units

amount the amount left to fill in this order

initial_amount the initial amount in this order

progress progress in percents of this order

timestamp the timestamp in UNIX timestamp format of when this order was created

Response JSON

{
    "order_id":12345,
    "pair":"ARRR-BTC",
    "type":"sell",
    "status":"completed",
    "price":"0.10000000",
    "amount":"50.00000000",
    "initial_amount":"100.00000000",
    "progress":"50.00000000",
    "timestamp":1234567890
}

POST https://altsbit.com/uapi/order

echo -n "nonce=1234567890&type=sell&pair=ARRR-BTC&price=0.01&amount=1000" | \
        openssl sha512 -hmac "your-secret-api-key"
curl -i -X POST -d "nonce=1234567890&type=sell&pair=ARRR-BTC&price=0.01&amount=1000" -H "Accept:application/json" \
        -H "Key: your-public-key" \
        -H "Sign: 913a6badyr39136b6754cd73738d980c349edd8a9870c9f0abmj200ff245e24c142f6e" \
        https://altsbit.com/uapi/order        

Places a buy/sell order in a given market. Required POST parameters are "type", "pair", "amount" and "price". If successful, the method will return the order id.

Input fields

type must be "buy" or "sell"

pair the major and minor currency that define market of this order

price the price to buy/sell one major unit for this order

amount the total amount of minor units in this buy/sell order

Output fields

order_id the id number of new created order

Response JSON

{
    "order_id":12345,
}

POST https://altsbit.com/uapi/cancel-order

echo -n "nonce=1234567890&order_id=12345" | \
        openssl sha512 -hmac "your-secret-api-key"
curl -i -X POST -d "nonce=1234567890&order_id=12345" -H "Accept:application/json" \
        -H "Key: your-public-key" \
        -H "Sign: 913a6badyr39136b6754cd73738d980c349edd8a9870c9f0abmj200ff245e24c142f6e" \
        https://altsbit.com/uapi/cancel-order        

Cancels an order.

Input fields

order_id the order id number

Output fields

success true

message "Order 12345 was canceled"

Response JSON

{
    "success":true,
    "message":"Order 12345 was canceled"
}