ユーザーの保持しているアカウントのリストを取得します
GET /v1/accounts
$curl -X GET "http://api-sandbox.oanda.com/v1/accounts?username=fxtrader"
HTTP/1.1 200 OK Content-Type: application/json Content-Length: 128
{
"accounts": [
{
"accountId" : 8954947,
"accountName" : "Primary",
"accountCurrency" : "USD",
"marginRate" : 0.05
},
{
"accountId" : 8954950,
"accountName" : "SweetHome",
"accountCurrency" : "CAD",
"marginRate" : 0.02
}
]
}
新しいアカウントを作成します。このリクエストはsandbox環境でのみ有効です。 その他の環境においてはfxtrade.oanda.comからアカウントを作成してください。
POST /v1/accounts
$curl -X POST "http://api-sandbox.oanda.com/v1/accounts"
HTTP/1.1 201 Created Content-Type: application/json Content-Length: 77 Location: https://api-sandbox.com/v1/accounts/8954947
{
"username" : "keith",
"password" : "Rocir~olf4",
"accountId" : 8954947
}
GET /v1/accounts/:account_id
$curl -X GET "http://api-sandbox.oanda.com/v1/accounts/8954947"
HTTP/1.1 200 OK Content-Type: application/json Content-Length: 269
{
"accountId" : 8954947,
"accountName" : "Primary",
"balance" : 100000,
"unrealizedPl" : 0,
"realizedPl" : 0,
"marginUsed" : 0,
"marginAvail" : 100000,
"openTrades" : 0,
"openOrders" : 0,
"marginRate" : 0.05,
"accountCurrency" : "USD"
}