List Order Lines

GET /order-lines

You can use this endpoint to retrieve a list of order lines, newest first. Optionally, you can use the filter parameter to pick a period, a kind of sale, one order or one thing sold.

Use the Pagination and Querying sections to learn more about how to complete this request.

Available Fields to Query

Field NameTypeDescription
DATEdateWhen the order was completed. On refund lines: when the refund was made
TYPEtextMEMBERSHIP, TICKET, EVENT_TICKET, PRODUCT, GIFTCARD or DONATION
ORDER_IDuuidThe order
REFUND_IDuuidThe refund. IS_EMPTY keeps the sold lines only, NOT_IS_EMPTY the refund lines only
IS_RETURNbooleanReturns at the till
MEMBERSHIP_TYPE_IDuuidThe membership type, on memberships and membership gift cards
TICKET_TYPE_IDuuidThe ticket type
EVENT_IDuuidThe event, or the date of an event series
EVENT_TICKET_TYPE_IDuuidThe event ticket type
PRODUCT_IDuuidThe product
CASH_REGISTER_IDuuidThe till

DATE values are milliseconds since 1 January 1970 UTC. IS_EMPTY and NOT_IS_EMPTY take no value. INCLUDES takes a list, for example several types at once.

Revenue per category

To see how much the museum made on each kind of thing in a period, list the lines in the period and add up amount per type.

For example, memberships sold in October 2026, Copenhagen time (1 October 00:00 to 1 November 00:00):

Copy
{ "operator": "AND", "conditions": [ { "operator": "EQUAL", "fieldName": "TYPE", "value": "MEMBERSHIP" }, { "operator": "GREATER_OR_EQUAL", "fieldName": "DATE", "value": 1790805600000 }, { "operator": "LESSER", "fieldName": "DATE", "value": 1793487600000 } ] }
GET https://api.loby.io/v1/order-lines?filter=%7B%22operator%22%3A%22AND%22%2C%22conditions%22%3A%5B%7B%22operator%22%3A%22EQUAL%22%2C%22fieldName%22%3A%22TYPE%22%2C%22value%22%3A%22MEMBERSHIP%22%7D%2C%7B%22operator%22%3A%22GREATER_OR_EQUAL%22%2C%22fieldName%22%3A%22DATE%22%2C%22value%22%3A1790805600000%7D%2C%7B%22operator%22%3A%22LESSER%22%2C%22fieldName%22%3A%22DATE%22%2C%22value%22%3A1793487600000%7D%5D%7D

Fetch every page with offset until you have all total lines, then:

  • The sum of amount is the revenue incl. VAT. Subtract the sum of vatAmount for the revenue excl. VAT.
  • Refunds made in October are already in the sum as negative lines. To see sales without refunds, add { "operator": "IS_EMPTY", "fieldName": "REFUND_ID" } to the conditions.
  • To split by membership type, group the lines on membershipTypeId. The same goes for ticketTypeId, eventId and productId.
  • To get every type in one go, leave out the TYPE condition and group the lines on type.

Keep in mind:

  • Value gift cards count as revenue when they're spent. A GIFTCARD line without a membershipTypeId is a value gift card being sold, and what it's spent on later shows up as ordinary lines. Leave those GIFTCARD lines out, or that money is counted twice.
  • Membership gift cards: a membership redeemed with a gift card comes through at 0. Its money is on the GIFTCARD line from when the card was sold, which has the same membershipTypeId.
  • Booking fees on event tickets are in bookingFeeAmount, not in amount.

Example: Every line on one order

Copy
{ "operator": "EQUAL", "fieldName": "ORDER_ID", "value": "f0a52c7e-9e04-4bb4-bd38-1bb88e1dd0e4" }

Example: Tickets and event tickets sold at the tills

Copy
{ "operator": "AND", "conditions": [ { "operator": "INCLUDES", "fieldName": "TYPE", "value": ["TICKET", "EVENT_TICKET"] }, { "operator": "NOT_IS_EMPTY", "fieldName": "CASH_REGISTER_ID" } ] }

Example Response

Copy
{ "total": 2, "list": [ { "id": "5d0c8e2a-7b1f-4c3d-9e4a-6f2b1c0d9e8f", "orderId": "f0a52c7e-9e04-4bb4-bd38-1bb88e1dd0e4", "date": "2026-10-20T08:12:00.000Z", "type": "MEMBERSHIP", "grossAmount": -50000, "discountAmount": -10000, "amount": -40000, "vatAmount": -8000, "bookingFeeAmount": null, "bookingFeeVatAmount": null, "isReturn": false, "refundId": "a4b3c2d1-0e9f-4a8b-8c7d-6e5f4a3b2c1d", "refundedAt": null, "membershipTypeId": "0c1de555-6f74-4a83-91b0-0f6594306ac1", "ticketTypeId": null, "timeSlotId": null, "eventId": null, "eventTicketTypeId": null, "productId": null, "cashRegisterId": null }, { "id": "9b1c2d3e-4f5a-4b6c-8d7e-0f1a2b3c4d5e", "orderId": "f0a52c7e-9e04-4bb4-bd38-1bb88e1dd0e4", "date": "2026-10-15T10:30:00.000Z", "type": "MEMBERSHIP", "grossAmount": 50000, "discountAmount": 10000, "amount": 40000, "vatAmount": 8000, "bookingFeeAmount": null, "bookingFeeVatAmount": null, "isReturn": false, "refundId": null, "refundedAt": "2026-10-20T08:12:00.000Z", "membershipTypeId": "0c1de555-6f74-4a83-91b0-0f6594306ac1", "ticketTypeId": null, "timeSlotId": null, "eventId": null, "eventTicketTypeId": null, "productId": null, "cashRegisterId": null } ] }
‹ Previous
Get Giftcard
Next ›
List Payments