Utility Functions
Helper functions or one-off functions that don't have a category yet
Utility functions are a mix of helper functions or one-off functions that don't have a category yet. They contain functions that range from helping you debug and test your API endpoint, to functions that help you enforce.
- Return - Return a result and exit the function stack.
Preconditions are useful if you want to enforce that something is true and create an error message in the event it is not true.
Set conditions that must be true If not met, the request will stop. You can also specify an error message below.

Set a custom HTTP header.

Pauses execution of the Function stack and goes to sleep. (Think of it like waiting or pausing to execute).
.png?alt=media&token=08f2940c-f435-4f0c-8b24-ab1f40ff20ab)
In this example, the Sleep function is set to pause for 5 seconds.
Gets The input from a Webhook and makes it available to use in the Function stack. For more information, see the Webhooks section.

The Get All Environment Variables function
This function will gather all environment variables of your workspace and populate a single object with them. This allows you to more quickly access your environment variables using the GET filter, instead of manually populating them where they are needed elsewhere in your function stack.

In this example, we have 3 environment variables in our workspace. By using Get All Environment Variables, we can populate all of these in a single variable for easier access.

We can then use the GET filter to access each variable. For this example, we are populating a URL parameter for an API request.
Calculate the distance between two longitude/Latitude points

Stops execution of the Function Stack at a specified point and prints out the data. (This can be advantageous when testing and debugging complex logic in the Function Stack).
.png?alt=media&token=9d65385f-99b0-475d-932d-2889f165dcc1)
In this example, the specified value for Stop & Debug to print out is the variable "merchant."
.png?alt=media&token=93aaf047-f2ae-499e-9b57-c1688c7c7413)
In this example, Stop & Debug is inserted in the Function Stack where we wish to stop execution. Additionally, the specified data is printed out at the point where execution was stopped.
Return will return a result and exit the Function Stack. Return can be especially useful with conditional logic that requires you to return something as soon as you have a certain result.

In this example, the Return function is shown in the response due to the condition that was met, despite var: result being defined in the response.
Last modified 1mo ago