Buy
The Buy API allows you to place a Buy order under a user's account.
Note, only accountId's that are created under your organization will be accessible.
Note, although Winter connects with multiple exchanges, we will fulfill your buy order at the best possible price, regardless of exchange. We abstract away needing to figure out which exchange is the best. Fees are the same regardless of which exchange we use to fulfill.
#
API detailsURL : /v1/buy
Method : POST
Auth required : Yes (API key and secret are required)
#
Body payloadSample body payload:
{ "accountId": "12345", "order_type": "LIMIT", "limit_order_max_price": 4010.00, "crypto_ticker": "ETH", "amount": 0.023}
- accountId - String. The accountId of the returned account
- order_type - Enum. Type of order. Options: LIMIT
, MARKET
- limit_order_max_price - Double. REQUIRED if order_type
is LIMIT
. The maximum USD price to pay for the order. This price is the USD price for 1 complete coin, regardless of the amount in the order.
For example, if the user only wants to buy 0.5 ETH, the limit_order_max_price
will be the max price paid for 1 ETH
- crypto_ticker - String. The ticker of the crypto to buy. Check this page for the cryptos we support
- amount - Double. The amount of the crypto ticker to buy
- time_in_force - Enum, optional. How long the order should be open before expiring. By default, the time_in_force
will be 60_DAYS
. Options: 24_HOURS
, 60_DAYS
#
Success ResponseCode : 200 OK
Sample response return:
{ "orderId": "12345", "order_status": "OPEN"}
- orderId - String. The unique identifier for the trade
- order_status - Enum. Enum that represents the trade status. Enum options: FULFILLED
, OPEN
, USER_CANCELLED
, EXPIRED
, SYSTEM_CANCELLED
#
Error ResponseCode : 400 BAD REQUEST
Condition : If accountId is invalid or if organization does not have access to this account.
Code : 409 NOT ENOUGH ACCOUNT FUNDS
Condition : If accountId is invalid or if organization does not have access to this account.