Sending the Order to the POS

Step 4: Sending the order to the Point of Sale system

The order is now ready to be sent to the point of sale system. The thing to know about this process, is that the caller should expect an asynchronous response back when the order finally managed to be entered into the POS.

Point of Sale systems (POS) usually also interact with Kitchen Management Systems (KMS). The lifecycle of an order is that it first goes into the POS system and then is sent to the KMS at the appropriate time. The appropriate time is calculated based on the time it takes a meal to cook and the time the order was sent for. These parameters are configurable in the developer portal (or via the parameters of the specified fulfilment type).

To send an order to the POS

// POST to /ordering/v3/order/{orderId}/send-to-pos-async
{}

And the immediate response from this endpoint

// 202 empty

The above does not mean the order was created successfully in the POS.

In this case the response will be sent asynchronously to the endpoint you configured for the service in the developer portal. This might occur seconds, or minutes after the call to send-to-pos-async is called. An example of the payload that is sent to the endpoint is below:

Success webhook

// POST to <customer configured endpoint>
{
    "type": "SENT_TO_POS",
    "timestamp": "2017-03-14T14:59:40+00:00",
    "data": {
        "locationId": 93,
        "orderId": "00135774-2cdb-4798-91c1-01fd34e6a93b",
        "channelId": 1
    }
}
field description values
data.locationId the location this event happened at integer , eg 93
data.orderId the order this event happened for string , UUID version 4 eg "00135774-2cdb-4798-91c1-01fd34e6a93b"
data.channelId the channel in which the order was placed integer eg: 1

Failure webhook

// POST to <customer configured endpoint>
{
    "type": "FAILED_TO_SEND_TO_POS",
    "timestamp": "2017-03-14T14:59:40+00:00",
    "data": {
        "locationId": 93,
        "orderId": "00135774-2cdb-4798-91c1-01fd34e6a93b",
        "channelId": 1,
        // optional
        "error": {
            "code": "FT-STP-0001",
            "message": "The POS is an inactive state"
        }
    }
}
field description values
data.locationId the location this event happened at integer , eg 93
data.orderId the order this event happened for string , UUID version 4 eg "00135774-2cdb-4798-91c1-01fd34e6a93b"
data.channelId the channel in which the order was placed integer eg: 1
data.error.code [ optional ] the Flyt error code string , e.g. "FT-STP-0001"
data.error.message [ optional ] a description of what the error means string , Full list in error codes and messages

Error Codes

Error codes follow a universal format. This makes sure that any error code coming from a POS always display as the same error code to consumers of our API, regardless of the POS they're integrating to.

As such, the list below constantly evolves, and as more customers request us to discriminate more and different error codes, so they can direct their users to different workflows.

Error Code Error Message
FT-STP-0001 The POS is in an inactive state and cannot accept orders.
FT-STP-0002 The POS setup is incorrect. Please check the POS setup with the site.
FT-STP-0004 The POS is currently in use and the order cannot be sent.
FT-STP-0005 We cannot know if the order went through or not.
FT-STP-UNKNOWN There was an unknown error sending the order to the POS.