>  Switch To Link 5 and API v2 Documentation

Callbacks

Learn how to configure callbacks in Link.

Callbacks are used in Link when a user performs one action that triggers another action.

Overview#

When Argyle Link is initialized for a new user (in other words, userToken was not specified), a new user is created just before the user tries to connect their first payroll account. This is when the onUserCreated callback is invoked with an object containing a userId and a userToken.

Whenever a user creates a new account on Link, the onAccountCreated callback is invoked with the accountId and userId parameters.

  • Store those IDs on your database and use them to retrieve the user's employment data from the Argyle API.
  • Save the user ID on your database to be able to reference the user's accounts and request their user tokens from the API.

The onAccountUpdated callback is invoked when a user updates their credentials for an existing account.

Callbacks reference#

AttributeTypeDescription
onPayDistributionSuccessfunction
optional
A callback function invoked after a successful pay distribution update flow.

This callback function provides accountId, userId, and linkItemId.
onPayDistributionErrorfunction
optional
A callback function invoked after an error occurs during the pay distribution update flow.

This callback function provides accountId, userId, and linkItemId.
onCantFindLinkItemClickedfunction
optional
An optional callback that is triggered when the user selects the Can't find your income source? button in Argyle Link.

When this callback is triggered, Link closes and the callback function receives the user's search query.

To enable this user flow, you must define the onCantFindLinkItemClicked callback in your implementation and also select the corresponding Callback experience type in Flows.
onAccountCreatedfunction
optional
A callback function invoked immediately after a user clicks connect and a new account is created. The callback will be invoked before authenticating the account with the Link item.

This callback function provides accountId, userId, and linkItemId.
onAccountConnectedfunction
optional
A callback function invoked every time a new account is successfully authenticated with a Link item, including any multi-factor authentication requests. If your linkItems list contains only one Link item, it is safe to close Argyle Link at this point.

This callback function provides accountId, userId, and linkItemId.
onAccountUpdatedfunction
optional
A callback function invoked when a user updates their account credentials.

This callback function provides accountId, userId, and linkItemId.
onAccountRemovedfunction
optional
A callback function invoked when a user removes an account.

This callback function provides accountId, userId, and linkItemId.
onUserCreatedfunction
optional
A callback function invoked when a new user is created.

This callback function provides userId and userToken. The user object is created on the first attempt of a new user to connect an account.
onErrorfunction
optional
A callback function invoked when Link encounters an internal problem that breaks the flow for the user.

This callback function provides the type of the error that occurred.

Possible values: INVALID_LINK_ITEMS, INVALID_PD_CONFIG, INVALID_LINK_KEY, INVALID_USER_TOKEN, GENERIC

For more details and troubleshooting, see Link Errors.
onAccountErrorfunction
optional
A callback function invoked every time an account fails to authenticate with a Link item.

This callback function provides accountId, userId, and linkItemId.
onClosefunction
optional
A callback function invoked immediately after the user closes Link.
onTokenExpiredfunction
optional
A callback function invoked when the userToken expires.

This callback function provides another function as a parameter, which you should call with your new userToken as an argument.

We recommend generating a new userToken every time Link is initialized for a user.
onUIEventfunction
optional
The onUIEvent callback is invoked when specific UI events are activated on Link. These event callbacks provide a data object that contains linkItemId, accountId, userID, and deepLink.

The events include:

- The user reaches the Success screen after selecting and successfully submitting the Can't find your income source? form.
- The user reaches the Success screen after successfully uploading documents.
- The user deleted documents.
- The user opened the Document Status screen after they have already uploaded documents.
- The user opened the Form Status screen after they have already submitted a form.

Also, some events have specific properties. Refer to Link Analytics to see all event-specific properties and the screen where they are activated.
onExitIntroClickedfunction
optional
(conditionally required)
This callback is associated to the secondary button on the Intro screen. Upon receiving this event, you can initiate a backup flow for your users.
onFormSubmittedfunction
optional
This callback is invoked when a user submits a form.

This callback function provides accountId and userId.
onDocumentsSubmittedfunction
optional
This callback is invoked when a user completes the document upload flow. This callback function provides accountId and userId.
Updating Argyle status...
© 2024 Argyle Systems Inc.argyle.com