"Order N Pay" Method
Summary
This method allows the integrator to request to create a new unpaid order
Request/Response Payload Models
Enumeration Values
- MessageType - OrderNPayMessageType
- ProductType - OrderNPayProductType
- ResultCode - OrderNPayResultCode
Important Notes
The UseProviderPrices field in the OrderNPayCreateOrderRequest 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 OrderNPayCreateOrderRequest contains payments, then UseProviderPrices is always considered TRUE and the provider must supply pricing and totals for each product.
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.
CreateOrder (Websocket Message)
A simple order with parent and child products. Prices are not supplied as the UseProviderPrices is false, meaning the POS will resolve the pricing. There is also a custom message attached as a child (the "sauce on side" child product)
Message: OrderNPayWebsocketRequest, Payload: OrderNPayCreateOrderRequest
{
"RequestID": "1f98832f-aa02-4434-8d10-5f8b4e73cabf",
"ProviderID": 90210,
"ProviderName": "UnitTests",
"DeviceID": "DeviceABC123",
"UserIdentifier": "f9248a0f-ba0c-4c80-b9f2-fe020b456ce4",
"MessageType": 11,
"Payload": {
"ProviderOrderID": "c8e87068-b926-4220-958e-439ac3733e87",
"IsTraining": false,
"ServiceModeID": "0adc10d8-d2eb-40b9-9801-0664531f7400",
"ServiceModeEntityID": "10",
"ServiceChargeAmount": null,
"UseProviderPrices": false,
"Products": [
{
"ProviderProductID": "c3a0eadc-0711-4012-9c03-45b3c0bf668f",
"ProductType": 0,
"PLUIdentifier": "401",
"SalesModifierIdentifier": "07c8fd3e-6331-4646-99b2-b4ef3486fb19",
"Name": "Corona",
"SalesModifierName": "PINT",
"Quantity": 2,
"Price": 0,
"TotalAmount": 0,
"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": 0,
"TotalAmount": 0,
"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,
"TotalAmount": 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,
"TotalAmount": 0
}, {
"ProviderProductID": "c3a0eadc-0711-4012-9c03-000000000004",
"ProductType": 0,
"PLUIdentifier": "711336b0-262c-4701-bea8-c554fc5ebd72",
"SalesModifierIdentifier": null,
"Name": "Side Salad",
"SalesModifierName": null,
"Quantity": 1,
"Price": 0,
"TotalAmount": 0
}, {
"ProviderProductID": "c3a0eadc-0711-4012-9c03-000000000005",
"ProductType": 0,
"PLUIdentifier": "57fd9855-c860-4330-8476-4933d96dbfbc",
"SalesModifierIdentifier": null,
"Name": "Balsamic",
"SalesModifierName": null,
"Quantity": 1,
"Price": 0,
"TotalAmount": 0
}, {
"ProviderProductID": "c3a0eadc-0711-4012-9c03-000000000006",
"ProductType": 1,
"PLUIdentifier": null,
"SalesModifierIdentifier": null,
"Name": "sauce on side",
"SalesModifierName": null,
"Quantity": 0,
"Price": 0,
"TotalAmount": 0
}
],
"Adjustment": null
}
],
"Payments": [],
"Adjustments": [],
"Notes": []
}
}
On success, the POS responds with
Message: OrderNPayWebsocketResponse, Payload: OrderNPayCreateOrderResponse
{
"RequestID": "1f98832f-aa02-4434-8d10-5f8b4e73cabf",
"ResultCode": 0,
"ErrorMessage": null,
"MessageType": 11,
"Payload": {
"Order": {
"SalesTransactionID": "557f5239-f3cc-4de1-9120-b53f2d1c6fb3",
"ServiceModePrefix": "TBL",
"ServiceModeEntityID": "10",
"OrderNumberOpened": "PSVR0001",
"OwnedBy_UserID": "f9248a0f-ba0c-4c80-b9f2-fe020b456ce4",
"OwnedBy_UserName": "PayAtTable User",
"CurrencyCode": "GBP",
"Amount": 40.45,
"AmountOwing": 47.19,
"IsClosed": false,
"RemainingServiceChargeAmount": 6.74,
"Products": [
{
"ProviderProductID": null,
"ProductType": 0,
"PLUIdentifier": "cc0c93fd-7268-4252-b792-171a37e32696",
"SalesModifierIdentifier": "07c8fd3e-6331-4646-99b2-b4ef3486fb19",
"Name": "Corona",
"SalesModifierName": "PINT",
"Quantity": 2,
"Price": 7.00,
"TotalAmount": 14.00
},
{
"ProviderProductID": null,
"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": null,
"ProductType": 0,
"PLUIdentifier": "ca68658f-7d6a-443e-9944-1c1e66c95b2f",
"SalesModifierIdentifier": null,
"Name": "Medium",
"SalesModifierName": null,
"Quantity": 1,
"Price": 0,
"TotalAmount": 0
}, {
"ProviderProductID": null,
"ProductType": 0,
"PLUIdentifier": "b554e4cf-aac5-442f-94d2-59153d1a42f7",
"SalesModifierIdentifier": null,
"Name": "Pepper Sauce",
"SalesModifierName": null,
"Quantity": 1,
"Price": 0,
"TotalAmount": 0
}, {
"ProviderProductID": null,
"ProductType": 0,
"PLUIdentifier": "711336b0-262c-4701-bea8-c554fc5ebd72",
"SalesModifierIdentifier": null,
"Name": "Side Salad",
"SalesModifierName": null,
"Quantity": 1,
"Price": 1.00,
"TotalAmount": 1.00
}, {
"ProviderProductID": null,
"ProductType": 0,
"PLUIdentifier": "57fd9855-c860-4330-8476-4933d96dbfbc",
"SalesModifierIdentifier": null,
"Name": "Balsamic",
"SalesModifierName": null,
"Quantity": 1,
"Price": 0,
"TotalAmount": 0
}, {
"ProviderProductID": null,
"ProductType": 1,
"PLUIdentifier": null,
"SalesModifierIdentifier": null,
"Name": "sauce on side",
"SalesModifierName": null,
"Quantity": 0,
"Price": 0,
"TotalAmount": 0
}
],
"Adjustment": null
}
],
"Payments": [],
"Adjustments": [{
"ProviderAdjustmentID": null,
"AdjustmentID": "f43fadb5-a26b-423c-942c-017c23384501",
"Amount": -4.50,
"Name": "10% Discount"
}
],
"Notes": [],
"Taxes": [{
"Name": "VAT",
"Amount": 3.68,
"TaxRate": 10.000,
"IsAddOnTax": false
}
]
},
"OutOfStockProducts": null
}
}
On failure such as an insufficient stock, the POS may respond with
Message: OrderNPayWebsocketResponse, Payload: OrderNPayCreateOrderResponse
{
"RequestID": "1f98832f-aa02-4434-8d10-5f8b4e73cabf",
"ResultCode": 6,
"ErrorMessage": "There is insufficent stock to complete the order.",
"MessageType": 11,
"Payload": {
"Order": null,
"OutOfStockProducts": [{
"PLUIdentifier": "c3a0eadc-0711-4012-9c03-45b3c0bf668f",
"SalesModifierIdentifier": null,
"Name": "Corona"
}
]
}
}
The 3rd party submits a request to create a fully paid order. UseProviderPrices needs to be true and prices must be supplied since payments are being made which ensures balancing between items and payments.
Message: OrderNPayWebsocketRequest, Payload: OrderNPayCreateOrderRequest
{
"RequestID": "28f4ff56-7015-4731-a770-7093e1471531",
"ProviderID": 12345,
"ProviderName": "Example Provider",
"DeviceID": "DeviceABC123",
"UserIdentifier": "f9248a0f-ba0c-4c80-b9f2-fe020b456ce4",
"MessageType": 11,
"Payload": {
"ProviderOrderID": "c8e87068-b926-4220-958e-439ac3733e87",
"IsTraining": false,
"ServiceModeID": "0adc10d8-d2eb-40b9-9801-0664531f7400",
"ServiceModeEntityID": "10",
"UseProviderPrices": true,
"ServiceChargeAmount": 1.50,
"Products": [{
"ProviderProductID": "c3a0eadc-0711-4012-9c03-45b3c0bf668f",
"ProductType": 0,
"PLUIdentifier": "5e132381-8723-4f38-9483-6265bced2f96",
"SalesModifierIdentifier": null,
"Name": "Garlic Bread",
"SalesModifierName": null,
"Quantity": 2,
"Price": 5.0,
"TotalAmount": 10.0,
"ChildProducts": [],
"Adjustment": null
}, {
"ProviderProductID": "83AF1083-669C-4664-A758-243FC0EE0C0A",
"ProductType": 0,
"PLUIdentifier": "02f3b881-f675-4913-a0d0-1571dbf24aff",
"SalesModifierIdentifier": null,
"Name": "Creamy Pasta",
"SalesModifierName": null,
"Quantity": 1,
"Price": 13.99,
"TotalAmount": 13.99,
"ChildProducts": [],
"Adjustment": null
}
],
"Payments": [{
"ProviderPaymentID": "a5f08eb7-fe8b-41b8-8bf6-67750476137e",
"AmountSale": 23.99,
"AmountTip": 0.50,
"AmountSurcharge": 0,
"Name": "Card Machine",
"ExplicitServiceChargeAmount": 1.50,
"MerchantID": null,
"TerminalID": null
}
],
"Adjustments": [],
"Notes": []
}
}
The 3rd party submits a request to create an order with a modified item (PINT) and a note for the overall order
Message: OrderNPayWebsocketRequest, Payload: OrderNPayCreateOrderRequest
{
"RequestID": "3d16f934-bbcc-47bf-b867-dd94408380c2",
"ProviderID": 12345,
"ProviderName": "Example Provider",
"DeviceID": "DeviceABC123",
"UserIdentifier": "f9248a0f-ba0c-4c80-b9f2-fe020b456ce4",
"MessageType": 11,
"Payload": {
"ProviderOrderID": "c8e87068-b926-4220-958e-439ac3733e87",
"IsTraining": false,
"ServiceModeID": "0adc10d8-d2eb-40b9-9801-0664531f7400",
"ServiceModeEntityID": "10",
"UseProviderPrices": true,
"ServiceChargeAmount": null,
"Products": [{
"ProviderProductID": "c3a0eadc-0711-4012-9c03-45b3c0bf668f",
"ProductType": 0,
"PLUIdentifier": "cc0c93fd-7268-4252-b792-171a37e32696",
"SalesModifierIdentifier": "07c8fd3e-6331-4646-99b2-b4ef3486fb19",
"Name": "Corona",
"SalesModifierName": "PINT",
"Quantity": 1,
"Price": 6.0,
"TotalAmount": 6.0,
"ChildProducts": [],
"Adjustment": null
}
],
"Payments": [],
"Adjustments": [],
"Notes": [{
"ProviderNoteID": "456b1dd7-38b3-4db2-9d5b-0aa4a1adc3c9",
"Message": "My Order Note"
}
]
}
}