UC API - Functions
This section lists the standard Enactor UC functions which are available from the prompts listed above. A function may produce output data when it has completed, this will be made available as an item of data in the prompt. It is also possible for a function to produce an error code. In that case an item with the name enactor.mfc.ErrorCode will be added to the prompt (this will be automatically cleared each time a function is executed).
enactor.uc.Close
This function has a different effect, depending upon the prompt currently being displayed. It will typically close the prompt and return to the previous screen. Consult the documentation on the prompts for details on the effect of this function.
Parameters: None
enactor.uc.Tender
This function will close the currently displayed prompt and navigate to the tender prompt.
Parameters: None
enactor.uc.AddNote
This function will accept a string or message id and record that in the basket. This can then be displayed on the basket, or receipt.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.NoteId | String | Optional | An optional identifier for this note. This may be used to refer to the note when printing receipts or to display the note in a particular area of the screen. |
enactor.mfc.DisplayOnBasket | boolean | Optional | A boolean that, if true, will cause the note to be displayed by the standard basket display - in the order in which it was added to the basket. If not supplied, this will default to false if the NoteId is specified, or true otherwise. |
enactor.mfc.DisplayOnReceipt | boolean | Optional | A boolean that, if true, will cause the note to be displayed by the standard receipts - in the order in which it was added to the basket. If not supplied, this will default to false if the NoteId is specified, or true otherwise. |
enactor.mfc.MessageText | String | Optional | A hard-coded string (that may contain expressions) that should be added to the basket. |
enactor.mfc.MessageBase | String | Optional | A message base used to resolve the message id that should be added to the basket. |
enactor.mfc.MessageId | String | Optional | A message id used to resolve a message that should be added to the basket. |
Output Data:
| Data Key | Type | Description |
|---|---|---|
enactor.mfc.LineNumber | Integer | This will contain the line number of the newly added note. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If neither the message text, nor base and id, are supplied. |
It is possible to pass both a message text and a message base and id. In that case the display will decide which to display.
enactor.uc.UpdateNote
This function will update the message currently held by an existing note on the basket.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.LineNumber | Integer | Required if NoteId is not supplied | The line number that should be updated. |
enactor.mfc.NoteId | String | Required if LineNumber is not supplied | The id of the note that should be updated. |
enactor.mfc.MessageText | String | Optional | A hard-coded string (that may contain expressions) that should be added to the basket. |
enactor.mfc.MessageBase | String | Optional | A message base used to resolve the message id that should be added to the basket. |
enactor.mfc.MessageId | String | Optional | A message id used to resolve a message that should be added to the basket. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If neither the line number or NoteId is supplied, or neither the message text or message base and id are supplied. |
InvalidLineNumber | If the line number does not exist. |
UnsupportedLine | If the line number does not relate to a note. |
enactor.uc.SellProduct
This function allows you to sell a product using the standard Enactor sell product process.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.ProductCode | String | Required | The code for the product that should be added. This might be a product id, or a selling code. |
enactor.mfc.Quantity | Float | Optional | The quantity of the item to add to the basket item. If this is not supplied, it will either default to one, or prompt for a quantity if product has been so configured. |
enactor.mfc.Price | Long | Optional | The unit price for the product, in the minimum denomination of the currency (for example 1000 is equivalent to £10.00 when using GBP). If this is not supplied, the price will be loaded from the Enactor Product Price Database. |
Output Data:
| Data Key | Type | Description |
|---|---|---|
enactor.mfc.LineNumber | Integer | This will contain the line number of the newly added product. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the product code is not supplied. |
InvalidProductCode | If the product code does not exist, or cannot be sold. |
InvalidQuantity | If the quantity is zero or negative, or otherwise invalid. |
InvalidPrice | If the price is negative, or otherwise invalid. |
Supplying a quantity and/or price will suppress any prompts that the product may be configured to display. However if the product triggers any other prompts, for example Cashier Age Restriction, these will be displayed as normal.
Once the function has completed, the transaction will have been updated with a new basket item holding the product being sold.
enactor.uc.UpdateQuantity
This function allows you to update the quantity on an existing line of the basket.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.LineNumber | Integer | Required | The line number to update the quantity for. |
enactor.mfc.Quantity | Float | Required | The new quantity to assign to the line. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the line number or quantity are not supplied. |
InvalidLineNumber | If the line number does not exist. |
InvalidQuantity | If the quantity is zero or negative, or otherwise invalid. |
UnsupportedLine | If the quantity on the line number supplied cannot be modified. |
enactor.uc.VoidItem
This function allows you to void an existing line of the basket.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.LineNumber | Integer | Required | The line number to void. |
enactor.mfc.ReasonId | String | Required | The id of the reason that records why the line is being voided. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the line number or reason are not supplied. |
InvalidLineNumber | If the line number does not exist. |
InvalidReason | If the reason id does not exist in the Reason database. |
UnsupportedLine | If the line associated with the given line number cannot be voided. |
VoidTransaction | If the line number supplied is the last non-voided line in the basket. You should call the VoidTransaction function instead. |
It is not possible to void the last item in a transaction - you must use VoidTransaction if you want to void the last item.
enactor.uc.VoidTransaction
This function allows you to void a basket. The basket can contain any number of non-voided items.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.ReasonId | String | Required | The id of the reason that records why the transaction is being voided. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the reason is not supplied. |
InvalidReason | If the reason id does not exist in the Reason database. |
enactor.uc.SetCustomerName
This function allows you to set the customer name onto the basket. This will not attempt to load an associated Enactor customer record.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.CustomerName | IName | Required | The customer name details we want to set onto the basket. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the customer name is not supplied. |
If there is an existing customer on the basket, any existing details are replaced.
enactor.uc.SetCustomer
This function allows you to set the customer name and customer number onto the basket. This will not attempt to load an associated Enactor customer record.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.CustomerName | IName | Required (otherwise CustomerSurname or CustomerForename must be supplied) | The customer name details we want to set onto the basket. |
enactor.uc.CustomerSurname | String | Optional | The customer surname we want to set onto the basket, if enactor.mfc.CustomerName is not given. |
enactor.uc.CustomerForename | String | Optional | The customer forename we want to set onto the basket, if enactor.mfc.CustomerName is not given. |
enactor.uc.CustomerId | String | Optional | The customer number we want to set onto the basket. If not given then the customer number is not changed. If a blank string then the customer number is cleared. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If none of the customer name, customer surname and customer forename are supplied. |
If there is an existing customer name on the basket, any existing details are replaced.
enactor.uc.SetBasketAdditionalData
This function allows you to assign arbitrary data to be held on the basket.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.Key | String | Required | The key for the additional data to assign. |
enactor.mfc.Value | String | Optional | The value to assign to the additional data. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the key is not supplied. |
If the key already has a value assigned, it will be replaced. If the value is not supplied, is null or is otherwise empty, then the data item will be removed from the basket.
enactor.uc.SetBasketItemAdditionalData
This function allows you to assign arbitrary data to be held against an item in the basket.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.LineNumber | Integer | Required | The line number for the basket item to set the additional data for. |
enactor.mfc.Key | String | Required | The key for the additional data to assign. |
enactor.mfc.Value | Value | Optional | The value to assign to the additional data. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the line number or key are not supplied. |
InvalidLineNumber | If the line number does not exist. |
If the key already has a value assigned on that item it will be replaced. If the value is not supplied, is null or is otherwise empty, then the data item will be removed from the basket item.
enactor.uc.LoadReservation
This function will accept an Order Number and call the Order Manager to attempt to load the associated reservation. The reservation will then be added to the basket.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.OrderNumber | String | Required | The order number that should be passed to the Order Manager to be loaded. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the order number is not supplied. |
NotFound | If the order number is not found by the order manager. |
NotAReservation | If the order number is found, but does not relate to a reservation. |
AlreadyCollected | If the order number is found, and is a reservation, but it has already been collected. |
enactor.uc.SetOrderNumber
This function allows you to set an order id onto the basket. If an order has not been started, it will be started as a part of calling this function.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.customerOrder.OrderId | String | Required | The id of the order to assign to the basket. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the order id is not supplied. |
If there is an existing order id assigned to the basket it will be replaced.
enactor.uc.SetOrderDeliveryAddress
This function can be used to set the delivery address for an order. An order must have been started before this function can be called.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.Address | IAddressAndContact | Required | The address to use as the delivery address (with the contact details if applicable). |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the address information is not supplied. |
NoCurrentOrder | If an order has not been started. |
If the order already has a delivery address, this will be replaced.
enactor.uc.SetOrderDeliveryInstructions
This function can be used to set the delivery instructions on an order. An order must have been started before this function can be called.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.DeliveryInstructions | String | Required | The delivery instructions to assign to the order. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the instructions are not supplied. |
NoCurrentOrder | If an order has not been started. |
If the order already has delivery instructions, they will be replaced.
enactor.uc.SetDeliveryOptionForProduct
This function allows you to specify what delivery option to use to order a given product. An order must have been started before this function can be called.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.ProductCode | String | Required | The code of the product to define the delivery option for. |
enactor.mfc.DeliveryOption | IDeliveryOption | Required | The details for the delivery of the given product. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the product code or delivery option is not supplied. |
NoCurrentOrder | If an order has not been started. |
Once the function has been completed, the delivery details will be available on the transaction.
enactor.uc.AddOrderDeliveryCharge
This function allows you to add a delivery charge to the basket.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
enactor.mfc.DeliveryCharge | Long | Required | The amount to charge, in the minimum denomination of the base currency (for example 1000 is equivalent to £10.00 when using GBP). |
enactor.mfc.DeliveryChargeReference | String | Optional | A string reference that can be associated with the delivery charge. |
Output Data:
| Data Key | Type | Description |
|---|---|---|
enactor.mfc.LineNumber | Long | The line number of the new charge in the basket. |
Error Codes:
| Error Code | Description |
|---|---|
MissingData | If the delivery charge is not supplied. |
InvalidCharge | If the delivery charge is zero, negative, or otherwise invalid. |
This will not replace any existing delivery charges that are already on the basket.
enactor.uc.CaptureCustomer
This function allows you to display the standard Enactor Customer Capture prompts. Once the prompt has completed, the customer will be set onto the transaction.
Parameters: None
enactor.uc.ProductSearch
This function allows you to display the standard Enactor Product Search prompt. The selected product will be returned as output data.
Parameters: None
Output Data:
| Data Key | Type | Description |
|---|---|---|
enactor.mfc.ProductCode | String | The id of the product that was selected. |