# Reports tools

[All tool areas](/docs/tools.md). Each tool acts within your access.

## Reports

### get_bookings_report

Get counts, not money, for any range of local dates (up to 366 days), grouped by day, week (Monday), month, location, or product: confirmed bookings and their seats, who made them (the guest or staff), bookings canceled, and no-shows (null until check-in exists), plus the party size distribution over the range. Bookings are put in the range by `basis` (booked: the date confirmed; session: the date it runs), at each location's own time zone. On the booked basis a period that has gone by never changes: a seat change counts its seats on the day it was made, and a cancellation, on the day it happened, takes its booking and seats off (bookings and seats are net of it) and counts a canceled booking and its seats. The party size distribution is the parties as booked, whatever became of them. Needs bookings:read, checked for each location. `columns` and `rows` give the same figures as a table, to export as a CSV.

Reads · Members of an organization · Needs bookings:read

#### Input

- `from` — string; required. First local date, inclusive format: "date"
- `to` — string; required. Last local date, inclusive, up to 366 days after `from` format: "date"
- `basis` — string; optional. Which date puts an order in the range: `booked` (the local date, at its location, the order was confirmed) or `session` (the local date its session runs). Money that moved always uses its own date Allowed: "booked", "session"; default: "booked"
- `locationId` — string; optional. The location's id, from get_setup
- `productId` — string; optional. The product's id, from list_products
- `groupBy` — string; optional. How to group the rows (default day) Allowed: "day", "week", "month", "location", "product"; default: "day"

#### Output

- `from` — string; required. 
- `to` — string; required. 
- `basis` — string; required.  Allowed: "booked", "session"
- `groupBy` — string; required.  Allowed: "day", "week", "month", "location", "product"
- `canExport` — boolean; required. Whether the organization's plan includes CSV export (Growth and up): the screen offers the download only then. The rows are the same either way
- `columns` — array; required. 
  - `columns[]` — object; optional. 
    - `columns[].key` — string; required. 
    - `columns[].label` — string; required. 
    - `columns[].kind` — string; required.  Allowed: "money", "count", "date", "text"
- `rows` — array; required. 
  - `rows[]` — object; optional. 
    - `rows[].group` — string; required. 
    - `rows[].label` — string; required. 
    - `rows[].bookings` — integer; required. Confirmed bookings minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].seats` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].bookedByCustomer` — integer; required. Confirmed bookings the guest made themselves minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].bookedByStaff` — integer; required. Confirmed bookings staff made (walk-ins, phone) minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].canceledBookings` — integer; required. Bookings canceled, on the day of the cancellation (booked basis) or the session's day minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].canceledSeats` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].noShows` — integer or null; required. Null until check-in is kept minimum: -9007199254740991; maximum: 9007199254740991
- `totals` — object; required. 
  - `totals.group` — string; required. 
  - `totals.label` — string; required. 
  - `totals.bookings` — integer; required. Confirmed bookings minimum: -9007199254740991; maximum: 9007199254740991
  - `totals.seats` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
  - `totals.bookedByCustomer` — integer; required. Confirmed bookings the guest made themselves minimum: -9007199254740991; maximum: 9007199254740991
  - `totals.bookedByStaff` — integer; required. Confirmed bookings staff made (walk-ins, phone) minimum: -9007199254740991; maximum: 9007199254740991
  - `totals.canceledBookings` — integer; required. Bookings canceled, on the day of the cancellation (booked basis) or the session's day minimum: -9007199254740991; maximum: 9007199254740991
  - `totals.canceledSeats` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
  - `totals.noShows` — integer or null; required. Null until check-in is kept minimum: -9007199254740991; maximum: 9007199254740991
- `partySizeColumns` — array; required. 
  - `partySizeColumns[]` — object; optional. 
    - `partySizeColumns[].key` — string; required. 
    - `partySizeColumns[].label` — string; required. 
    - `partySizeColumns[].kind` — string; required.  Allowed: "money", "count", "date", "text"
- `partySizes` — array; required. Confirmed bookings by party size, smallest first
  - `partySizes[]` — object; optional. 
    - `partySizes[].partySize` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `partySizes[].bookings` — integer; required. Confirmed bookings of it minimum: -9007199254740991; maximum: 9007199254740991

