Account Management
get
https://api.sfox.com/v1
/user/balance
Get Account Balance

Response Body

Key
Description
currency
Currency code (example: btc, eth, ltc)
balance
The total amount of this currency held on sFOX across all wallets outlined below
available
Amount of the currency available for trading or withdrawals
held
Amount of the currency “on hold” i.e. pending ACH deposits
borrow_wallet
Amount of the currency borrowed, represented as the borrow wallet balance
collateral_wallet
Amount of the current being held as collateral in your collateral wallet
lending_wallet
Amount of the currency in your lending wallet
trading_wallet
Amount of the currency in your trading wallet
Shell
NodeJS
Python
1
curl -H 'Authorization: Bearer <API_TOKEN>' 'https://api.sfox.com/v1/user/balance'
Copied!
1
const axios = require('axios');
2
3
axios({
4
method: 'get',
5
url: 'https://api.sfox.com/v1/user/balance',
6
headers: {
7
'Authorization': 'Bearer <API_KEY>'
8
}
9
}).then(response => {
10
console.log(response)
11
}).catch(err => {
12
console.error(err)
13
});
Copied!
1
import requests
2
3
data = requests.get(
4
"https://api.sfox.com/v1/user/balance",
5
headers={
6
"Authorization": "Bearer <API_KEY>",
7
}
8
)
9
print(data)
Copied!
get
https://api.sfox.com/v1
/account/transactions
Transaction history

Response Body

This endpoint returns an array of objects, each of which has the details of the transaction
Key
Description
Example
id
Transaction ID
24619905
AtxId
Account Transaction ID, if this transaction is a deposit, withdrawal, credit, or charge
572195
order_id
Order ID, if this transaction is associated with an order (a buy or sell)
"687484791"
client_order_id
The optional ID that you specified when placing an order
"my-first-order"
day
The timestamp of the transaction, in ISO8601 format
"2019-07-31T17:26:30.000Z"
action
The action name of this transaction (“Deposit”, “Withdraw”, “Buy”, “Sell”, "Credit", "Charge")
"Deposit"
currency
The base currency of the transaction
"btc"
memo
The optional memo you specified for a Withdrawal transaction
"sending BTC to counterparty"
amount
The transacted amount of the currency
0.00262916
net_proceeds
Net amount after fees
0.02
price
Price per unit of the currency
4.5072
fees
Fee paid in terms of the currency
0
status
The current transaction status
"done"
hold_expires
The expiration date of a hold on this transaction, if applicable
"2019-07-31T17:26:30.000Z"
tx_hash
The transaction hash, if applicable (applicable to crypto deposits and withdrawals)
"223c7f80c6c5ef8e57ae220a3cfecc192e7e1cd6734e73b0c6487bfe2061ccce"
algo_name
The algorithm used to execute the transaction, if the transaction is an order
"TWAP"
algo_id
The ID associated with the algorithm
"307"
account_balance
Your balance of the currency after the transaction
10.00212
AccountTransferFee
Fee paid in terms of the currency for deposit or withdrawal transactions
0
Shell
NodeJS
Python
1
curl -H 'Authorization: Bearer <API_TOKEN>' \
2
https://api.sfox.com/v1/account/transactions?from=0&to=1565114130000
Copied!
1
const axios = require('axios');
2
3
axios({
4
method: 'get',
5
url: 'https://api.sfox.com/v1/account/transactions',
6
headers: {
7
'Authorization': 'Bearer <API_KEY>'
8
},
9
params: {
10
from: 0,
11
to: 1565114130000
12
}
13
}).then(response => {
14
console.log(response)
15
}).catch(err => {
16
console.error(err)
17
});
Copied!
1
import requests
2
3
data = requests.get(
4
"https://api.sfox.com/v1/account/transactions",
5
headers={
6
"Authorization": "Bearer <API_KEY>",
7
}
8
params={
9
"from": 0,
10
"to": 1565114130000
11
}
12
)
13
print(data)
Copied!
post
https://api.sfox.com/v1
/user/bank/deposit
Request an ACH transfer
Shell
NodeJS
Python
1
curl -H 'Authorization: Bearer <API_TOKEN>' \
2
-H 'Content-Type: application/json' \
3
-X POST \
4
--data '{"amount": 100}' \
5
https://api.sfox.com/v1/user/bank/deposit
Copied!
1
const axios = require('axios');
2
3
axios({
4
method: 'post',
5
url: 'https://api.sfox.com/v1/user/bank/deposit',
6
headers: {
7
'Authorization': 'Bearer <API_KEY>'
8
},
9
data: {
10
amount: 100
11
}
12
}).then(response => {
13
console.log(response)
14
}).catch(err => {
15
console.error(err)
16
});
Copied!
1
import requests
2
3
data = requests.post(
4
"https://api.sfox.com/v1/user/bank/deposit",
5
headers={
6
"Authorization": "Bearer <API_KEY>",
7
},
8
data={
9
"amount": 100
10
}
11
)
12
print(data)
Copied!
get
https://api.sfox.com/v1
/user/deposit/address/:currency
List available crypto addresses

