Invoice

POST a messy bill of aliases, tickers, and cash lines. Marks assets to today's spot, totals in INR or USD, and says what most of the invoice is. GET /api/v1/invoice lists the aliases.

View Docs

Parameters

currency string

INR or USD for the total. Defaults to INR. Sent in the JSON body.

Example: INR

lines array Required

JSON array. Use { id, amount } for aliases/tickers, or { label, cash } for plain money. 1 to 20.

Example: [{"id":"gold","amount":1},{"id":"AAPL","amount":2},{"label":"snacks","cash":500}]

Responses

200 OK Success
{
  "ok": true,
  "currency": "INR",
  "total": 420500.12,
  "lines": [
    {
      "id": "gold",
      "name": "Gold",
      "symbol": "GC=F",
      "amount": 1,
      "price": 4286.9,
      "quoteCurrency": "USD",
      "value": 410000,
      "weight": 0.97
    }
  ],
  "skipped": [],
  "verdict": "Most of this invoice is gold."
}
400 BAD_REQUEST lines cannot be empty
502 BAD_GATEWAY none of those lines had a price