New Order

URL: https://exchange.bartertrade.io/api/v1/order

Method: POST

Attributes:

form – (Object) – form data – amount, price

api_key – (string) - Key to access the user’s data

coin1 - (string) – Token Symbol

coin2 - (string) – Second Token Symbol

market – (string) – Type of Order (Market, Limit, Pie )

side - (string) - sell / buy

market_price : (decimal) : barter trade price

marketprice : (decimal): calculated coinbase market price

Header :

  • API-keys are passed into the Rest API via the 'Authorization' header.

  • API-keys and secret-keys are case sensitive.

  • SIGNED secret key, iat and exp with JWT signature.

How to create token?

Example :

let payload =

{ iat: seconds, //10 digit exp: seconds_exp, //10 digit secretkey: secretkey };

let token = jwt.sign( payload, secretkey );

headers: { 'Authorization': token, 'Content-Type': 'application/json', },

Body

{
   form: {"amount":2}, 
   market_price: 0.2, 
   side: "Sell", 
   market: "market", 
   coin1: "BART", 
   coin2: "ETH", 
   marketPrice: 0.2, 
   api_key: apikey
}

Response - response will have order Id and coin which you will get

For Limit Order:

{ status: true, message: 'Your order is successfully processed.' }

For Market Order:

{"status":true,"available":"921.138","inorder":"0","orderid":"167","coin":"BART"}

Last updated

Was this helpful?