Overview
The API is a small REST interface over HTTPS that reads and writes JSON. Tips you add appear in your history in the TipCalculate apps and the web dashboard, on every device signed in to your account.
| Base URL | https://tipcalculateapp.com/api |
| Format | JSON request and response bodies, UTF-8 |
| Authentication | API key sent as a Bearer token |
Authentication
Create a key in the dashboard under Developer. Each key belongs to your account and can only read and write your own tips. Send it in the Authorization header of every request:
Authorization: Bearer tc_live_…
- Keys start with
tc_live_followed by 40 letters and digits. - You can show or copy your keys at any time from the dashboard. They’re stored encrypted, and only you can view them while signed in.
- Revoke a key from the dashboard at any time. Requests using it fail immediately.
- Keep keys out of client-side code and public repositories. Anyone with your key can add tips to your history and read it.
Add a tip
Adds a tip to your history. Send a JSON body with the fields below; the three amounts are required.
| Field | Type | Description |
|---|---|---|
billAmountRequired | number | The bill before the tip. |
tipPercentageRequired | integer | The tip as a whole percentage, for example 20. |
totalAmountRequired | number | The bill plus the tip. |
tipAmountOptional | number | The tip itself. |
peopleCountOptional | integer | How many people split the bill. Defaults to 1. |
perPersonAmountOptional | number | Each person’s share. Defaults to totalAmount. |
currencyIdOptional | string | ISO 4217 currency code. Defaults to USD. |
categoryIdOptional | string | One of restaurant, cafe, bar, fastfood, delivery, hotel, salon, taxi, valet, tour, other. Defaults to other. |
businessNameOptional | string | Where the bill was, for example a restaurant name. |
addressOrDescriptionOptional | string | An address or short description of the place. |
notesOptional | string | Free-form notes. |
latitude, longitudeOptional | number | Location for the map view. Send both or neither. |
timestampOptional | integer | When the bill was paid, in milliseconds since the Unix epoch. Defaults to now. |
Response · 201 Created
{
"success": true,
"message": "Tip added.",
"id": "0d6f3c8e-2b41-4a7e-9c55-1f8a2e6b7d90",
"tip": {
"id": "0d6f3c8e-2b41-4a7e-9c55-1f8a2e6b7d90",
"billAmount": 84.5,
"tipPercentage": 20,
"tipAmount": 16.9,
"totalAmount": 101.4,
"currencyId": "USD",
"categoryId": "restaurant",
"timestamp": 1791763200000
}
}
List tips
Returns your most recent tips, newest first.
| Query parameter | Type | Description |
|---|---|---|
limitOptional | integer | How many tips to return, from 1 to 100. Defaults to 50. |
curl https://tipcalculateapp.com/api/tips?limit=10 \
-H "Authorization: Bearer $TIPCALCULATE_API_KEY"
Response · 200 OK
{
"success": true,
"count": 1,
"tips": [
{
"id": "0d6f3c8e-2b41-4a7e-9c55-1f8a2e6b7d90",
"billAmount": 84.5,
"tipPercentage": 20,
"tipAmount": 16.9,
"totalAmount": 101.4,
"peopleCount": 2,
"perPersonAmount": 50.7,
"currencyId": "USD",
"categoryId": "restaurant",
"businessName": "Harbor Lane Cafe",
"timestamp": 1791763200000
}
]
}
The tip object
Tips returned by the API have the fields described in Add a tip, plus an id. Optional fields are left out when they have no value. Tips saved in the apps may also include tipPercentageExact (the tip percentage with decimals) and receiptScanned (whether the bill was read with the receipt scanner). Ignore fields you don’t recognise; we may add new ones.
Errors
Errors use standard HTTP status codes and a JSON body with an error message:
{ "error": "Missing required field: totalAmount" }
| Status | Meaning |
|---|---|
400 | The body isn’t valid JSON, or a required field is missing. |
401 | The API key is missing, invalid or revoked. |
404 | The endpoint doesn’t exist. Check the method and path. |
429 | Too many requests. Requests may be rate limited; wait and retry with backoff. |
500 | Something went wrong on our side. Retry later, and contact us if it continues. |
Examples
Working recipes for common jobs, from logging a tip to a monthly report, are just below, each with a preview of what it produces.
Questions about the API, or need something it doesn’t do yet? Contact us.