Orderline API Documentation

Overview

Fetch orderlines in CSV format for a set of locations in a datetime range.

The datetime range is limited to a 24 hour timespan. Querying for more than 24 hours will yield an empty result set.

Orderlines created between the two dates are returned

Extra lines will be added when an orderline is refunded or discarded. These lines are marked with order_line_status={DISCARDED, REFUNDED}, and have a negative quantity. They will also have a counter_line_id set, which is a unique id for each orderline refunded or discarded.

API

Get orderlines

Required Scope: prod/transaction
URL (single location):

https://favrit.com/ws/accounting-api-service/api/orderlines/v3/123?from-date=2023-11-01T00:00:00&to-date=2023-11-02T00:00:00
URL (all authorized locations):

https://favrit.com/ws/accounting-api-service/api/orderlines/v3?from-date=2023-11-01T00:00:00&to-date=2023-11-02T00:00:00

All dates are UTC.

Method: GET
Header: Authorization Bearer access_token

Request Sample:

curl --location --request GET 'https://favrit.com/ws/accounting-api-service/v3/api/orderlines/123?from-date=2023-11-01T00:00:00&to-date=2023-11-02T00:00:00' \
--header 'Authorization: Bearer <access_token>' \
--data-raw ''

Request Response:

HTTP/1.1 200 OK
Content-Type: text/csv;charset=UTF-8

order_reference;order_location_id;order_location_name;producer_location_id;producer_location_name;order_line_id;order_line_created_utc;order_line_updated_utc;order_line_category;order_line_status;counter_line_id;item_id;item_name;quantity;currency;amount_with_vat;vat_percentage;amount_without_vat;amount_vat;delivery_type;account_reference;account_name;section_id;section_name;order_line_type;parent_id;order_placed_by;table_number
B2Y90001;123;Demo restaurant;123;Demo restaurant;150000001;2023-11-01T14:51:53.102628;2023-11-01T14:51:53.102628;REGULAR;ORDERED;;eba678c4-c077-4ade-9972-6abc075ff67e;Demo product 1;1;NOK;215.00;0.25;172.00;43.00;PICKUP;3000;Mat;723aeafe-00cc-4d0f-9c49-0bf96ba123a8;MAIN;ORDER_LINE;some-user@example.com;1;
B2Y90001;123;Demo restaurant;123;Demo restaurant;150000002;2023-11-01T14:51:53.102628;2023-11-01T14:51:53.102628;REGULAR;ORDERED;;eba678c4-c077-4ade-9972-6abc075ff67e;Demo product 1;1;NOK;215.00;0.25;172.00;43.00;PICKUP;3000;Mat;723aeafe-00cc-4d0f-9c49-0bf96ba123a8;MAIN;ORDER_LINE;some-user@example.com;2;
B2Y90001;123;Demo restaurant;123;Demo restaurant;150000003;2023-11-01T14:51:53.102628;2023-11-01T14:51:53.102628;REGULAR;ORDERED;;eba678c4-c077-4ade-9972-6abc075ff67e;Demo product 1;1;NOK;215.00;0.25;172.00;43.00;PICKUP;3000;Mat;723aeafe-00cc-4d0f-9c49-0bf96ba123a8;MAIN;ORDER_LINE;some-user@example.com;3;

Parameters

Name Type Description Example
from-date

Date format:

yyyy-MM-ddTHH:mm:ss

Earliest orderline date in UTC 2023-11-01T00:00:00
to-date

Date format:

yyyy-MM-ddTHH:mm:ss

Latest orderline date in UTC 2023-11-02T00:00:00

Data elements returned

Column

Comment

String order_reference

All items on the same order will have the same order reference. Used to connect different order lines together.

long order_location_id

The location id where the order was placed.

String order_location_name

The location name where the order was placed.

long producer_location_id

The location id where the order was produced.

String producer_location_name

The location name where the order was produced.

long order_line_id

Unique identifier for the order line.

String order_line_created_utc

When the order line was created.

String order_line_updated_utc

When the order line was last updated.

String order_line_status

ORDERED, DISCARDED, REFUNDED.

Long counter_line_id

Unique value set when order_line_status is DISCARDED or REFUNDED.

String order_line_category

REGULAR, TIP.

String item_id

Id of the product.

String item_name

Name of the product.

int quantity

Quantity of the product.

String currency

NOK, SEK, ...

BigDecimal amount_with_vat

Amount including VAT.

BigDecimal vat_percentage

VAT percentage.

BigDecimal amount_without_vat

Amount before VAT is added.

BigDecimal amount_vat

Amount_without_vat + amount_vat is equal to amount_with_vat.

String delivery_type

COUNTER, TABLE, ...

String account_reference

The accounting system reference for the item category.

String account_name

The accounting system name for the item category.

String section_id

Id of the section the product was ordered from in the menus.

String section_name

Name of the section the product was ordered from in the menus.

String order_line_type

ORDER_LINE or OPTION.

Long parent_id

Blank when order_line_type is ORDER_LINE, id of the parent order line when order_line_type is OPTION.

String order_placed_by

username of the logged in user placing the order. null for self service orders.

String table_number

The table number where the order was placed. Empty when not applicable.