Back to top
AlphaPoint Private API

Documentation for the private AlphaPoint API.

Authentication

All Alphapoint private API requests require the following three parameters for authentication:

apiKey - your public API key

apiNonce - integer that increases for each request (ex: unix timestamp)

apiSig - API signature, which is an HMAC-SHA256 of your (nonce + user_id + public_key)

apiSig2 - API signature, which is an HMAC-SHA256 of your (nonce + user_id + public_key + message)

Example of API signature generation in Ruby:

public_key = "xxx"
      private_key = "yyy"
      user_id = "foo@test.com" # user ID is your registered email
      nonce = (Time.now.to_f * 10000).to_isignature = OpenSSL::HMAC.hexdigest("sha256", private_key, "#{nonce}#{user_id}#{public_key}#{message}").upcase
    

API key management: https://alphapoint.com/jma/app.html#/apikey

Request structure

Requests are intiated using POST method. Data is transmitted to the server using UTF-8 charset.

POST data is expected to be sent as a JSON string.

JSON.stringify({key:'value'})
    

Response structure

Responses will contain either the key "isAccepted": true, or "isAccepted": false,.

Typically there will be another key "rejectReason" with a textual explanation of the error as shown below.

{"isAccepted": false, "rejectReason": "Incorrect usage",}
    

Request limits

More than 500 request per 10 minutes will result in IP ban.

For real-time data please refer to the AlphaPoint WebSocket API.

WebSocket API

Our WebSocket API provides real-time order book, trade data, and much more.

Account Management 

Create Account 

Parameters:

firstname - First name

lastname - Last name

email - Email address

phone - Phone number (ex: “+12223334444”)

password - Minimum 8 characters

Create a new account
/ajax/v1/CreateAccount
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "firstname":"James",
        "lastname":"Bond",
        "email":"james@bond.ppk",
        "phone":"8888888007",
        "password":"passwd"
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {"isAccepted":"true","rejectReason":null}
      

Get user Information 

Returns first and last name

Get user Info
/ajax/v1/GetUserInfo
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "apiKey": "704ef876d150bf0e024d2379d0e29274",
        "apiNonce": 14225711230650,
        "apiSig": "B8F30FFE8FB577A9A186842661521DAB3E0E3896349C78BCAE38482F4EBDD817"
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {"userInfoKVP":[{"key":"FirstName","value":"Test"},{"key":"LastName","value":"Test],"isAccepted":true}
      

Set user Information 

Change user name and/or 2FA settings

Parameters:

userInfoKVP - An array of key value pairs

Items to set in the array of key value pairs

FirstName - First name

LastName - Last name

UseAuthy2FA - “true” or “false” toggle Authy app

Cell2FACountryCode - Cell country code (ex: 1), required for Authy

Cell2FAValue - Cell phone number, required for Authy

Use2FAForWithdraw - “true” or “false” set to true for using 2FA for withdrawals

Set user info
/ajax/v1/SetUserInfo
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "sessionToken": "null",
        "apiKey": "6afca79b51d0dc24751175129beea58a",
        "apiNonce": 14235884303596,
        "apiSig": "57FE3D25A1E8EC02B8763728FDF0457ADC07DDCF7F623F0D3E2BDE77FD1A2A7E",
        "userInfoKVP":[{"key":"FirstName","value":"James"},{"key":"LastName","value":"Bond"},{"key":"Cell2FACountryCode","value":"1"},
        {"key":"Cell2FAValue","value":"2121233210"},{"key":"UseAuthy2FA","value":"false"}]
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {"isAccepted":"true","rejectReason":null,"requireAuthy2FA":true,"val2FaRequestCode":"12354ASD"} 
      

Account Information 

Lists balances, trade count, and volume

Get account info
/ajax/v1/GetAccountInfo
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "apiKey": "6afca79b51d0dc24751175129beea58a",
        "apiNonce": 14235887859685,
        "apiSig": "4062383A7FB07F0C52C5E190696391591DA9560662CBEFE73E9E20A1325B8473"
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "currencies": [
      {
        "name": "USD",
        "balance": 0,
        "hold": 0
      },
      {
        "name": "BTC",
        "balance": 1000,
        "hold": 0
      },
      {
        "name": "LTC",
        "balance": 1000,
        "hold": 0
      },
      {
        "name": "MXN",
        "balance": 1000,
        "hold": 0
      },
      {
        "name": "PHP",
        "balance": 1000,
        "hold": 0
      }
      ],
      "productPairs": [
      {
        "productPairName": "BTCPHP",
        "productPairCode": 15,
        "tradeCount": 0,
        "tradeVolume": 0
      },
      {
        "productPairName": "BTCMXN",
        "productPairCode": 16,
        "tradeCount": 0,
        "tradeVolume": 0
      },
      {
        "productPairName": "LTCBTC",
        "productPairCode": 17,
        "tradeCount": 0,
        "tradeVolume": 0
      },
      {
        "productPairName": "LTCUSD",
        "productPairCode": 18,
        "tradeCount": 0,
        "tradeVolume": 0
      },
      {
        "productPairName": "BTCUSD",
        "productPairCode": 19,
        "tradeCount": 0,
        "tradeVolume": 0
      }
      ],
      "isAccepted": true
      } 
      

Account Trades 

Parameters:

ins - Instrument code (ex: “BTCUSD”)

startIndex - Starting index, if less than 0 then start from the beginning

count - Returns last trade, (Default: 30)

Get account trades
/ajax/v1/GetAccountTrades
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "apiKey": "6afca79b51d0dc24751175129beea58a",
        "apiNonce": 14235890534122,
        "apiSig": "5629BD713D5021A30C762FA08888A7CBF5266CBDFEF83989B74CC00C6E482D17"
        "ins":"BTCUSD", "startIndex": 0,"count": 30
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "isAccepted":true,
      "dateTimeUtc":635091218411215312,
      "ins":"BTCUSD",
      "startIndex":0,
      "count":40,
      "trades":
      [
        {
        "tid":0,
        "px":123,
        "qty":2,
        "time":635087397744993281,
        "incomingOrderSide":0,
        "incomingServerOrderId":2849,
        "bookServerOrderId":2804
      },
      {
        "tid":0,
        "px":123,
        "qty":2,
        "time":635087397744993281,
        "incomingOrderSide":0,
        "incomingServerOrderId":2849,
        "bookServerOrderId":2804
      }
      ]
      }
      

Deposit Coins 

Generate Deposit address
/ajax/v1/GetDepositAddresses
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
      "apiKey": "6afca79b51d0dc24751175129beea58a",
      "apiNonce": 14235891086392,
      "apiSig": "2BA83E087D81E7979F1ACAA04E7A2E6741F840A84A50E5728926E21EB5399471"
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "isAccepted": true,
      "name": "BTCUSD",
      "depositAddress": "1BTCorgHwCg6u2YSAWKgS17qUad6kHmtQW",
      }
      