Response Body

Key
Description
currency
Crypto asset
address
Crypto address to use for deposits
Shell
NodeJS
Python
1
curl -H 'Authorization: Bearer <API_TOKEN>' \
2
https://api.sfox.com/v1/user/deposit/address/btc
Copied!
1
const axios = require('axios');
2
3
axios({
4
method: 'get',
5
url: 'https://api.sfox.com/v1/user/deposit/address/eth',
6
headers: {
7
'Authorization': 'Bearer <API_KEY>'
8
}
9
}).then(response => {
10
console.log(response)
11
}).catch(err => {
12
console.error(err)
13
});
Copied!
1
import requests
2
3
data = requests.get(
4
"https://api.sfox.com/v1/user/deposit/address/eth",
5
headers={
6
"Authorization": "Bearer <API_KEY>",
7
}
8
)
9
print(data)
Copied!
post
https://api.sfox.com/v1
/user/deposit/address/:currency
Create a Deposit Address

Response Body

Key
Description
currency
Crypto asset
address
Crypto address to use for deposits
Shell
NodeJS
Python
1
curl -H 'Authorization: Bearer <API_TOKEN>' \
2
-X POST \
3
https://api.sfox.com/v1/user/deposit/address/eth
Copied!
1
const axios = require('axios');
2
3
axios({
4
method: 'post',
5
url: 'https://api.sfox.com/v1/user/deposit/address/eth',
6
headers: {
7
'Authorization': 'Bearer <API_KEY>'
8
}
9
}).then(response => {
10
console.log(response)
11
}).catch(err => {
12
console.error(err)
13
});
Copied!
1
import requests
2
3
data = requests.post(
4
"https://api.sfox.com/v1/user/deposit/address/eth",
5
headers={
6
"Authorization": "Bearer <API_KEY>",
7
}
8
)
9
print(data)
Copied!
post
https://api.sfox.com/v1
/user/withdraw
Withdraw
Shell
NodeJS
Python
1
curl -H 'Authorization: Bearer <API_TOKEN>' \
2
-H 'Content-Type: application/json' \
3
-X POST \
4
--data '{"amount": 1, "currency": "eth", "address": "0x123456"}' \
5
https://api.sfox.com/v1/user/withdraw
Copied!
1
const axios = require('axios');
2
3
axios({
4
method: 'post',
5
url: 'https://api.sfox.com/v1/user/withdraw',
6
headers: {
7
'Authorization': 'Bearer <API_KEY>'
8
},
9
data: {
10
currency: 'eth',
11
address: '0x123456'
12
amount: 1
13
}
14
}).then(response => {
15
console.log(response)
16
}).catch(err => {
17
console.error(err)
18
});
Copied!
1
import requests
2
3
data = requests.post(
4
"https://api.sfox.com/v1/user/withdraw",
5
headers={
6
"Authorization": "Bearer <API_KEY>",
7
},
8
data={
9
"currency": "eth",
10
"address": "0x123456"
11
"amount": 1
12
}
13
)
14
print(data)
Copied!
get
https://api.sfox.com/v1
/post-trade-settlement
Post Trade Settlement
Key
Description
exposure
The current USD value of the amount of credit used
available_exposure
The USD value of credit available
exposure_limit
The maximum value in USD of credit that may be borrowed
equity
The portion of the portfolio owned by you
equity_for_withdrawls
The amount of equity that is available for withdrawals
Shell
NodeJS
Python
1
curl -H 'Authorization: Bearer <API_TOKEN>' \
2
https://api.sfox.com/v1/post-trade-settlement
Copied!
1
const axios = require('axios');
2
3
axios({
4
method: 'get',
5
url: 'https://api.sfox.com/v1/post-trade-settlement',
6
headers: {
7
'Authorization': 'Bearer <API_KEY>'
8
}
9
}).then(response => {
10
console.log(response)
11
}).catch(err => {
12
console.error(err)
13
});
Copied!
1
import requests
2
3
data = requests.get(
4
"https://api.sfox.com/v1/post-trade-settlement",
5
headers={
6
"Authorization": "Bearer <API_KEY>",
7
}
8
)
9
print(data)
Copied!