Skip to main content

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:

ParameterTypeRequiredDescription
enactor.mfc.NoteIdStringOptionalAn 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.DisplayOnBasketbooleanOptionalA 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.DisplayOnReceiptbooleanOptionalA 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.MessageTextStringOptionalA hard-coded string (that may contain expressions) that should be added to the basket.
enactor.mfc.MessageBaseStringOptionalA message base used to resolve the message id that should be added to the basket.
enactor.mfc.MessageIdStringOptionalA message id used to resolve a message that should be added to the basket.

Output Data:

Data KeyTypeDescription
enactor.mfc.LineNumberIntegerThis will contain the line number of the newly added note.

Error Codes:

Error CodeDescription
MissingDataIf neither the message text, nor base and id, are supplied.
info

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:

ParameterTypeRequiredDescription
enactor.mfc.LineNumberIntegerRequired if NoteId is not suppliedThe line number that should be updated.
enactor.mfc.NoteIdStringRequired if LineNumber is not suppliedThe id of the note that should be updated.
enactor.mfc.MessageTextStringOptionalA hard-coded string (that may contain expressions) that should be added to the basket.
enactor.mfc.MessageBaseStringOptionalA message base used to resolve the message id that should be added to the basket.
enactor.mfc.MessageIdStringOptionalA message id used to resolve a message that should be added to the basket.

Error Codes:

Error CodeDescription
MissingDataIf neither the line number or NoteId is supplied, or neither the message text or message base and id are supplied.
InvalidLineNumberIf the line number does not exist.
UnsupportedLineIf 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:

ParameterTypeRequiredDescription
enactor.mfc.ProductCodeStringRequiredThe code for the product that should be added. This might be a product id, or a selling code.
enactor.mfc.QuantityFloatOptionalThe 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.PriceLongOptionalThe 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 KeyTypeDescription
enactor.mfc.LineNumberIntegerThis will contain the line number of the newly added product.

Error Codes:

Error CodeDescription
MissingDataIf the product code is not supplied.
InvalidProductCodeIf the product code does not exist, or cannot be sold.
InvalidQuantityIf the quantity is zero or negative, or otherwise invalid.
InvalidPriceIf the price is negative, or otherwise invalid.
info

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:

ParameterTypeRequiredDescription
enactor.mfc.LineNumberIntegerRequiredThe line number to update the quantity for.
enactor.mfc.QuantityFloatRequiredThe new quantity to assign to the line.

Error Codes:

Error CodeDescription
MissingDataIf the line number or quantity are not supplied.
InvalidLineNumberIf the line number does not exist.
InvalidQuantityIf the quantity is zero or negative, or otherwise invalid.
UnsupportedLineIf 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:

ParameterTypeRequiredDescription
enactor.mfc.LineNumberIntegerRequiredThe line number to void.
enactor.mfc.ReasonIdStringRequiredThe id of the reason that records why the line is being voided.

Error Codes:

Error CodeDescription
MissingDataIf the line number or reason are not supplied.
InvalidLineNumberIf the line number does not exist.
InvalidReasonIf the reason id does not exist in the Reason database.
UnsupportedLineIf the line associated with the given line number cannot be voided.
VoidTransactionIf the line number supplied is the last non-voided line in the basket. You should call the VoidTransaction function instead.
note

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:

ParameterTypeRequiredDescription
enactor.mfc.ReasonIdStringRequiredThe id of the reason that records why the transaction is being voided.

Error Codes:

Error CodeDescription
MissingDataIf the reason is not supplied.
InvalidReasonIf 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:

ParameterTypeRequiredDescription
enactor.mfc.CustomerNameINameRequiredThe customer name details we want to set onto the basket.

Error Codes:

Error CodeDescription
MissingDataIf the customer name is not supplied.
info

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:

ParameterTypeRequiredDescription
enactor.mfc.CustomerNameINameRequired (otherwise CustomerSurname or CustomerForename must be supplied)The customer name details we want to set onto the basket.
enactor.uc.CustomerSurnameStringOptionalThe customer surname we want to set onto the basket, if enactor.mfc.CustomerName is not given.
enactor.uc.CustomerForenameStringOptionalThe customer forename we want to set onto the basket, if enactor.mfc.CustomerName is not given.
enactor.uc.CustomerIdStringOptionalThe 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 CodeDescription
MissingDataIf none of the customer name, customer surname and customer forename are supplied.
info

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:

ParameterTypeRequiredDescription
enactor.mfc.KeyStringRequiredThe key for the additional data to assign.
enactor.mfc.ValueStringOptionalThe value to assign to the additional data.

Error Codes:

Error CodeDescription
MissingDataIf the key is not supplied.
info

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:

ParameterTypeRequiredDescription
enactor.mfc.LineNumberIntegerRequiredThe line number for the basket item to set the additional data for.
enactor.mfc.KeyStringRequiredThe key for the additional data to assign.
enactor.mfc.ValueValueOptionalThe value to assign to the additional data.

Error Codes:

Error CodeDescription
MissingDataIf the line number or key are not supplied.
InvalidLineNumberIf the line number does not exist.
info

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:

ParameterTypeRequiredDescription
enactor.mfc.OrderNumberStringRequiredThe order number that should be passed to the Order Manager to be loaded.

Error Codes:

Error CodeDescription
MissingDataIf the order number is not supplied.
NotFoundIf the order number is not found by the order manager.
NotAReservationIf the order number is found, but does not relate to a reservation.
AlreadyCollectedIf 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:

ParameterTypeRequiredDescription
enactor.customerOrder.OrderIdStringRequiredThe id of the order to assign to the basket.

Error Codes:

Error CodeDescription
MissingDataIf the order id is not supplied.
info

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:

ParameterTypeRequiredDescription
enactor.mfc.AddressIAddressAndContactRequiredThe address to use as the delivery address (with the contact details if applicable).

Error Codes:

Error CodeDescription
MissingDataIf the address information is not supplied.
NoCurrentOrderIf an order has not been started.
info

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:

ParameterTypeRequiredDescription
enactor.mfc.DeliveryInstructionsStringRequiredThe delivery instructions to assign to the order.

Error Codes:

Error CodeDescription
MissingDataIf the instructions are not supplied.
NoCurrentOrderIf an order has not been started.
info

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:

ParameterTypeRequiredDescription
enactor.mfc.ProductCodeStringRequiredThe code of the product to define the delivery option for.
enactor.mfc.DeliveryOptionIDeliveryOptionRequiredThe details for the delivery of the given product.

Error Codes:

Error CodeDescription
MissingDataIf the product code or delivery option is not supplied.
NoCurrentOrderIf 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:

ParameterTypeRequiredDescription
enactor.mfc.DeliveryChargeLongRequiredThe amount to charge, in the minimum denomination of the base currency (for example 1000 is equivalent to £10.00 when using GBP).
enactor.mfc.DeliveryChargeReferenceStringOptionalA string reference that can be associated with the delivery charge.

Output Data:

Data KeyTypeDescription
enactor.mfc.LineNumberLongThe line number of the new charge in the basket.

Error Codes:

Error CodeDescription
MissingDataIf the delivery charge is not supplied.
InvalidChargeIf the delivery charge is zero, negative, or otherwise invalid.
info

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


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 KeyTypeDescription
enactor.mfc.ProductCodeStringThe id of the product that was selected.