Withdraw Coins 

Parameters:

ins - Instrument name (ex: “BTCUSD”)

product - Currency name (ex: “BTC”)

amount - Amount (ex: “.011”)

sendToAddress - Withdraw address

Withdraw coins
/ajax/v1/Withdraw
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "apiKey": "6afca79b51d0dc24751175129beea58a",
        "apiNonce": 14235891737658,
        "apiSig": "0F33B26164A374C692D6EE86D0128C8E41183576F20DD56B9EE72483706687FE"
        "ins": "BTCUSD",
        "product": "BTC",
        "amount": ".011",
        "sendToAddress": "1BTCorgHwCg6u2YSAWKgS17qUad6kHmtQW",
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "isAccepted": true,
      }
      

Order Management 

Create Order 

Parameters

ins - Instrument code (ex: “BTCUSD”)

side - “buy” or “sell”

orderType - “1” for market orders, “0” for limit orders

qty - Quantity

px - Price in USD

Creates a Market or Limit order
/ajax/v1/CreateOrder
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "apiKey": "6afca79b51d0dc24751175129beea58a",
        "apiNonce": 14235892519000,
        "apiSig": "21F65F3B02016165194390B6979C29768BBBBD5FA6FDB97B6F10AC435B41FDA3",
        "ins": "BTCUSD",
        "side": "buy",
        "orderType": 0,
        "qty": "1.0",
        "px": "342.99"
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "isAccepted": "true",
      "serverOrderId": "18",
      "dateTimeUtc": "952132543213543"
      }    
      

Modify Order 

Parameters:

serverOrderId - Order Id

ins - Instrument code (ex: “BTCUSD”)

modifyAction - “0” or “1”

“0” means "Move to top", which will modify the order price to the top of the book. A buy order will be modified to the highest bid and a sell order will be modified to the lowest ask price. “1” means "Execute now", which will convert a limit order into a market order.

Modifies an order
/ajax/v1/ModifyOrder
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "apiKey": "6afca79b51d0dc24751175129beea58a",
        "apiNonce": 14235893288142,
        "apiSig": "2D6571C540A623C3757F3A2EA770E77C9776CAC36F28BF422DD9C498674FF21C",
        "ins": "BTCUSD",
        "serverOrderId": 123,
        "modifyAction": 0
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "isAccepted": "true",
      "serverOrderId": "18",
      "dateTimeUtc": "952132543213543"
      }
      

