Skip to main content

Orders

TypeBase PathTrigger Name
REST resource~{realm}/orders/orders

This resource holds orders or bookings.

Endpoints

NameMethodRelative PathPayloadResponseDescription
addOrderPOST~{realm}/orders/OrderStored_OrderAdds a new order to the list.
listOrdersGET~{realm}/orders/N/AStored_Order[]Retrieves a list of orders.
getOrderGET~{realm}/orders/{id}N/AStored_OrderRetrieves a order.
putOrderPUT~{realm}/orders/{id}OrderStored_OrderReplaces a order.
updateOrderPATCH~{realm}/orders/{id}Partial_OrderStored_OrderUpdates specified order fields.
removeOrderDELETE~{realm}/orders/{id}N/AN/ADeletes a order.

Permissions

PermissionDescription
edit-ordersClient is allowed to add new orders and to modify or delete existing orders.
show-ordersClient is allowed to query the order list and to fetch individual orders.

Entities

Interface Order

namespace Order {
type State = 'requested' | 'booked' | 'active' | 'shipped' | 'fulfilled' | 'cancelled';
type Type = 'take-out';
}

interface Order {
'owner?: number;
'location': number;
'state': Order.State;
'name': string;
'type'?: Order.Type;
'description'?: string;
'resources'?: number[];
'users'?: number[];
'customers'?: number[];
'start-date'?: DateTime;
'schedules'?: string[];
'end-date'?: DateTime;
'items'?: Item[];
'auth-code'?: string;
'payments'?: Payment[];
'client-reference'?: string;
'order-reference'?: string;
'id'?: number;
'created'?: DateTime;
'updated'?: DateTime;
'deleted'?: DateTime;
'updated-by'?: number;
'updated-from'?: number;
'tags'?: string[];
'labels'?: number[];
}
PropertyData TypeDescription
ownerInt64ID of User this order belongs to.
locationInt64ID of Location this order belongs to.
stateOrder.StateThe order's state. (fulfilled and cancelled are each final states.)
nameStringThe name of the order.
typeOrder.TypeOrder type. take-out for take-out orders and null otherwise.
descriptionString?An optional description.
resourcesInt64[]?A list of Resource IDs that are reserved by this order (bookable objects).
usersInt64[]?A list of User IDs that are reserved by this order (bookable personell).
customersInt64[]?A list of Customer IDs that are associated with this order.
start-dateDateTime?A starting date when this order becomes active.
schedulesCronExpr[]?A schedule that specifies at what time this order is active (applicable only between start-date and end-date).
end-dateDateTime?An ending date when this order becomes inactive.
itemsItem[]?A list of items that is ordered (bookable products). This list is required for take-out orders.
auth-codeString?An optional authorization code that must be provided by the customer before a take-out order can be delivered.
paymentsPayment[]?If the order has been pre-paid, the Payment(s) should be specified here.
client-referenceStringA unique identifier specifying what client device was used to place the order.
order-referenceStringA unique order identifier. This value must be unique across all orders in the table and is required for take-out orders.
idInt64?The resource ID of this entity.
createdDateTime?Date and time when this entity was first created.
updatedDateTime?Date and time when this entity was last modified.
deletedDateTime?Date and time when this entity was deleted.
updated-byInt64?ID of User who last modified this entity.
updated-fromInt64?ID of Till (trusted device) which last modified this entity.
labelsInt64[]?A list of Label IDs associated with this entity.

If an order is pre-paid, the payments list should specify the Payment(s) and amounts that have been collected. Unlike payments in the journal, the amounts are always positive in orders, and gratuities negative.

For integrators, the order-reference property should reference the order in the external system, perhaps with a prefix or postfix to ensure the reference is unique across all integrations. To reduce the risk of conflicts, an order reference must be at least 24 character long.

Otherwise, the suggested format for the order-reference property is a 13-digit timestamp (milliseconds since epoch) followed by a dash and an UUID (like 1575043847811-31c36e7f-f861-43bb-a198-ae9c13074447).

Remember that orders with duplicate order-reference values will be rejected. Ensure your order references are unlikely to conflict with other integrators' orders, and use them to detect if an order has already been submitted in case of network problems.

The client-reference is optional, but can be used to identify the customer device from where the order was placed. This may use the same pattern as order-reference, or use a unique hardware ID instead of the UUID (just make sure the client-reference is generated only once and stays the same between requests).