Browse docs

Examples: what to build with the API

Seven things to build with the API, each with the request that does the work. Every example reads the shop and changes nothing.

The examples send a personal access token; see Make a personal access token. A list answers one page with the address of the next page in next; Make requests to the API shows the loop that reads a whole list.

Send yesterday’s numbers to the team each morning

A scheduled job asks for one day’s summary and posts the figures to the team’s chat.

curl "https://app.telltailhq.com/api/v1/reports/daily-summary?date=2026-11-25" \
  -H "Authorization: Bearer tt_pat_your_token"

The answer’s sales has count, net, tax and total for the day, in cents, and tenders lists what was taken by each payment type. The day is the shop’s own calendar day. Add locationId for one store.

Copy each day’s sales into a spreadsheet or your books

Ask for the sales completed on a day, oldest first, and follow next until next is null:

curl "https://app.telltailhq.com/api/v1/sales?status=completed&from=2026-11-25&to=2026-11-25&sort=created&dir=asc&limit=200" \
  -H "Authorization: Bearer tt_pat_your_token"

from and to are the days the sales were completed, both included. For one row per item sold, with its price, discounts, tax and cost, run the sales.lines report:

curl https://app.telltailhq.com/api/v1/reports/run \
  -H "Authorization: Bearer tt_pat_your_token" \
  -H "Content-Type: application/json" \
  -d '{"report":"sales.lines","params":{"from":"2026-11-25","to":"2026-11-25"}}'

A report that lists rows answers nextCursor. While nextCursor is not null, run the report again with params.cursor set to that value.

Keep a mailing list in step with your customers

Ask for customers by when they last changed, newest first, and stop at the first one your last run already saw:

curl "https://app.telltailhq.com/api/v1/customers?sort=updated&dir=desc&limit=200" \
  -H "Authorization: Bearer tt_pat_your_token"

Each row has firstName, lastName, email, phone and updatedAt. Keep the newest updatedAt you read, and on the next run stop when a row’s updatedAt is older. The list leaves out archived customers unless you ask for status=all.

Show the repairs that are ready for pickup

A screen at the service counter, or a tool that reminds customers, asks for the work orders that are finished and not yet collected:

curl "https://app.telltailhq.com/api/v1/work-orders?readyForPickup=true" \
  -H "Authorization: Bearer tt_pat_your_token"

A work order is ready when the shop has marked its status as finished and the work order is not closed. promisedFrom and promisedTo narrow any work-order list to the days the work was promised for.

List what has run out

curl "https://app.telltailhq.com/api/v1/products?stock=out&limit=200" \
  -H "Authorization: Bearer tt_pat_your_token"

stock=out is the items the shop keeps a count of and can’t sell one of right now: the quantity on hand, less what is reserved, is zero or below. Add locationId for one store, or vendorIds to build one vendor’s reorder list.

Pull the figures for a sales tax return

curl https://app.telltailhq.com/api/v1/reports/run \
  -H "Authorization: Bearer tt_pat_your_token" \
  -H "Content-Type: application/json" \
  -d '{"report":"tax.byRate","params":{"from":"2026-10-01","to":"2026-10-31"}}'

Each row is one tax rate with its taxable sales and the tax collected for the period. GET /reports/definitions lists every report with the parameters it takes; the reports are the ones on Reports.

Look up an item by its barcode

A price checker, a label tool or a warehouse scanner sends the code it read:

curl "https://app.telltailhq.com/api/v1/search/scan?code=012345678905" \
  -H "Authorization: Bearer tt_pat_your_token"

The answer is the item the register would add for that code. A code no item has answers 404.

NextAPI reference