POST https://api.cryptohopper.com/v1/hopper/{id}/position/sell

Places sell orders for the given open positions at the current bid, or at the price you send. Without position_id it sells all open positions of the given currency that are not on hold.

OAuth scope: trade About scopes

Uses the order rate limit bucket: 1 request per 8 seconds. Optional fields: price (limit price) and market_order (1 for a market order). When selling by currency instead of position_id, data is "Sell order will be placed at the exchange.". If a selected position already has an open order, the call stops there and returns "Order already placed". Requires an active subscription for the hopper.

Example request

curl -X POST "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/position/sell" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"position_id":[123456,123457],"market_order":0}'

Parameters

Headers

NameTypeRequiredDescription
access-token string Required The OAuth access token of the user.

Path parameters

NameTypeRequiredDescription
id string Required Hopper ID.

Request body

JSON, model PositionSellPOST

FieldTypeRequiredDescription
position_idarray of integerOptional

Response

Example response (illustrative values)

{
    "data": "Sell order for position placed."
}

Status codes: 200. Errors return JSON with status, error and message. See How the API works for response codes and rate limits.