GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Trading API Trading API
martin-nginio edited this page
Trade API covers all order placement and trade management. Below is the list of possible order status values:
All numbers, specifically for price and volume, must be converted to an integer for use in Trading API requests. The conversion is 100000000, or 1E8. For strongly typed programming languages, use of integer or long integer variable types is strongly recommended, as decimals will not be accepted by the API. places a new order if the parameters are correct and the account has sufficient funds. sample request: {
"currency": "AUD",
"instrument": "BTC",
"price": 13000000000,
"volume": 10000000,
"orderSide": "Bid",
"ordertype": "Limit"
}sample success response: {
"success": true,
"errorCode": null,
"errorMessage": null,
"id": 100,
"clientRequestId": null
}sample error response {
"success": false,
"errorCode": 3,
"errorMessage": "Invalid argument.",
"errorDetail": "Invalid order type",
"id": 0,
"clientRequestId": "null",
}
The following types of orders are supported:
This option is mainly useful for market makers and liquidity providers.
Note: When This is an optional parameter allowing traders to instruct the system to This feature eliminates the need for traders to calculate how many XRP's are needed before placing an order and particularly when marker is moving quickly, this might be a difficult task. This option also works for
below is a sample request when specifying target amount: {
"currency": "AUD",
"instrument": "XRP",
"targetAmount": 10000000000,
"orderSide": "Ask",
"ordertype": "Market"
}Please note that
The same is true also when the new order has the potential to partially match existing orders. So in above sample (your existing buy order of 100 Please also note that this option is only checked at the time of order arrival and only once. If the order stays in the orderbook then this option is not applicable anymore. Possible values for sample request with all of the options: {
"currency": "AUD",
"instrument": "BTC",
"price": 13000000000,
"volume": 10000000,
"orderSide": "Bid",
"ordertype": "Limit",
"postOnly": false,
"timeInForce": "FOK",
"selfTrade": "A"
}path: /order/cancel http post sample request: {"orderIds":[6840125478]}The array of order ids can contain maximum 30 items. sample response: {"success":true,"errorCode":null,"errorMessage":null,"responses":[{"success":false,"errorCode":3,"errorMessage":"order does not exist.","id":6840125478}]}path: /order/history http post since parameter for this api method is the order id. sample request: {"currency":"AUD","instrument":"BTC","limit":10,"since":33434568724}sample response: {"success":true,"errorCode":null,"errorMessage":null,"orders":[{"id":1003245675,"currency":"AUD","instrument":"BTC","orderSide":"Bid","ordertype":"Limit","creationTime":1378862733366,"status":"Placed","errorMessage":null,"price":13000000000,"volume":10000000,"openVolume":10000000,"clientRequestId":null,"trades":[]},{"id":4345675,"currency":"AUD","instrument":"BTC","orderSide":"Ask","ordertype":"Limit","creationTime":1378636912705,"status":"Fully Matched","errorMessage":null,"price":13000000000,"volume":10000000,"openVolume":0,"clientRequestId":null,"trades":[{"id":5345677,"creationTime":1378636913151,"description":null,"price":13000000000,"volume":10000000,"fee":100000}]}]}path: /order/open http post This is similar to the order history request and response. The only difference is that this method only returns open orders. path: /order/trade/history http post since parameter for this api method is the trade id. sample request: {"currency":"AUD","instrument":"BTC","limit":10,"since":33434568724}sample response: {"success":true,"errorCode":null,"errorMessage":null,"trades":[{"id":374367855,"creationTime":1492232900701,"price":159672000000,"volume":100000,"side":"Ask","fee":1357210,"orderId":374367838},{"id":229485482,"creationTime":1478837751322,"price":94299000000,"volume":100000,"side":"Bid","fee":801540,"orderId":229485469}]}path: /order/detail http post sample request: {"orderIds":[698068, 698771, 698825]}The value(s) for sample response: {
"success": true,
"errorCode": null,
"errorMessage": null,
"orders": [
{
"id": 698068,
"currency": "AUD",
"instrument": "ETH",
"orderSide": "Ask",
"ordertype": "Market",
"creationTime": 1516140997056,
"status": "Fully Matched",
"errorMessage": null,
"price": 1200000000,
"volume": 5000000,
"openVolume": 0,
"clientRequestId": null,
"trades": [
{
"id": 698080,
"creationTime": 1516140997301,
"description": null,
"price": 1200000000,
"volume": 5000000,
"side": "Ask",
"fee": 509999,
"orderId": 698068
}
]
},
{
"id": 698771,
"currency": "AUD",
"instrument": "BTC",
"orderSide": "Bid",
"ordertype": "Limit",
"creationTime": 1516919450949,
"status": "Partially Matched",
"errorMessage": null,
"price": 2700000000,
"volume": 100000000,
"openVolume": 4400000,
"clientRequestId": null,
"trades": [
{
"id": 698935,
"creationTime": 1517808598156,
"description": null,
"price": 2700000000,
"volume": 95600000,
"side": "Bid",
"fee": 21940174,
"orderId": 698771
}
]
},
{
"id": 698825,
"currency": "AUD",
"instrument": "BTC",
"orderSide": "Bid",
"ordertype": "Limit",
"creationTime": 1516923611252,
"status": "Placed",
"errorMessage": null,
"price": 2700000000,
"volume": 100000000,
"openVolume": 100000000,
"clientRequestId": null,
"trades": []
}
]
}http GET path: optional: To get all open orders, regardless of instrument and currency, simply leave them out of the path. See second example. pagination: no sample request: sample response: {
"success": true,
"errorCode": null,
"errorMessage": null,
"orders": [
{
"id": 702587,
"currency": "AUD",
"instrument": "BTC",
"orderSide": "Ask",
"ordertype": "Limit",
"creationTime": 1531518888090,
"status": "Placed",
"errorMessage": null,
"price": 998700000000,
"volume": 3000000,
"openVolume": 3000000,
"clientRequestId": null,
"trades": []
},
{
"id": 702590,
"currency": "AUD",
"instrument": "BTC",
"orderSide": "Ask",
"ordertype": "Limit",
"creationTime": 1531518897518,
"status": "Placed",
"errorMessage": null,
"price": 889800000000,
"volume": 4000000,
"openVolume": 4000000,
"clientRequestId": null,
"trades": []
}
]
}sample request: sample response: {
"success": true,
"errorCode": null,
"errorMessage": null,
"orders": [
{
"id": 743363,
"currency": "AUD",
"instrument": "BTC",
"orderSide": "Ask",
"ordertype": "Limit",
"creationTime": 1535659048351,
"status": "Placed",
"errorMessage": null,
"price": 930706000000,
"volume": 8404360,
"openVolume": 8404360,
"clientRequestId": null,
"trades": []
},
{
"id": 743565,
"currency": "AUD",
"instrument": "ETH",
"orderSide": "Bid",
"ordertype": "Limit",
"creationTime": 1535660328066,
"status": "Placed",
"errorMessage": null,
"price": 34791000000,
"volume": 363507743,
"openVolume": 363507743,
"clientRequestId": null,
"trades": []
}
]
}
This method cancels all open orders for all markets or a specific markets (if http POST path: If you want to cancel open orders for specific markets only, then please pass the following as the request body: {
"marketIds": ["BTC-AUD", "XRP-AUD"]
}sample response: {"success":true,"errorCode":null,"errorMessage":null,"orderIds":[3929899238,3929899017,3929705536]}The response includes orderIds for which cancellation has been requested. API authentication note: When calling this POST method and if no /v2/order/cancelall 1565207864688 If /v2/order/cancelall 1565207864688 {"marketIds":["BTC-AUD"]} http GET path: url parameters:
pagination: yes sample request: sample response: {
"success": true,
"errorCode": null,
"errorMessage": null,
"orders": [
{
"id": 701335,
"currency": "AUD",
"instrument": "BTC",
"orderSide": "Ask",
"ordertype": "Limit",
"creationTime": 1525903561732,
"status": "Fully Matched",
"errorMessage": null,
"price": 1000000000,
"volume": 100000000,
"openVolume": 0,
"clientRequestId": null,
"trades": [
{
"id": 701347,
"creationTime": 1525903561932,
"description": null,
"price": 2600000000,
"volume": 100000000,
"side": "Ask",
"fee": 22099974,
"orderId": 701335
}
]
},
{
"id": 701308,
"currency": "AUD",
"instrument": "BTC",
"orderSide": "Ask",
"ordertype": "Limit",
"creationTime": 1525903341150,
"status": "Fully Matched",
"errorMessage": null,
"price": 1000000000,
"volume": 100000000,
"openVolume": 0,
"clientRequestId": null,
"trades": [
{
"id": 701332,
"creationTime": 1525903341371,
"description": null,
"price": 2600000000,
"volume": 90000000,
"side": "Ask",
"fee": 19889976,
"orderId": 701308
},
{
"id": 701321,
"creationTime": 1525903341349,
"description": null,
"price": 2700000000,
"volume": 10000000,
"side": "Ask",
"fee": 2294997,
"orderId": 701308
}
]
},
{
"id": 701208,
"currency": "AUD",
"instrument": "BTC",
"orderSide": "Bid",
"ordertype": "Limit",
"creationTime": 1525899345980,
"status": "Fully Matched",
"errorMessage": null,
"price": 2700000000,
"volume": 100000000,
"openVolume": 0,
"clientRequestId": null,
"trades": [
{
"id": 701316,
"creationTime": 1525903341332,
"description": null,
"price": 2700000000,
"volume": 10000000,
"side": "Bid",
"fee": 2294997,
"orderId": 701208
},
{
"id": 701298,
"creationTime": 1525899507793,
"description": null,
"price": 2700000000,
"volume": 90000000,
"side": "Bid",
"fee": 20654975,
"orderId": 701208
}
]
}
],
"paging": {
"newer": "/v2/order/history/BTC/AUD?limit=3&since=701335&indexForward=true",
"older": "/v2/order/history/BTC/AUD?limit=3&since=701208&indexForward=false"
}
}http GET path: url parameters:
pagination: yes sample request: sample response: {
"success": true,
"errorCode": null,
"errorMessage": null,
"trades": [
{
"id": 701332,
"creationTime": 1525903341371,
"description": null,
"price": 2600000000,
"volume": 90000000,
"side": "Ask",
"fee": 19889976,
"orderId": 701308
},
{
"id": 701321,
"creationTime": 1525903341349,
"description": null,
"price": 2700000000,
"volume": 10000000,
"side": "Ask",
"fee": 2294997,
"orderId": 701308
},
{
"id": 701316,
"creationTime": 1525903341332,
"description": null,
"price": 2700000000,
"volume": 10000000,
"side": "Bid",
"fee": 2294997,
"orderId": 701208
},
{
"id": 701298,
"creationTime": 1525899507793,
"description": null,
"price": 2700000000,
"volume": 90000000,
"side": "Bid",
"fee": 20654975,
"orderId": 701208
}
],
"paging": {
"newer": "/v2/order/trade/history/BTC/AUD?limit=4&since=701332&indexForward=true",
"older": "/v2/order/trade/history/BTC/AUD?limit=4&since=701298&indexForward=false"
}
}Introduction updated 9/28/18 WebSocket v1 deprecated Market Data API updated 7/24/19 Trading API updated 08/19/19 Account API updated 3/14/19 Fund Transfer API updated 08/06/19 Clone this wiki locally |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |