"Order N Pay" Method

Summary

This method allows the integrator to request to update an existing order

Request/Response Payload Models

Enumeration Values

Important Notes

The UseProviderPrices field in the OrderNPayUpdateOrderRequest payload is used to indicate whether the POS should use the prices and total provided in the request for each product, or whether the POS should calculate its own prices/totals based on the service mode, price scheme and currently active price schedule. When UseProviderPrices is false, the product Price and TotalAmount field can be zero. When UseProviderPrices is true, the product Price and TotalAmount field must be set to the expected price/total.

The Adjustment field in the products record is used to apply a single discount/surcharge specifically to that product instance. The Adjustments field in the main OrderNPayCreateOrderRequest is used to apply one or more order level discounts/surcharges to the order. It should be noted that if AdjustmentID is null in the OrderNPayAdjustment record, the POS will use its fallback adjustment to perform the required action. A null AdjustmentID would typically only be used if the provider is applying their own discounts/surcharges to the order and not using the POS ones.

UpdateOrder (Websocket Message)

Message: OrderNPayWebsocketRequest, Payload: OrderNPayUpdateOrderRequest

{
    "RequestID": "2ad7fb00-5b69-424c-8810-05c0bec7b640",
    "ProviderID": 12345,
    "ProviderName": "Example Provider",
    "DeviceID": "DeviceABC123",
    "UserIdentifier": "f9248a0f-ba0c-4c80-b9f2-fe020b456ce4",
    "MessageType": 12,
    "Payload": {
        "ProviderOrderID": "c8e87068-b926-4220-958e-439ac3733e87",
        "SalesTransactionID": "a60fba87-58ec-4b12-b71c-57572036c6bc",
        "UseProviderPrices": true,
        "Products": [{
                "ProviderProductID": "c3a0eadc-0711-4012-9c03-45b3c0bf668f",
                "ProductType": 0,
                "PLUIdentifier": "cc0c93fd-7268-4252-b792-171a37e32696",
                "SalesModifierIdentifier": "07c8fd3e-6331-4646-99b2-b4ef3486fb19",
                "Name": "Carlsberg",
                "SalesModifierName": "PINT",
                "Quantity": 2,
                "Price": 6.0,
                "TotalAmount": 12.0,
                "ChildProducts": [],
                "Adjustment": null
            }
        ],
        "Adjustments": [],
        "Notes": [],
        "ServiceChargeAmount": null
    }
}

On success, the POS responds with

Message: OrderNPayWebsocketResponse, Payload: OrderNPayUpdateOrderResponse

{
    "RequestID": "2ad7fb00-5b69-424c-8810-05c0bec7b640",
    "ResultCode": 0,
    "ErrorMessage": null,
    "MessageType": 12,
    "Payload": {
        "Order": {
            .. removed for berevity, examples can be found in CreateOrder docs ..
        },
        "OutOfStockProducts": null
    }
}

On failure such as an insufficient stock, the POS may respond with

Message: OrderNPayWebsocketResponse, Payload: OrderNPayUpdateOrderResponse

{
    "RequestID": "2ad7fb00-5b69-424c-8810-05c0bec7b640",
    "ResultCode": 6,
    "ErrorMessage": "There is insufficent stock to complete the order.",
    "MessageType": 11,
    "Payload": {
        "Order": null,
        "OutOfStockProducts": [{
                "PLUIdentifier": "cc0c93fd-7268-4252-b792-171a37e32696",
                "SalesModifierIdentifier": "07c8fd3e-6331-4646-99b2-b4ef3486fb19",
                "Name": "Carlsberg"
            }
        ]
    }
}

On failure such as an invalid SalesTransactionID, the POS may respond with

Message: OrderNPayWebsocketResponse, Payload: null

{
    "RequestID": "2ad7fb00-5b69-424c-8810-05c0bec7b640",
    "ResultCode": 4,
    "ErrorMessage": "The specified order does not exist!",
    "MessageType": 2,
    "Payload": null
}