Cancel Order 

Parameters:

ins - Instrument code (ex: “BTCUSD”)

serverOrderId - Order id (ex: 1000)

Cancel Order
/ajax/v1/CancelOrder
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "apiKey": "6afca79b51d0dc24751175129beea58a",
        "apiNonce": 14235894208604,
        "apiSig": "5530093336BE9EECF6FF5C57C1B05568D7E7C5486477E9F22B3A93C21EFD78A1",
        "ins": "BTCUSD",
        "serverOrderId": 123
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "isAccepted": "true",
      "serverOrderId": "18",
      "dateTimeUtc": "952132543213543"
      }
      

Cancel All Orders 

Parameters:

ins - Instrument code (ex: “BTCUSD”)

Cancels all orders for a given currency pair
/ajax/v1/CancelAllOrders
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "apiKey": "6afca79b51d0dc24751175129beea58a",
        "apiNonce": 14235895024539,
        "apiSig": "89EFBA6546983F33EDAA6AE9DFF29AE697153FECB4FA0A1499003DF8EED77270",
        "ins": "BTCUSD"
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "isAccepted": "true"
      }
      

Open Orders 

Get open orders
/ajax/v1/GetAccountOpenOrders
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
      "apiKey": "6afca79b51d0dc24751175129beea58a",
      "apiNonce": 14235895556338,
      "apiSig": "7FDE8EE527FE126EFF50FCDE8B502F0DF593043D3E56326892BEC9F5DBF98534"
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "openOrdersInfo": [
      {
        "ins": "BTCPHP",
        "openOrders": []
      },
      {
        "ins": "BTCMXN",
        "openOrders": []
      },
      {
        "ins": "LTCBTC",
        "openOrders": []
      },
      {
        "ins": "LTCUSD",
        "openOrders": []
      },
      {
        "ins": "BTCUSD",
        "openOrders": [
        {
        "ServerOrderId": 190590025,
        "AccountId": 21,
        "Price": 800,
        "QtyTotal": 4,
        "QtyRemaining": 4,
        "ReceiveTime": 635581759960537500,
        "Side": 1
      },
      {
        "ServerOrderId": 190590473,
        "AccountId": 21,
        "Price": 800,
        "QtyTotal": 4,
        "QtyRemaining": 4,
        "ReceiveTime": 635581759988506200,
        "Side": 1
      }
      ]
      }
      ],
      "isAccepted": true,
      "dateTimeUtc": 635581761565381200
      }    
      

Order Fee 

Parameters

instrument - Instrument code (ex: “BTCUSD”)

side - “buy” or “sell”

qty - Quantity

px - Price in USD

Get order fees
/ajax/v1/GetOrderFee
  • Request
  • Headers
    Content-Type: application/json
    Body
    {
        "apiKey": "6afca79b51d0dc24751175129beea58a",
        "apiNonce": 14235896457077,
        "apiSig": "0A57ACEBBAB13A55F167CFC261A91CCF4F3E2E114133E1F3A51B73BA5ABBA832",
        "ins": "BTCUSD",
        "side": "buy",
        "qty": "1.0",
        "px": "342.99"
      }
      
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {
      "isAccepted":"true",
      "rejectReason":null,
      "fee":"0.005",
      "feeProduct":"USD"
      }
      

WebSocket API 

The WebSocket protocol provides full-duplex communications channels over a single persistent TCP connection.

For real-time exchange data or high frequency activity we recommend using our WebSockets API.

AP WebSocket URI: WSS://sim3.alphapoint.com:8401

All WebSocket requests require the trailing “/” in the URI


Account Information

/v1/GetAccountInfo

Get Account Info

var ws = new WebSocket("wss://sim3.alphapoint.com:8401/v1/GetAccountInfo/");

      ws.onopen = function()
    {
    ws.send(JSON.stringify({apiKey: '704ef876d150bf0e024d2379d0e29274',apiNonce: 14231058655773,apiSig: '6A2BB3DF0BFC8757F0AD5A1628BC0FBAAC52CA186139B807B1E8567FDBAD6BE7'}));
  };
  ws.onmessage = function (evt)
  { 
  console.log(evt.data);
  };
  

Response

{"currencies":[{"name":"USD","balance":7168,"hold":0,"unconfirmed":0},{"name":"BTC","balance":992.995,"hold":0,"unconfirmed":0},{"name":"LTC","balance":1000,"hold":0,"unconfirmed":0},{"name":"MXN","balance":1000,"hold":0,"unconfirmed":0},{"name":"PHP","balance":1000,"hold":0,"unconfirmed":0},{"name":"GBP","balance":0,"hold":0,"unconfirmed":0},{"name":"EUR","balance":0,"hold":0,"unconfirmed":0}]}
  

