Use the below blueprint that describes the structure of data your app receives when an onboarding step is completed.Responses#
Understanding how the Step Function returns data is crucial, especially for Synchronous Actions where the response directly influences the merchant's operation. This guide details the structure, behavior, and utility tools for handling function responses.Every Step Function is expected to return an object conforming to the Response contract.
While the structure is required for all functions, its effect on the platform varies significantly based on the execution type.| Field | Type | Required | Description |
|---|
success | boolean | Yes | Indicates if your function logic completed successfully. |
data | object | No | A payload containing data to be returned or applied to the Salla operation (used primarily for Synchronous Actions). |
error | string | No | A human-readable error message. Required if success is false for Synchronous Actions. |
status | number | No | (Optional) An HTTP status code (e.g., 200, 400). Set via the Response utility class. |
message | string | No | (Optional) An informative message. Set via the Response utility class. |
The Response utility class provides a structured way to create responses. It's particularly useful for Customer Events and some Merchant Events that require more detailed response handling.This response confirms that the onboarding step was completed successfully and allows the merchant to continue.
These onboarding handler functions act as validation and processing checkpoints. Returning Resp.success() allows the onboarding process to continue, while returning Resp.error() stops progression and displays validation feedback to the merchant.Response Utility Methods#
| Method | Description | Required | Default |
|---|
Resp.success() | Create a successful response | Yes (for success) | - |
Resp.error() | Create an error response | Yes (for errors) | - |
When to Use Response Utility vs Plain Object#
| Scenario | Recommended Approach | Reason |
|---|
| Customer Events | Response utility | Provides structured responses for tracking and analytics |
| Synchronous Actions | Plain object | Simpler and faster (performance critical) |
| Merchant Events (Simple) | Plain object | Straightforward with less overhead |
| Merchant Events (Complex) | Response utility | Better error handling and status control |
| Error Handling | Either (Response utility recommended) | Response utility provides better error structure |
Modified at 2026-02-18 17:37:29