Payee Tax Profile Component

Rendering the Component

Authenticate and style this component by importing and calling the renderPayeeTaxProfile function from the Abound Client SDK. This function will render the “Payee Tax Profile” Drop-In UI component in your app.

Javascript
1<html>
2 <head>
3 <title>My App</title>
4 </head>
5 <body>
6 <div id="abound-ui-wrapper"></div>
7 <script type="module">
8 import { renderPayeeTaxProfile } from "https://js.withabound.com/latest-v3-minor/abound-client-sdk.js";
9
10 // define your custom styles object
11 const styles = {}; // see the styling guide for more information
12
13 // define your callbacks
14 const onReady = () => {
15 console.log("do something when the drop-in is initalized")
16 }
17
18 const onSubmit = () => {
19 console.log("do something when the a new tax profile has been submitted and wating for a response")
20 }
21
22 const onSubmitSuccess = (response) => {
23 const { documentType, documentId } = response;
24 // documentType: FORM_W_9, FORM_W_8BEN, FORM_W_8BEN_E
25 console.log("do something when the a new tax profile has been successfully submitted")
26 }
27
28 const onSubmitError = (error) => {
29 console.log("do something when submitting a tax profile encounters an unexpected error")
30 }
31
32 // render drop-in component
33 renderPayeeTaxProfile({
34 accessToken: "accessToken_sampleeyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2OTY5ODczNTcsImV4cCI6MTY5Njk4NzY1NywiYXVkIjoiYXBwSWRfc2FtcGxlcU5oVmNkWVFZVSIsImlzcyI6Imh0dHBzOi8vc2FuZGJveC1hcGkud2l0aGFib3VuZC5jb20vdjQiLCJzdWIiOiJ1c2VySWRfc2FtcGxlWEdNRm5oT3BlUiJ9.-NrPVQvsnM8vJouyuP5yeFGlYb1xGgR-gS3v87p5BQk",
35 targetId: "abound-ui-wrapper",
36 styles,
37 onReady,
38 onSubmit,
39 onSubmitSuccess,
40 onSubmitError
41 });
42 </script>
43 </body>
44
45</html>

Render Properties

The following properties are available to passed into the renderPayeeTaxProfile function:

Property
Description
onReady
(optional, function)
Callback function executed when the component has initialized.
onSubmit
(optional, function)
Callback function executed when the component is submitted and before any error or success event.
onSubmitError
(optional, function)
Callback function executed when the component errors during submission.
onSubmitSuccess
(optional, function)
Callback function executed when the component is successfully submitted. Responds with an object with information about the generated document that is of type: { documentType: 'FORM_W_9', 'FORM_W_8BEN', 'FORM_W_8BEN_E'; documentId: string}
accessToken
(required, string)
The token used to authenticate communication between the client and Abound. Optionally has userId context.
targetId
(required, string)
The value of a node’s id attribute where the UI will be rendered.
styles
(required, object)
A nested object of styling definitions to match the component with your own brand.

Customizations

There are several custom options available to customize the appearance of the “Payee Tax Profile” component. Unlike, the properties defined at render, these customizations are defined at the time of accessToken creation nested under the customizations.payeeTaxProfile key.

Property
d
Description
shouldPreloadFromUserId
(optional, boolean)
Determines if Abound should preload the Payee Tax Profile by userId lookup. Default is true.
shouldCollectElectronicDeliveryConsent
(optional, boolean)
Determines if the electronic delivery consent question should be asked in the Payee Tax Profile component. Default is true.
supportedTaxForms
(optional, array)
A list of the forms your organizaton intends to support and collect during a Payee Tax Profile submission. Default is all forms: ["FORM_W_9", "FORM_W_8BEN", "FORM_W_8BEN_E"].
defaults
(optional, object)
Used to preload the Payee Tax Profile with default values. These defaults will be ignored if data is preloaded by userId.
requestingPayer
(optional, object)
If supplied, a Payee Tax Profile submission that creates a Form W-9 will attach this information as the Payer.
Example accessToken request payload w/ customizations
1{
2 "expiresIn": 300,
3 "userId": "userId_sampleXGMFnhOpeR",
4 "customizations": {
5 "payeeTaxProfile": {
6 "shouldPreloadFromUserId": false,
7 "shouldCollectElectronicDeliveryConsent": false,
8 "supportedTaxForms": ["FORM_W_9", "FORM_W_8BEN", "FORM_W_8BEN_E"],
9 "defaults": {
10 "firstName": "Ada",
11 "lastName": "Lovelace",
12 "businessName": "Computer Consulting LLC",
13 "dateOfBirth": "1980-01-12",
14 "address": "456 Daisy Dr.",
15 "address2": "Apt. 12",
16 "city": "Anoka",
17 "state": "MN",
18 "postalCode": "00000",
19 "country": "US",
20 "email": "example@withabound.com"
21 },
22 "requestingPayer": {
23 "name": "Payer Inc.",
24 "tin": "111111111",
25 "address": "123 Main St.",
26 "address2": "Suite 120",
27 "city": "Anoka",
28 "state": "MN",
29 "postalCode": "11111",
30 "country": "US",
31 "phoneNumber": "+15555555555"
32 }
33 }
34 }
35}

Data Prepopulation

There are two ways to prepopulate the Payee Tax Profile component:

1. Preload from the Previous Submission

If you included a userId when creating the accessToken, the component will automatically display (if available) the latest available W-9/W-8 information previously submitted by that User. This behavior can be turned off by setting payeeTaxProfileOptions.shouldPreloadFromUserId to false when creating the accessToken.

2. Preload from Default Values

If you include the payeeTaxProfileOptions.defaults object when creating an accessToken, the component will prepopulate select form fields with this data.

Ignoring Defaults

Defaults will only apply if a previous Payee Tax Profile submission was not found during a userId lookup or if payeeTaxProfileOptions.shouldPreloadFromUserId is set to false.

Here is an example of how to structure the payeeTaxProfileOptions.defaults object:

Example 'defaults' object
1{
2 firstName: "Ada",
3 lastName: "Lovelace",
4 businessName: "Computer Consulting LLC",
5 dateOfBirth: "1980-01-12",
6 address: "456 Daisy Dr.",
7 address2: "Apt 12",
8 city: "Anoka",
9 state: "MN",
10 postalCode: "00000",
11 country: "US",
12 email: "example@withabound.com"
13}