"Order N Pay" Method

Summary

This method allows the integrator to request to simulate the creation of an order

Request/Response Payload Models

Enumeration Values

Important Notes

The UseProviderPrices field in the OrderNPaySimulateOrderRequest 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. It is important to note that if the OrderNPaySimulateOrderRequest contains payments, then UseProviderPrices is always considered TRUE and the provider must supply pricing and totals for each product.

The ApplyAutomaticAdjustments field in the OrderNPaySimulateOrderRequest specifies that when the POS simulates the order creation, it will apply any automatic adjustments to the simulated order and they will be returned as part of the response. This is important when the provider needs to the POS to indicate what adjustments would be automatically applied on the POS and if the provider is using this as part of an Order Now Pay Now flow to determine the POS's pricing and adjustments prior to payment.

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.

SimulateOrder (Websocket Message)

Message: OrderNPayWebsocketRequest, Payload: OrderNPaySimulateOrderRequest

{
    "RequestID": "68052241-20f5-4c0e-acb3-702e81eb8869",
    "ProviderID": 12345,
    "ProviderName": "Example Provider",
    "DeviceID": "DeviceABC123",
    "UserIdentifier": "f9248a0f-ba0c-4c80-b9f2-fe020b456ce4",
    "MessageType": 13,
    "Payload": {
        "ProviderOrderID": "c8e87068-b926-4220-958e-439ac3733e87",
        "ServiceModeID": "0adc10d8-d2eb-40b9-9801-0664531f7400",
        "ServiceModeEntityID": "10",
        "ApplyAutomaticAdjustments": true,
        "UseProviderPrices": true,
        "Products": [{
                "ProviderProductID": "c3a0eadc-0711-4012-9c03-45b3c0bf668f",
                "ProductType": 0,
                "PLUIdentifier": "483928fa-8795-4a17-a480-f7c5322bdc1f",
                "SalesModifierIdentifier": null,
                "Name": "Corona",
                "SalesModifierName": null,
                "Quantity": 1,
                "Price": 3.99,
                "TotalAmount": 3.99,
                "ChildProducts": [],
                "Adjustment": null
            }, {
                "ProviderProductID": "c3a0eadc-0711-4012-9c03-000000000001",
                "ProductType": 0,
                "PLUIdentifier": "a9cc9a46-9a4d-445a-a248-838e188970c4",
                "SalesModifierIdentifier": null,
                "Name": "T-Bone Steak",
                "SalesModifierName": null,
                "Quantity": 1,
                "Price": 29.95,
                "TotalAmount": 29.95,
                "ChildProducts": [{
                        "ProviderProductID": "c3a0eadc-0711-4012-9c03-000000000002",
                        "ProductType": 0,
                        "PLUIdentifier": "ca68658f-7d6a-443e-9944-1c1e66c95b2f",
                        "SalesModifierIdentifier": null,
                        "Name": "Medium",
                        "SalesModifierName": null,
                        "Quantity": 1,
                        "Price": 0.0,
                        "TotalAmount": 0.0
                    }, {
                        "ProviderProductID": "c3a0eadc-0711-4012-9c03-000000000003",
                        "ProductType": 0,
                        "PLUIdentifier": "b554e4cf-aac5-442f-94d2-59153d1a42f7",
                        "SalesModifierIdentifier": null,
                        "Name": "Pepper Sauce",
                        "SalesModifierName": null,
                        "Quantity": 1,
                        "Price": 0.0,
                        "TotalAmount": 0.0
                    }
                ],
                "Adjustment": null
            }
        ],
        "Payments": [],
        "Adjustments": [],
        "Notes": [],
        "ServiceChargeAmount": null
    }
}

On success, the POS responds with

Message: OrderNPayWebsocketResponse, Payload: OrderNPaySimulateOrderResponse

{
    "RequestID": "68052241-20f5-4c0e-acb3-702e81eb8869",
    "ResultCode": 0,
    "ErrorMessage": null,
    "MessageType": 13,
    "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: OrderNPaySimulateOrderResponse

{
    "RequestID": "68052241-20f5-4c0e-acb3-702e81eb8869",
    "ResultCode": 6,
    "ErrorMessage": "There is insufficent stock to complete the order.",
    "MessageType": 11,
    "Payload": {
        "Order": null,
        "OutOfStockProducts": [{
                "PLUIdentifier": "483928fa-8795-4a17-a480-f7c5322bdc1f",
                "SalesModifierIdentifier": null,
                "Name": "Corona"
            }
        ]
    }
}

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
}