Instruments

Also see Instruments.

Portfolios

Also see Portfolios.

Previews

Also see Previews.

Trades

Also see Trades.

Resource representations

{
  "kind": "draft",
  "id": integer,
  "created_at": datetime,
  "updated_at": datetime,
  "budget": decimal,
  "positions": [
    {
      "kind": "position",
      "id": integer,
      "weight": decimal,
      "quantity": integer,
      "market_value": decimal,
      "created_at": datetime,
      "updated_at": datetime,
      "instrument": instrument
    },
    .
    .
    .
  ]
}

Methods


GET /portfolios/:portfolio_id/draft
Get a portfolio draft.

Get a portfolio draft.

Params

Param Name Description
portfolio_id
Required

The slug of the portfolio to get the draft for.


Value:

Must be String


PATCH /portfolios/:portfolio_id/draft
Replace a portfolio draft.

PUT /portfolios/:portfolio_id/draft
Replace a portfolio draft.

Replace a portfolio draft.

Payload

Please note that you only need to pass the budget, the instrument ids and either the weight or the quantity.

  {
    "budget": decimal,
    "positions": [
      {
        "instrument_id": integer,
        "quantity": integer,
        "weight": decimal
      },
      .
      .
      .
    ]
  }

Any other parameters would be superfluous and will be ignored.

Params

Param Name Description
portfolio_id
Required

The slug of the portfolio to replace the draft for.


Value:

Must be String

draft
Required

Draft data.


Value:

Must be a Hash

draft[budget]
Optional

The budget of the draft.


Value:

Must be decimal.

draft[positions]
Optional

Draft positions.


Value:

Must be an Array of nested elements

draft[positions][instrument_id]
Required

The id of the instrument.


Value:

Must be Integer

draft[positions][weight]
Optional

The weight of the instrument.


Value:

Must be decimal.

draft[positions][quantity]
Optional

The quantity of the instrument.


Value:

Must be Integer


DELETE /portfolios/:portfolio_id/draft
Delete the draft of a portfolio.

Delete the draft of a portfolio.

Params

Param Name Description
portfolio_id
Required

The slug of the portfolio to delete the draft for.


Value:

Must be String