### get_sales_report

Get sales for any range of local dates (up to 366 days), grouped by day, week (Monday), month, location, or product: per group and currency, the orders, seats, tickets, extras, discounts, net sales (after discounts, before service charge and tax), service charge, tax, and total booked; then what was collected (payments less refunds, on the date the money moved), refunded, and the balance due. Booked is what was sold (orders by the date they were confirmed, or by `basis: session` the date their session runs, at each location's own time zone); collected is only money that moved, so an unpaid staff booking is booked and never collected. `collectedByTender` splits collected by what it moved by; a refund given as a credit or gift certificate instead of back to the card or the desk is refunded under its own tender (`given_as_credit`, `given_as_gift_certificate`), never the card's. On the booked basis a seat change counts its difference on the day it was made, not on the booking's, so a day that has gone by never changes. Currencies are never added together. Needs revenue:read, checked for each location: a member at one location sees only its figures. `columns` and `rows` give the same figures as a table, to export as a CSV.

Reads · Members of an organization · Needs revenue:read

#### Input

- `from` — string; required. First local date, inclusive format: "date"
- `to` — string; required. Last local date, inclusive, up to 366 days after `from` format: "date"
- `basis` — string; optional. Which date puts an order in the range: `booked` (the local date, at its location, the order was confirmed) or `session` (the local date its session runs). Money that moved always uses its own date Allowed: "booked", "session"; default: "booked"
- `locationId` — string; optional. The location's id, from get_setup
- `productId` — string; optional. The product's id, from list_products
- `groupBy` — string; optional. How to group the rows (default day) Allowed: "day", "week", "month", "location", "product"; default: "day"

#### Output

- `from` — string; required. 
- `to` — string; required. 
- `basis` — string; required.  Allowed: "booked", "session"
- `groupBy` — string; required.  Allowed: "day", "week", "month", "location", "product"
- `canExport` — boolean; required. Whether the organization's plan includes CSV export (Growth and up): the screen offers the download only then. The rows are the same either way
- `columns` — array; required. 
  - `columns[]` — object; optional. 
    - `columns[].key` — string; required. 
    - `columns[].label` — string; required. 
    - `columns[].kind` — string; required.  Allowed: "money", "count", "date", "text"
- `rows` — array; required. 
  - `rows[]` — object; optional. 
    - `rows[].group` — string; required. The group's key: its date (a week's Monday, a month's first), or the location or product id
    - `rows[].label` — string; required. 
    - `rows[].currency` — string; required. 
    - `rows[].orders` — integer; required. Confirmed orders booked in the range, by the basis; a cancellation takes its order off on the day it was canceled (booked basis) minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].canceledOrders` — integer; required. Orders canceled in the range (booked basis: on the day of the cancellation; session basis: the order's session day). The cancellation counts what the order kept: the money it holds after refunds, however much, shared across the amounts below in proportion to what it was last booked at, so with its sale and seat changes it equals what was collected on it minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].seats` — integer; required. Seats on the confirmed orders, as booked; a seat change adds or takes off its seats on the day it was made, and a cancellation takes its seats off on the day it happened (booked basis) minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].tickets` — integer; required. Ticket lines before discounts, without fees or tax minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].extras` — integer; required. Add-ons and menu supplements before discounts minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].discounts` — integer; required. What promo codes and free stored value took off tickets and extras. A waived service charge isn't here: it's lower serviceCharge minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].netSales` — integer; required. tickets + extras - discounts, before service charge and tax minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].serviceCharge` — integer; required. Fees on the orders booked, before their tax minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].tax` — integer; required. Minor units (cents) in the row's currency minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].totalBooked` — integer; required. netSales + serviceCharge + tax: what was sold, whether or not it was paid minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].payments` — integer; required. Payments that succeeded in the range, on the local date each came in, for any order minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].refunded` — integer; required. Refunds requested in the range (pending or succeeded), on the local date asked, for any order minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].collected` — integer; required. payments - refunded: the money kept that moved in the range. A staff booking nobody has paid is booked and never here minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].balanceDue` — integer; required. Unpaid on the confirmed orders booked in the range, as of now (paymentStateOf) minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].overPaid` — integer; required. Paid beyond the total on those orders as of now (seats removed from a paid order), owed back to the guest minimum: -9007199254740991; maximum: 9007199254740991