Account Actions

/v1/GetAccountActions/

The GetAccountActions call provides different data feeds based on the messageType specified.

Message Types:

logon - Must be sent in the intial request before subscribing to a data stream

GetAllOpenOrders - Subscribe to open orders

GetAllAccountActions - Subscribe to account activty (Return limit: 50)

Get account actions

var ws = new WebSocket("wss://sim3.alphapoint.com:8401/v1/GetAccountActions/");

    ws.onopen = function()
  {
  ws.send(JSON.stringify({sessionToken: 'null',apiKey: '704ef876d150bf0e024d2379d0e29274',apiNonce: 14231058655773,apiSig: '6A2BB3DF0BFC8757F0AD5A1628BC0FBAAC52CA186139B807B1E8567FDBAD6BE7',messageType: 'logon'}));
  ws.send(JSON.stringify({messageType: 'GetAllOpenOrders'}));
  };
  ws.onmessage = function (evt)
  { 
  console.log(evt.data);
  };
  

Response

{"currencies":[{"name":"USD","balance":7168,"hold":0,"unconfirmed":0},{"name":"BTC","balance":992.995,"hold":0,"unconfirmed":0},{"name":"LTC","balance":1000,"hold":0,"unconfirmed":0},{"name":"MXN","balance":1000,"hold":0,"unconfirmed":0},{"name":"PHP","balance":1000,"hold":0,"unconfirmed":0},{"name":"GBP","balance":0,"hold":0,"unconfirmed":0},{"name":"EUR","balance":0,"hold":0,"unconfirmed":0}]}
  

Title Goes Here

Close

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quam magnam accusamus obcaecati nisi eveniet quo veniam quibusdam veritatis autem accusantium doloribus nam mollitia maxime explicabo nemo quae aspernatur impedit cupiditate dicta molestias consectetur, sint reprehenderit maiores. Tempora, exercitationem, voluptate. Sapiente modi officiis nulla sed ullam, amet placeat, illum necessitatibus, eveniet dolorum et maiores earum tempora, quas iste perspiciatis quibusdam vero accusamus veritatis. Recusandae sunt, repellat incidunt impedit tempore iusto, nostrum eaque necessitatibus sint eos omnis! Beatae, itaque, in. Vel reiciendis consequatur saepe soluta itaque aliquam praesentium, neque tempora. Voluptatibus sit, totam rerum quo ex nemo pariatur tempora voluptatem est repudiandae iusto, architecto perferendis sequi, asperiores dolores doloremque odit. Libero, ipsum fuga repellat quae numquam cumque nobis ipsa voluptates pariatur, a rerum aspernatur aliquid maxime magnam vero dolorum omnis neque fugit laboriosam eveniet veniam explicabo, similique reprehenderit at. Iusto totam vitae blanditiis. Culpa, earum modi rerum velit voluptatum voluptatibus debitis, architecto aperiam vero tempora ratione sint ullam voluptas non! Odit sequi ipsa, voluptatem ratione illo ullam quaerat qui, vel dolorum eligendi similique inventore quisquam perferendis reprehenderit quos officia! Maxime aliquam, soluta reiciendis beatae quisquam. Alias porro facilis obcaecati et id, corporis accusamus? Ab porro fuga consequatur quisquam illo quae quas tenetur.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque similique, at excepturi adipisci repellat ut veritatis officia, saepe nemo soluta modi ducimus velit quam minus quis reiciendis culpa ullam quibusdam eveniet. Dolorum alias ducimus, ad, vitae delectus eligendi, possimus magni ipsam repudiandae iusto placeat repellat omnis veritatis adipisci aliquam hic ullam facere voluptatibus ratione laudantium perferendis quos ut. Beatae expedita, itaque assumenda libero voluptatem adipisci maiores voluptas accusantium, blanditiis saepe culpa laborum iusto maxime quae aperiam fugiat odit consequatur soluta hic. Sed quasi beatae quia repellendus, adipisci facilis ipsa vel, aperiam, consequatur eaque mollitia quaerat. Iusto fugit inventore eveniet velit.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque similique, at excepturi adipisci repellat ut veritatis officia, saepe nemo soluta modi ducimus velit quam minus quis reiciendis culpa ullam quibusdam eveniet. Dolorum alias ducimus, ad, vitae delectus eligendi, possimus magni ipsam repudiandae iusto placeat repellat omnis veritatis adipisci aliquam hic ullam facere voluptatibus ratione laudantium perferendis quos ut. Beatae expedita, itaque assumenda libero voluptatem adipisci maiores voluptas accusantium, blanditiis saepe culpa laborum iusto maxime quae aperiam fugiat odit consequatur soluta hic. Sed quasi beatae quia repellendus, adipisci facilis ipsa vel, aperiam, consequatur eaque mollitia quaerat. Iusto fugit inventore eveniet velit.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quam magnam accusamus obcaecati nisi eveniet quo veniam quibusdam veritatis autem accusantium doloribus nam mollitia maxime explicabo nemo quae aspernatur impedit cupiditate dicta molestias consectetur, sint reprehenderit maiores. Tempora, exercitationem, voluptate. Sapiente modi officiis nulla sed ullam, amet placeat, illum necessitatibus, eveniet dolorum et maiores earum tempora, quas iste perspiciatis quibusdam vero accusamus veritatis. Recusandae sunt, repellat incidunt impedit tempore iusto, nostrum eaque necessitatibus sint eos omnis! Beatae, itaque, in. Vel reiciendis consequatur saepe soluta itaque aliquam praesentium, neque tempora. Voluptatibus sit, totam rerum quo ex nemo pariatur tempora voluptatem est repudiandae iusto, architecto perferendis sequi, asperiores dolores doloremque odit. Libero, ipsum fuga repellat quae numquam cumque nobis ipsa voluptates pariatur, a rerum aspernatur aliquid maxime magnam vero dolorum omnis neque fugit laboriosam eveniet veniam explicabo, similique reprehenderit at. Iusto totam vitae blanditiis. Culpa, earum modi rerum velit voluptatum voluptatibus debitis, architecto aperiam vero tempora ratione sint ullam voluptas non! Odit sequi ipsa, voluptatem ratione illo ullam quaerat qui, vel dolorum eligendi similique inventore quisquam perferendis reprehenderit quos officia! Maxime aliquam, soluta reiciendis beatae quisquam. Alias porro facilis obcaecati et id, corporis accusamus? Ab porro fuga consequatur quisquam illo quae quas tenetur.

