# SCO API

What are the SCOs up to now?


Our Self Checkouts represent Whitehill's latest advancement in Self-Checkout technology. This page provides an overview of the NetworkEvent BindableEvent, and go over the JSM-ExternalAPI BindableFunction as well as JSM-BankIntegration BindableFunction.

# NetworkEvent

Located directly in the root directory of the JSM Self Checkout, it is the primary way the checkout report their states, changes, and so on.

The most basic script to get to know what the checkouts are up to is:

local NetworkEvent = script.Parent;

NetworkEvent.Event:Connect(function (Sender: string, LaneNumber: number, Command: string, Argument: any): ()
	print("JSM:", Sender, LaneNumber, Command, Argument);
end);

This will spit out all the data that is sent to the NetworkEvent, assuming the script is placed under it.

  • Sender: (string) The object sending the command, mostly "RemoteTerminal" for SCO events.
  • LaneNumber: (number) Lane number of the object sending the event.
  • Command: (string) Command to fulfill or action that was taken.
  • Argument: (any) Anything, from numbers, to tables, and strings.

# JSM-ExternalAPI

Located in the Integrations Folder, the ExternalAPI is only used to interface with the Scan & Shop.

The syntax is as follows:

workspace["JSM | SelfCheckout V3"].Integrations["JSM-ExternalAPI"]:Invoke(LaneNumber, Protocol, OEMInfo, ProductTable)
["JSM-ExternalAPI"]:Invoke(1, "SAYSData", "Whitehill", {Tool1, Tool2, Tool3})

Where Tool1, Tool2, and Tool3 are scannable JSM SCO product tools.


# JSM-BankIntegration

Located in the Integrations Folder, the BankIntegration is used for checking the users balance, allowing you to integrate the SCOs into existing banking systems.

A barebones example is as follows:

workspace["JSM | SelfCheckout V3"].Integrations["JSM-BankIntegration"].OnInvoke = function (Player: player, Amount: number): (bool)
    -- Implement balance checks here.
    
    return true
end