- `totals` — array; required. One row for each currency, over every row
  - `totals[]` — object; optional. 
    - `totals[].group` — string; required. The group's key: its date (a week's Monday, a month's first), or the location or product id
    - `totals[].label` — string; required. 
    - `totals[].currency` — string; required. 
    - `totals[].orders` — integer; required. Confirmed orders booked in the range, by the basis; a cancellation takes its order off on the day it was canceled (booked basis) minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].canceledOrders` — integer; required. Orders canceled in the range (booked basis: on the day of the cancellation; session basis: the order's session day). The cancellation counts what the order kept: the money it holds after refunds, however much, shared across the amounts below in proportion to what it was last booked at, so with its sale and seat changes it equals what was collected on it minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].seats` — integer; required. Seats on the confirmed orders, as booked; a seat change adds or takes off its seats on the day it was made, and a cancellation takes its seats off on the day it happened (booked basis) minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].tickets` — integer; required. Ticket lines before discounts, without fees or tax minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].extras` — integer; required. Add-ons and menu supplements before discounts minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].discounts` — integer; required. What promo codes and free stored value took off tickets and extras. A waived service charge isn't here: it's lower serviceCharge minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].netSales` — integer; required. tickets + extras - discounts, before service charge and tax minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].serviceCharge` — integer; required. Fees on the orders booked, before their tax minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].tax` — integer; required. Minor units (cents) in the row's currency minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].totalBooked` — integer; required. netSales + serviceCharge + tax: what was sold, whether or not it was paid minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].payments` — integer; required. Payments that succeeded in the range, on the local date each came in, for any order minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].refunded` — integer; required. Refunds requested in the range (pending or succeeded), on the local date asked, for any order minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].collected` — integer; required. payments - refunded: the money kept that moved in the range. A staff booking nobody has paid is booked and never here minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].balanceDue` — integer; required. Unpaid on the confirmed orders booked in the range, as of now (paymentStateOf) minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].overPaid` — integer; required. Paid beyond the total on those orders as of now (seats removed from a paid order), owed back to the guest minimum: -9007199254740991; maximum: 9007199254740991
- `collectedByTender` — array; optional. 
  - `collectedByTender[]` — object; optional. 
    - `collectedByTender[].tender` — string; required. What it moved by: the card, or what staff took offline; or `given_as_credit` / `given_as_gift_certificate`, refunds given as a credit or gift certificate instead of back where they were paid (no money left the provider or the till) Allowed: "card", "card\_terminal", "cash", "debit", "e\_transfer", "cheque", "voucher", "given\_as\_credit", "given\_as\_gift\_certificate"
    - `collectedByTender[].currency` — string; required. 
    - `collectedByTender[].amount` — integer; required. Minor units (cents) in the row's currency minimum: -9007199254740991; maximum: 9007199254740991
- `giftCertificatesSold` — array; optional. 
  - `giftCertificatesSold[]` — object; optional. 
    - `giftCertificatesSold[].currency` — string; required. 
    - `giftCertificatesSold[].count` — integer; required.  minimum: -9007199254740991; maximum: 9007199254740991
    - `giftCertificatesSold[].amount` — integer; required. Minor units (cents) in the row's currency minimum: -9007199254740991; maximum: 9007199254740991
- `paidWithGiftCertificates` — array; optional. 
  - `paidWithGiftCertificates[]` — object; optional. 
    - `paidWithGiftCertificates[].currency` — string; required. 
    - `paidWithGiftCertificates[].amount` — integer; required. Minor units (cents) in the row's currency minimum: -9007199254740991; maximum: 9007199254740991
- `paidWithCredits` — array; optional. 
  - `paidWithCredits[]` — object; optional. 
    - `paidWithCredits[].currency` — string; required. 
    - `paidWithCredits[].amount` — integer; required. Minor units (cents) in the row's currency minimum: -9007199254740991; maximum: 9007199254740991

