POST https://api.cryptohopper.com/v1/hopper/{id}/short/close/{position_id}

Closes one short position by placing a buy order at the current ask, or at market.

OAuth scope: read manage trade About scopes

The body is optional: market_order 1 places a market order. Not available for exchange arbitrage, market maker, copy, grid and AI bots.

Example request

curl -X POST "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/short/close/POSITION_ID" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"market_order":1}'

Parameters

Headers

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

Path parameters

NameTypeRequiredDescription
position_id string Required Short position ID.
id string Required Hopper ID.

Response

Example response (illustrative values)

{
    "data": "Buy orders (1) have been placed for the selected short position(s)."
}

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