Split

POST a bill total and a list of people with shares. Each person gets what they owe in the request currency plus INR and USD via today's rupee rate. share is a fraction or the string equal. GET /api/v1/split shows the body shape.

View Docs

Parameters

total number Required

Bill total in the request currency. Sent in the JSON body.

Example: 3000

currency string

INR or USD. Defaults to INR.

Example: INR

people array Required

JSON array of { name, share }. 1 to 20. share is 0-1 or equal.

Example: [{"name":"a","share":0.5},{"name":"b","share":0.3},{"name":"c","share":"equal"}]

Responses

200 OK Success
{
  "ok": true,
  "total": 3000,
  "currency": "INR",
  "usdInr": 95.82,
  "people": [
    {
      "name": "a",
      "share": 0.5,
      "owes": 1500,
      "owesInr": 1500,
      "owesUsd": 15.65
    }
  ],
  "winner": {
    "name": "a",
    "owes": 1500
  },
  "verdict": "a pays the most (1500 rupees)."
}
400 BAD_REQUEST people cannot be empty
502 BAD_GATEWAY could not load the rupee rate