### get_service_charge_report

Get the service charge (every fee) for any range of local dates (up to 366 days), by location and day, month, or the whole range, in each currency: charged, waived by a promo code, kept on refunded orders, refunded, and net, before tax (its tax is in get_tax_report). Orders are put in the range by `basis` (booked: the date confirmed; session: the date it runs). A fee sold as non-refundable stays at what was paid toward it when seats are removed or a refund is made, so it stays in net. Needs revenue:read, checked for each location.

Reads · Members of an organization · Needs revenue:read

#### Input

- `from` — string; required. First local date, inclusive format: "date"
- `to` — string; required. Last local date, inclusive, up to 366 days after `from` format: "date"
- `basis` — string; optional. Which date puts an order in the range: `booked` (the local date, at its location, the order was confirmed) or `session` (the local date its session runs). Money that moved always uses its own date Allowed: "booked", "session"; default: "booked"
- `locationId` — string; optional. The location's id, from get_setup
- `productId` — string; optional. The product's id, from list_products
- `period` — string; optional. Group the charge by day, month, or all together Allowed: "day", "month", "all"; default: "month"

#### Output

- `from` — string; required. 
- `to` — string; required. 
- `basis` — string; required.  Allowed: "booked", "session"
- `period` — string; required.  Allowed: "day", "month", "all"
- `canExport` — boolean; required. Whether the organization's plan includes CSV export (Growth and up): the screen offers the download only then. The rows are the same either way
- `columns` — array; required. 
  - `columns[]` — object; optional. 
    - `columns[].key` — string; required. 
    - `columns[].label` — string; required. 
    - `columns[].kind` — string; required.  Allowed: "money", "count", "date", "text"
- `rows` — array; required. 
  - `rows[]` — object; optional. 
    - `rows[].locationId` — string; required. 
    - `rows[].location` — string; required. 
    - `rows[].period` — string; required. The day, the month's first day, or `all` over the range
    - `rows[].currency` — string; required. 
    - `rows[].charged` — integer; required. Fees on the orders booked in the period, before their tax (a cancellation counts, on its day, the fee within the money the order kept less the fee already counted) minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].waived` — integer; required. Fees a waive-service-charge promo code took off minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].keptOnRefundedOrders` — integer; required. Non-refundable fees held on orders that have had a refund (the fee a refund never returns), included in net minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].refunded` — integer; required. Refundable fees given back in goodwill refunds on those orders, whenever they were made. The non-refundable service charge is never refunded, except when Lokl can't seat a paid order (which was never booked) minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].net` — integer; required. charged - refunded minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].uncollected` — integer; required. The share of net in what is still unpaid, as of now minimum: -9007199254740991; maximum: 9007199254740991
- `totals` — array; required. 
  - `totals[]` — object; optional. 
    - `totals[].locationId` — string; required. 
    - `totals[].location` — string; required. 
    - `totals[].period` — string; required. The day, the month's first day, or `all` over the range
    - `totals[].currency` — string; required. 
    - `totals[].charged` — integer; required. Fees on the orders booked in the period, before their tax (a cancellation counts, on its day, the fee within the money the order kept less the fee already counted) minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].waived` — integer; required. Fees a waive-service-charge promo code took off minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].keptOnRefundedOrders` — integer; required. Non-refundable fees held on orders that have had a refund (the fee a refund never returns), included in net minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].refunded` — integer; required. Refundable fees given back in goodwill refunds on those orders, whenever they were made. The non-refundable service charge is never refunded, except when Lokl can't seat a paid order (which was never booked) minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].net` — integer; required. charged - refunded minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].uncollected` — integer; required. The share of net in what is still unpaid, as of now minimum: -9007199254740991; maximum: 9007199254740991

### get_tax_report

