Skip to content
Sign up

Leveraged forex

Change stop-loss and take-profit

Set, move or remove the prices that close a position for you.

PATCH/api/v1/margin/positions/{reference}Get a key
curl --request PATCH \
  --url "https://reirex.com/api/v1/margin/positions/LP-7K2M4QX3P9" \
  --header "GX-API-KEY: $GX_API_KEY" \
  --header "GX-API-TIMESTAMP: $TIMESTAMP" \
  --header "GX-API-SIGN: $SIGNATURE" \
  --header "Content-Type: application/json" \
  --data '{"stopLoss":"1.16900","takeProfit":"1.18500"}'

200 OKapplication/json

{
  "reference": "LP-7K2M4QX3P9",
  "symbol": "EURUSD",
  "side": "long",
  "units": "10000.00",
  "leverage": 20,
  "entryPrice": "1.17447",
  "margin": "500.00",
  "stopLoss": "1.16900",
  "takeProfit": "1.18500",
  "status": "open",
  "closePrice": null,
  "pnl": null,
  "result": null,
  "financing": "0.00",
  "fees": "10.00",
  "closeReason": null,
  "openedAt": "2026-10-14T16:14:15.412Z",
  "closedAt": null,
  "live": {
    "price": "1.17441",
    "pnl": "-0.51",
    "marginLevel": "0.9990",
    "liquidationPrice": "1.14530",
    "notional": "10000.00",
    "financingPerNight": "0.83"
  },
  "currency": "EUR"
}

Send a price to set one and null to remove it; leave one out to keep it. A stop-loss sits below the price on a long and above it on a short, and a level on the wrong side answers bad_stop or bad_target.

Path parameters

  • referencestringrequired

    The position's reference.

Bodyapplication/json

  • stopLossstring | null

    The new stop-loss, or null to remove it.

  • takeProfitstring | null

    The new take-profit, or null to remove it.

Response

  • referencestring

    The position's reference, such as LP-7K2M4QX3P9.

  • symbolstring

    The currency pair.

  • sidestring

    long or short.

  • unitsstring

    Its size, in the pair's first currency.

  • leverageinteger

    The leverage it was opened with.

  • entryPricestring

    The price it opened at.

  • marginstring

    The euro held for it.

  • stopLossstring | null

    Its stop-loss, if one is set.

  • takeProfitstring | null

    Its take-profit, if one is set.

  • statusstring

    open, closed, or liquidated when it was closed out.

  • closePricestring | null

    The price it closed at; null while open.

  • pnlstring | null

    Its result less financing, in euro; null while open.

  • resultstring | null

    Its price result alone, in euro; null while open.

  • financingstring

    The overnight financing it has paid, in euro.

  • feesstring

    The fees it has paid, in euro.

  • closeReasonstring | null

    Why it closed: owner, stop_loss, take_profit, liquidation or staff; null while open.

  • openedAtstring

    When it opened.

  • closedAtstring | null

    When it closed; null while open.

  • liveobject | null

    Where an open position stands now; null once it has ended.

  • currencystring

    The currency of the euro figures: always EUR.