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 Name | Type | Description |
|---|---|---|
DATE | date | When the order was completed. On refund lines: when the refund was made |
TYPE | text | MEMBERSHIP, TICKET, EVENT_TICKET, PRODUCT, GIFTCARD or DONATION |
ORDER_ID | uuid | The order |
REFUND_ID | uuid | The refund. IS_EMPTY keeps the sold lines only, NOT_IS_EMPTY the refund lines only |
IS_RETURN | boolean | Returns at the till |
MEMBERSHIP_TYPE_ID | uuid | The membership type, on memberships and membership gift cards |
TICKET_TYPE_ID | uuid | The ticket type |
EVENT_ID | uuid | The event, or the date of an event series |
EVENT_TICKET_TYPE_ID | uuid | The event ticket type |
PRODUCT_ID | uuid | The product |
CASH_REGISTER_ID | uuid | The 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):
{ "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
amountis the revenue incl. VAT. Subtract the sum ofvatAmountfor 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 forticketTypeId,eventIdandproductId. - To get every type in one go, leave out the
TYPEcondition and group the lines ontype.
Keep in mind:
- Value gift cards count as revenue when they're spent. A
GIFTCARDline without amembershipTypeIdis a value gift card being sold, and what it's spent on later shows up as ordinary lines. Leave thoseGIFTCARDlines 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
GIFTCARDline from when the card was sold, which has the samemembershipTypeId. - Booking fees on event tickets are in
bookingFeeAmount, not inamount.
Example: Every line on one order
{ "operator": "EQUAL", "fieldName": "ORDER_ID", "value": "f0a52c7e-9e04-4bb4-bd38-1bb88e1dd0e4" }
Example: Tickets and event tickets sold at the tills
{ "operator": "AND", "conditions": [ { "operator": "INCLUDES", "fieldName": "TYPE", "value": ["TICKET", "EVENT_TICKET"] }, { "operator": "NOT_IS_EMPTY", "fieldName": "CASH_REGISTER_ID" } ] }
Example Response
{ "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 } ] }