ORDER_PROTOCOL.md 908 B

Order Protocol

place_order request JSON

{
  "account_id": "qndd8o9ppop6",
  "market": "xrpusd",
  "side": "buy",
  "order_type": "limit",
  "amount": "100.0",
  "price": "0.52",
  "expire_time": 3600,
  "client_order_id": "optional-client-id"
}

place_order success response JSON

{
  "ok": true,
  "bitstamp_order_id": "1234567890",
  "record_id": "local-order-id",
  "status": "open",
  "raw": {}
}

place_order failure response JSON

{
  "ok": false,
  "error": "reason from exchange or validation",
  "details": {}
}

Rules

  • account_id is the internal account id only.
  • market is a Bitstamp pair such as xrpusd.
  • amount is a string in base currency units.
  • side is buy or sell.
  • order_type is market or limit.
  • price is required for limit orders.
  • expire_time is optional, in seconds.
  • client_order_id is optional.