Event Reference for Truv Bridge

View reference information for Truv Bridge callbacks, events, and errors.

Overview

Truv Bridge provides payload responses with user interaction data. Find information for Truv Bridge responses below.

  • Callbacks - Responses for specific Truv Bridge actions
  • Event data - Event type and payload descriptions
  • Errors - Truv Bridge error objects, types, and codes

Callbacks

The functions in this table cover specific actions.

CallbackDescriptionRequired
onSuccessUser has successfully connected to a payroll provider and closed Bridge, function expects two arguments, the public_token and a metadata objectrequired
onLoadTruv Bridge has finished loadingoptional
onEventSpecific event occurs with Truv Bridge, see Event dataoptional
onCloseTruv Bridge closesoptional

Event data

The sections below cover values and descriptions for events within Truv Bridge.

onEvent types

These event types are for specific actions occurring within Truv Bridge.

Event TypeEvent PayloadDescription
LOADNoneTruv Bridge module finished loading
OPENCommonEventDataTruv Bridge is ready
SCREEN_VIEWScreenViewDataTruv Bridge screen viewed
EMPLOYER_SELECTEDEmployerSelectedDataEmployer selected in Truv Bridge
DOC_UPLOAD_OPENEDCommonEventDataDocument Upload opened
DOCUMENTS_UPLOADEDDocumentsUploadedDataSpecific document types uploaded
LINK_CREATEDTaskDataUser logging in to their payroll provider as a new Link
LOGIN_COMPLETEDTaskDataUser successfully logged in to payroll provider
SUCCESSTaskDataUser data successfully retrieved from payroll provider
ERRORErrorDataError during the payroll provider connection process
UNSUPPORTED_BROWSERNoneTruv Bridge is not supported by the user's browser
CLOSECloseDataTruv Bridge closes

CommonEventData

The values in the table below are for general Truv Bridge use.

NameTypeDescription
bridge_tokenstringThe bridge_token value passed to TruvBridge.init
product_typestringType of product, can be undefined if bridge_token is expired

CommonEventData example response

View the JSON object sample response below for CommonEventData.

{
    "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
    "product_type": "income",
}

ScreenViewData

This table has data for the Truv Bridge screen events.

NameTypeDescription
view_namestringName of Truv Bridge screen viewed
Possible values: SELECT_EMPLOYER, PROVIDER_LIST, PROVIDER_LOGIN, PROVIDER_ORG_ID, ERROR, SUCCESS, DOC_UPLOAD, DOC_UPLOAD_TYPES
bridge_tokenstringValue for bridge_token passed to TruvBridge.init
product_typestringType of product
doc_typestringApplicable for only DOC_UPLOAD view name, type of documents to upload, can be paystub, w2 or f1099
{
  	"view_name": "PROVIDER_LOGIN",
    "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
    "product_type": "income"
}

EmployerSelectedData

This data is for events during the employer selection process.

NameTypeDescription
bridge_tokenstringValue for bridge_token  passed to TruvBridge.init
product_typestringType of product
employerobjectObject with employer data, contains employer's name

EmployerSelectedData example response

The sample JSON object below is for EmployerSelectedData.

{
    "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
    "product_type": "income",
    "employer": {
        "name": "Facebook Demo"
    }
}

DocumentsUploadedData

The table below covers events from uploading documents.

NameTypeDescription
bridge_tokenstringValue for bridge_token passed to TruvBridge.init
product_typestringType of product
doc_typestringType of document uploaded, can be paystub, w2 or f1099

DocumentsUploadedData example response

The JSON object below is a sample response.

{
    "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
    "product_type": "income",
    "doc_type": "paystub"
}

TaskData

The values in the table below cover events from Tasks.

NameTypeDescription
public_tokenstringValue for public_token exchanged for access_token
task_idstringUnique identifier to use Link when attempting to retrieve payroll data
NOTE: include identifier value for support tickets
bridge_tokenstringValue for bridge_token passed to TruvBridge.init
product_typestringType of product
employerobjectEmployer data object, contains employer's name, may be undefined for admin product type
provider_idstringUnique identifier for selected provider

TaskData example response

View the JSON object below for a sample response.

{
    "public_token": "d80ec8255dc54c5eb7cc03ac05d18ebd",
    "task_id": "2b0e7a7dec1d47678fec4e02af621cc0",
    "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
    "product_type": "income",
    "provider_id": "adp",
    "employer": {
      "name": "Facebook Demo"
    }
}

ErrorData

Values in the table below are responses for errors.

NameTypeDescription
errorErrorSee Errors section for reference
public_tokenstringAssociated public_token to connection attempt
NOTE: This field is only available if the error returned is associated to a public_token.
task_idstringUnique identifier associated with attempt to use Link to retrieve payroll data
NOTE: Include this identifier when opening a support ticket for additional support.
bridge_tokenstringValue for bridge_token passed to TruvBridge.init
product_typestringType of the product
{
    "error": {
        "error_code": "LOGIN_ERROR",
        "error_message": "Username or password is incorrect",
        "error_type": "LINK_ERROR"
    },
    "public_token": "d80ec8255dc54c5eb7cc03ac05d18ebd",
    "task_id": "5ad1938450c54024bbc967a3a7dc9020",
    "bridge_token": "b5cb1933e43043a792a9b337af5824e2",
    "product_type": "income"
}

CloseData

This value is for the Truv Bridge closing.

NameTypeDescription
employerobjectObject with employer data, contains employer's name, can be undefined if no employer was selected
{
   "employer": {
        "name": "Facebook Demo"
    }
}

Errors

Below view the error codes for Truv Bridge. Truv Bridge values return as a callback.

{
    "error": {
        "error_code": "LOGIN_ERROR",
        "error_message": "Username or password is incorrect",
        "error_type": "LINK_ERROR"
    }
}

📘

Tip

Design your user experience to notify your users of login errors when connecting to payroll.

Error object

The table below contains information about the error objects.

NameTypeDescription
error_typestringUnique code describing type of error that occurred
error_codestringUnique code indicating error that occurred, for more see Error codes section
error_messagestringDescription of the error that occurred

Error types

This data is for error type values.

  • LINK_ERROR - Generic error type has occurred

Error codes

These codes provide descriptions for the error.

  • ERROR - Generic error occurred
  • LINK_EXISTS - User's account is already connected
  • LOGIN_ERROR - Incorrect username, password, or both
  • MFA_ERROR - Invalid input for the multi-factor authentication
  • NO_DATA - User account has no data
  • UNAVAILABLE - Payroll provider is unreachable at the time of connection