Title Goes Here

Close

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quam magnam accusamus obcaecati nisi eveniet quo veniam quibusdam veritatis autem accusantium doloribus nam mollitia maxime explicabo nemo quae aspernatur impedit cupiditate dicta molestias consectetur, sint reprehenderit maiores. Tempora, exercitationem, voluptate. Sapiente modi officiis nulla sed ullam, amet placeat, illum necessitatibus, eveniet dolorum et maiores earum tempora, quas iste perspiciatis quibusdam vero accusamus veritatis. Recusandae sunt, repellat incidunt impedit tempore iusto, nostrum eaque necessitatibus sint eos omnis! Beatae, itaque, in. Vel reiciendis consequatur saepe soluta itaque aliquam praesentium, neque tempora. Voluptatibus sit, totam rerum quo ex nemo pariatur tempora voluptatem est repudiandae iusto, architecto perferendis sequi, asperiores dolores doloremque odit. Libero, ipsum fuga repellat quae numquam cumque nobis ipsa voluptates pariatur, a rerum aspernatur aliquid maxime magnam vero dolorum omnis neque fugit laboriosam eveniet veniam explicabo, similique reprehenderit at. Iusto totam vitae blanditiis. Culpa, earum modi rerum velit voluptatum voluptatibus debitis, architecto aperiam vero tempora ratione sint ullam voluptas non! Odit sequi ipsa, voluptatem ratione illo ullam quaerat qui, vel dolorum eligendi similique inventore quisquam perferendis reprehenderit quos officia! Maxime aliquam, soluta reiciendis beatae quisquam. Alias porro facilis obcaecati et id, corporis accusamus? Ab porro fuga consequatur quisquam illo quae quas tenetur.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque similique, at excepturi adipisci repellat ut veritatis officia, saepe nemo soluta modi ducimus velit quam minus quis reiciendis culpa ullam quibusdam eveniet. Dolorum alias ducimus, ad, vitae delectus eligendi, possimus magni ipsam repudiandae iusto placeat repellat omnis veritatis adipisci aliquam hic ullam facere voluptatibus ratione laudantium perferendis quos ut. Beatae expedita, itaque assumenda libero voluptatem adipisci maiores voluptas accusantium, blanditiis saepe culpa laborum iusto maxime quae aperiam fugiat odit consequatur soluta hic. Sed quasi beatae quia repellendus, adipisci facilis ipsa vel, aperiam, consequatur eaque mollitia quaerat. Iusto fugit inventore eveniet velit.