Get the tax to remit, for any range of local dates (up to 366 days): per location, then tax class and rate, the taxable amount and the tax booked, refunded, and net, in each currency. Orders are put in the range by `basis` (booked: the date confirmed; session: the date it runs), at each location's own time zone, and the figures are the orders' locked totals: fees are taxed only where their tax class says so. Refunds are attributed to the order they were made on, not to the day they were made. `taxUncollected` is the share of the net tax still unpaid. A cancellation counts, on the day it happened, the tax on what the order kept (the money it holds after refunds, in proportion to what it was last booked at) less the tax already counted for it. A seat change counts for its difference, on the date it was made, so a period that has gone by never changes because of a later change or cancellation. Needs revenue:read, checked for each location.

Reads · Members of an organization · Needs revenue:read

#### Input

- `from` — string; required. First local date, inclusive format: "date"
- `to` — string; required. Last local date, inclusive, up to 366 days after `from` format: "date"
- `basis` — string; optional. Which date puts an order in the range: `booked` (the local date, at its location, the order was confirmed) or `session` (the local date its session runs). Money that moved always uses its own date Allowed: "booked", "session"; default: "booked"
- `locationId` — string; optional. The location's id, from get_setup
- `productId` — string; optional. The product's id, from list_products

#### Output

- `from` — string; required. 
- `to` — string; required. 
- `basis` — string; required.  Allowed: "booked", "session"
- `canExport` — boolean; required. Whether the organization's plan includes CSV export (Growth and up): the screen offers the download only then. The rows are the same either way
- `columns` — array; required. 
  - `columns[]` — object; optional. 
    - `columns[].key` — string; required. 
    - `columns[].label` — string; required. 
    - `columns[].kind` — string; required.  Allowed: "money", "count", "date", "text"
- `rows` — array; required. 
  - `rows[]` — object; optional. 
    - `rows[].locationId` — string; required. 
    - `rows[].location` — string; required. 
    - `rows[].taxClass` — string; required. 
    - `rows[].taxName` — string; required. 
    - `rows[].ratePpm` — integer; required. Parts per million: 13% is 130000 minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].currency` — string; required. 
    - `rows[].taxableBooked` — integer; required. What the tax was charged on (lines and fees taxed at this rate), on the orders booked in the range minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].taxBooked` — integer; required. Minor units (cents) in the row's currency minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].taxableRefunded` — integer; required. Minor units (cents) in the row's currency minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].taxRefunded` — integer; required. The tax in goodwill refunds on those orders, whenever they were made: each refund takes the same share of every refundable part (never the non-refundable fees and their tax) minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].taxableNet` — integer; required. Minor units (cents) in the row's currency minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].taxNet` — integer; required. taxBooked - taxRefunded: the tax to remit for these sales minimum: -9007199254740991; maximum: 9007199254740991
    - `rows[].taxUncollected` — integer; required. The share of taxNet in what is still unpaid on those orders (as of now), so a bookkeeper on cash basis can take it off minimum: -9007199254740991; maximum: 9007199254740991
- `totals` — array; required. One row for each currency, over every rate. The taxable amounts are null there: a line taxed at two rates would count twice
  - `totals[]` — object; optional. 
    - `totals[].locationId` — string; required. 
    - `totals[].location` — string; required. 
    - `totals[].taxClass` — string; required. 
    - `totals[].taxName` — string; required. 
    - `totals[].ratePpm` — integer or null; required. Parts per million: 13% is 130000 minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].currency` — string; required. 
    - `totals[].taxableBooked` — integer or null; required. What the tax was charged on (lines and fees taxed at this rate), on the orders booked in the range minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].taxBooked` — integer; required. Minor units (cents) in the row's currency minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].taxableRefunded` — integer or null; required. Minor units (cents) in the row's currency minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].taxRefunded` — integer; required. The tax in goodwill refunds on those orders, whenever they were made: each refund takes the same share of every refundable part (never the non-refundable fees and their tax) minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].taxableNet` — integer or null; required. Minor units (cents) in the row's currency minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].taxNet` — integer; required. taxBooked - taxRefunded: the tax to remit for these sales minimum: -9007199254740991; maximum: 9007199254740991
    - `totals[].taxUncollected` — integer; required. The share of taxNet in what is still unpaid on those orders (as of now), so a bookkeeper on cash basis can take it off minimum: -9007199254740991; maximum: 9007199254740991
