RequestByUrl
RequestByUrl
This is a payee-initiated method that allows vendors, contractors, or affiliates to complete Form W-9 or W-8 on their own, using a secure URL generated by the TaxBandits API. You can embed this URL into your application/portal as an iframe.
How it works
1. OAuth 2.0 Authentication
As with any TaxBandits API call, begin by authenticating through the OAuth 2.0 flow to obtain an access token. This token must be included in the request header as a Bearer token. Refer to the OAuth 2.0 Authentication guide for details on JWT authentication and token handling.
2. Create Business
Before initiating a W-9/W-8 request, ensure at least one business (payer) has been created using the Business endpoint. This is a mandatory step.
3. Call the [POST] WhCertificate/RequestByUrl endpoint
Your request must include the following:
- Authorization Header - Include the Bearer token obtained from OAuth.
- Payee Reference (Optional) - A unique identifier for the payee (e.g., vendor ID, email, or random ID). This will be used for future references to this recipient.
- Payee Name and Address (Optional) - Pre-fills the form with payee details.
- Business Identifier (Optional) - Provide the BusinessId or TIN to identify the payer associated with the request. If omitted, the form will be tied to the first business in your account.
- DBA Reference (Optional) - Used to display a specific DBA name as the requester on the form.
- Customizations (Optional) - You may include branding customization in the request, such as logo, theme colors, etc, and the redirection URLs where you want the payee to be redirected once they submit the form. You may also include a CustomizationId if you’ve generated one. Learn more
- Languages (Optional) – Specify the language for the form. Recipients can also change their preferred language if needed. Supported languages: English, French, Spanish, German, Ukrainian and Portuguese
4. Payee completes the form
Once your request is submitted, TaxBandits will return a secure URL in the response. You can either:
- Embed this URL in your application or portal
- Share the link directly with the respective payee
Upon clicking the secure URL, the payee will be provided with the option to choose the Form W-9, W-8BEN, W-8BEN-E, or W-8ECI based on their citizenship and resident status. They can complete, e-sign, and submit the form.
5. Get notified
- Webhooks - If you’ve configured Webhooks for the event type 'WhCertificate Status Change Webhook', you will receive a webhook notification once the payee submits the form. The Webhook payload includes payee details (name, TIN, address) and a link to download the completed form. Learn more
- Status endpoint - Alternatively, you can also use the Status endpoint to retrieve the status.
- Web messaging - Instead of Webhooks, you can choose to receive notifications via web messaging. For more information, click here.
If you want to validate the TINs automatically once collected, you can set the IsTINMatching as TRUE in your request JSON.
POST WhCertificate/RequestByUrl Request Body
| Field | Type | Description |
|---|---|---|
| Requester | Object | Collects the Requestor identifier i.e., TIN or TaxBandits Business Id or PayerRef. If neither is supplied, the default Business will be assumed as the Requester. |
| PayerRef | String | Optional Unique payer identifier assigned by the client while requesting the payer information using the endpoint Business/RequestByURL. Size Range: 1-50 |
| BusinessId | Guid | Optional TaxBandits Unique Business Identifier. This ID is generated by TaxBandits after you create a business in your account using the Business endpoint. If you do not provide the BusinessId in the request, then the URL will be generated against the default business, i.e., the first business created in your account. |
| TIN | String | OptionalTaxpayer Identification Number. Use this as an alternative for BusinessId or PayerRef. Size Range: 9-11 |
| DBAId | String | OptionalUnique Identifier for the DBA. |
| DBARef | String | OptionalA Unique identifier for each DBA. This identifier can be used in future references for the DBA in the API. Size Range: 1 - 50 |
| Recipient | Object | Collects the recipient's unique identifier and other basic information of the recipient that will be pre-filled on the Form. |
| PayeeRef | String | A unique identifier for each recipient completing the Form W-9 which will be used for future reference. Size Range: 1-50 |
| FedTaxClass | String | Optional Federal tax classification of the recipient. This will be pre-filled on the Form.Allowed values"INDIVIDUAL", "SOLE_PROPRIETOR", "C_CORPORATION", "S_CORPORATION", "PARTNERSHIP", "TRUST_ESTATE", "SINGLE_MEMBER_LLC_ELECTED", "SINGLE_MEMBER_LLC_NOT_ELECTED", "LLC_C_CORPORATION", "LLC_S_CORPORATION", "LLC_P_CORPORATION" |
| String | Email address of the recipient Size Range: ..100 | |
| Name | String | Optional Recipient Name. This will be pre-filled on the Form. Size Range: ..40 |
| IsForeign | Boolean | When true, identify the recipient address with a foreign address. |
| USAddress | Object | Optional Collects US address details of the recipient. |
| Address1 | String | OptionalRecipient US Address 1 (street address or post office box of that locality). This will be pre-filled on the Form. Size Range: ..46 |
| Address2 | String | OptionalRecipient US Address 2 (suite or apartment number). This will be pre-filled on the Form. Size Range: ..46 |
| City | String | OptionalRecipient US City. This will be pre-filled on the Form. Size Range: ..50 |
| State | String | OptionalRecipient US State Code. This will be pre-filled on the Form. Size Range: 2 Allowed values"AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AS", "FM", "GU", "MH", "MP", "PW", "PR", "VI", "AA", "AE", "AP" |
| ZipCd | String | OptionalRecipient Zip Code. In the format 99999 or 99999-9999. This will be pre-filled on the Form. Size Range: 5..10 |
| ForeignAddress | Object | Optional If IsForeign is true, pass foreign address of the recipient |
| Address1 | String | OptionalRecipient's foreign address (street address or post office box of that locality) Size Range: ..50 |
| Address2 | String | OptionalRecipient's suite or apartment Size Range: ..50 |
| City | String | Optional Recipient's city. Size Range: ..50 |
| ProvinceOrStateNm | String | OptionalRecipient's Province or State Name. Size Range: ..50 |
| Country | String | OptionalRecipient's country code. Size Range: ..2 Allowed values"AF", "AX", "AL", "AG", "AQ", "AN", "AO", "AV", "AY", "AC", "AR", "AM", "AA", "AT", "AS", "AU", "AJ", "BF", "BA", "FQ", "BG", "BB", "BO", "BE", "BH", "BN", "BD", "BT", "BL", "BK", "BC", "BV", "BR", "IO", "VI", "BX", "BU", "UV", "BM", "BY", "CB", "CM", "CA", "CV", "CJ", "CT", "CD", "CI", "CH", "KT", "IP", "CK", "CO", "CN", "CF", "CG", "CW", "CR", "CS", "IV", "HR", "CU", "UC", "CY", "EZ", "DA", "DX", "DJ", "DO", "DR", "TT", "EC", "EG", "ES", "EK", "ER", "EN", "ET", "FK", "FO", "FM", "FJ", "FI", "FR", "FP", "FS", "GB", "GA", "GG", "GM", "GH", "GI", "GR", "GL", "GJ", "GQ", "GT", "GK", "GV", "PU", "GY", "HA", "HM", "VT", "HO", "HK", "HQ", "HU", "IC", "IN", "ID", "IR", "IZ", "EI", "IS", "IT", "JM", "JN", "JA", "DQ", "JE", "JQ", "JO", "KZ", "KE", "KQ", "KR", "KN", "KS", "KV", "KU", "KG", "LA", "LG", "LE", "LT", "LI", "LY", "LS", "LH", "LU", "MC", "MK", "MA", "MI", "MY", "MV", "ML", "MT", "IM", "RM", "MR", "MP", "MX", "MQ", "MD", "MN", "MG", "MJ", "MH", "MO", "MZ", "WA", "NR", "BQ", "NP", "NL", "NC", "NZ", "NU", "NG", "NI", "NE", "NF", "CQ", "NO", "MU", "OC", "PK", "PS", "LQ", "PM", "PP", "PF", "PA", "PE", "RP", "PC", "PL", "PO", "RQ", "QA", "RO", "RS", "RW", "TB", "RN", "WS", "SM", "TP", "SA", "SG", "RI", "SE", "SL", "SN", "NN", "LO", "SI", "BP", "SO", "SF", "SX", "OD", "SP", "PG", "CE", "SH", "SC", "ST", "SB", "VC", "SU", "NS", "SV", "WZ", "SW", "SZ", "SY", "TW", "TI", "TZ", "TH", "TO", "TL", "TN", "TD", "TS", "TU", "TX", "TK", "TV", "UG", "UP", "AE", "UK", "UY", "UZ", "NH", "VE", "VM", "VQ", "WQ", "WF", "WI", "YM", "ZA", "ZI" |
| PostalCd | String | OptionalRecipient's Postal Code. Size Range: ..16 |
| IsTINMatching | Boolean | Optional TIN Matching will be enabled when the value is set as True. Once the recipient completes Form W-9, TaxBandits will match the Recipient's Name and SSN with the IRS database and notify the client via the webhook with the TIN results. |
| CustomizationId | Guid | Optional A unique customization identifier generated by TaxBandits after you complete the customization process in the Developer console or the unique ID you received in the response of the PortalCustomization CREATE Endpoint. endpoint. Note: Redirect URL is measured in seconds. |
| Customization | Object | Collects the customizations like TIN service, Business Logo and Callback URLs. |
| BusinessLogoUrl | String | Optional Gets the Business Logo. If given the business logo will be shown in the Iframe page. Size Range: ..150 |
| LogoPosition | String | Optional The position where your business logo will be placed on the page.Allowed values“LEFT”, “CENTER”, “RIGHT” |
| InterviewFlow | Boolean | Optional As an alternative to direct-form entry, provide your recipients with an interview-style W-9/W-8 completion. |
| PrimaryColor | String | Optional The color theme of the iframe page will be customized with this primary color. |
| SecondaryColor | String | Optional The color theme of the iframe page will be customized with this secondary color. |
| ShowDownloadPage | Boolean | Optional If TRUE, will provide an option for your payees to download their form. |
| PrefLang | String | OptionalGets the default display language for the portal. If not set, English will be shown.Allowed values"en-US", "es-ES", "fr-FR","de-DE","uk-UA","pt-PT" |
| RedirectUrls | Object | Collects the Redirect Urls as ReturnUrl and CancelUrl. |
| ReturnUrl | String | Optional Return Redirection URL. Set the callback URL redirection once the recipient completes filling the Form W-8BEN. Size Range: ..150 |
| CancelUrl | String | Optional Cancel Redirection URL. Set the callback URL when the recipient clicks the cancel button on the Form W-8BEN. Note: If you do not provide the Cancel Callback Redirection URL, the cancel button will not be shown to the recipient. Size Range: ..150 |
| RedirectTime | Number | Optional Redirection Time. Set the time before redirecting to the callback URL. Note: Redirect URL is measured in seconds. Size Range:5-300 |
Response Body
| Field | Type | Description |
|---|---|---|
| SubmissionId | Guid | Unique identifier of a submission. |
| PayeeRef | String | Unique identifier of the recipient. |
| Url | String | URL that can be accessed on its own or embedded on the client's website using Iframe or other means. |
| Errors | object[] | Collection of errors for the Recipient |
| Id | string | Error ID number. This ID is assigned by TaxBandits and it is unique for each error. |
| Name | string | Name of the errored node. |
| Message | string | Shows the error message |
The default business details will be considered as the
requester's details.
Request Json
- Sample 1
- Sample 2
- Sample 3
- Sample 4
- Sample 5
Request the URL for Form W-9/W-8 with PayerRef, PayeeRef, and the provided Redirect URL.
{
"Requester": {
"PayerRef": "B12345",
"BusinessId": null,
"TIN": null,
"DBAId": null,
"DBARef": null
},
"Recipient": {
"PayeeRef": "123456",
"Name": "John",
"IsTINMatching": true,
"FedTaxClass":"INDIVIDUAL",
"Email":"john@sample.com"
},
"Customization": {
"BusinessLogoUrl": "https://www.spanenterprises.com/Content/Images/span.png",
"LogoPosition": "CENTER",
"InterviewFlow": true,
"PrimaryColor": "#1be6f5",
"SecondaryColor": "#9c9276",
"ShowDownloadPage": true,
"PrefLang": "es-ES"
},
"RedirectUrls": {
"ReturnUrl": "https://example.com",
"CancelUrl": "https://example.com"
},
"WebhookRef": "0D14C79F-5FD6-4983-9809-023F0C2BF817",
}
Request the URL for Form W-9/W-8 with Business ID, Recipient ID, and the provided Redirect URL.
{
"Requester": {
"PayerRef": null,
"BusinessId": "0D12C79F-5FD6-4983-9809-023F0C2BF826",
"TIN": null,
"DBAId": null,
"DBARef": null
},
"Recipient": {
"RecipientId": "b1923445-970a-4ee3-a8ee-244c505bdbac",
"PayeeRef": "123456",
"Name": "John",
"IsTINMatching": true
},
"Customization": null,
"RedirectUrls": {
"ReturnUrl": "https://example.com",
"CancelUrl": "https://example.com"
}
}
Request URL with DBAId and DBARef details. The Recipient Address will be pre-filled in the form No Requester details were sent in and opted for TIN Matching.
{
"Requester": {
"PayerRef": null,
"BusinessId": null,
"TIN": null,
"DBAId": "dba263",
"DBARef": "c33e7ecc-334f-4a45-8eb3-3114281a61e5"
},
"Recipient": {
"PayeeRef": "123456",
"Name": "John",
"IsForeign": false,
"USAddress": {
"Address1": "1751 Kinsey Rd",
"Address2": "Main St",
"City": "Dothan",
"State": "AL",
"ZipCd": "36303"
},
"ForeignAddress": null,
"IsTINMatching": true
},
"Customization": null,
"RedirectUrls": null
}
Request URL with Payee Reference, Recipient details, Opted for TIN Matching and Customization with redirectionurl
{
"Requester": {
"PayerRef": null,
"BusinessId": null,
"TIN": null,
"DBAId": null,
"DBARef": null
},
"Recipient": {
"PayeeRef": "123456",
"Name": "John",
"IsForeign": true,
"USAddress": {
"Address1": "1751 Kinsey Rd",
"Address2": "Main St",
"City": "Dothan",
"State": "AL",
"ZipCd": "36303"
},
"ForeignAddress": {
"Address1": "1751 Kinsey Rd",
"Address2": "Main St",
"City": "Dothan",
"ProvinceOrStateNm": "TN",
"Country": "IN",
"PostalCd": "641016"
},
"IsTINMatching": true
},
"Customization": {
"BusinessLogoUrl": "https://www.spanenterprises.com/Content/Images/span.png",
"LogoPosition": "CENTER",
"InterviewFlow": true,
"PrimaryColor": "#1be6f5",
"SecondaryColor": "#9c9276",
"ShowDownloadPage": true
},
"RedirectUrls": {
"ReturnUrl": "https://example.com",
"CancelUrl": "https://example.com",
"RedirectTime": 60
}
}
Create a customized Form WhCertificate secure URL based on the CustomizationId.
{
"Requester": {
"PayerRef": null,
"BusinessId": "011d9058-fc7c-4182-bb4e-68d5ed7d7b2c",
"TIN": null,
"DBAId": null,
"DBARef": null
},
"Recipient": {
"PayeeRef": "123459",
"Name": "Michal",
"IsTINMatching": true
},
"CustomizationId": "0ecbdb4f-4cf0-440f-b412-8793eeaf6ee1",
"Customization": null,
"RedirectUrls": {
"ReturnUrl": "https://exampleweblink1.com",
"CancelUrl": "https://exampleweblink2.com"
}
}
Response JSON
- 200
- 400
- 401
Success Response - This is a sample response for successful API requests.
{
"SubmissionId": "7971f12e-fc8f-4d88-91c9-deb4696d3612",
"PayeeRef": "123456",
"Url": "https://testlinks.taxbandits.io?whId=7b20d2c0-6585-435c-89c7-3a01b13d33ef",
"Errors": null
}
Bad Request Response - You'll get the below response when your API requests contain any validation errors.
{
"SubmissionId": null,
"PayeeRef": "12345737498832749827344982738877239887293934798324798832274898874788",
"Url": null,
"Errors": [
{
"Id": "F68-100152",
"Name": "PayeeRef",
"Message": "PayeeReference can only have maximum of 50 characters"
}
]
}
Unauthorized Response - You'll get the below response when your API requests don't contain valid authentication credentials.
{
"StatusCode": 401,
"StatusName": "Unauthorized",
"StatusMessage": "Invalid authorization credentials",
"Errors": [
{
"Id": "AUTH-100025",
"Name": "Authorization",
"Message": "Authorization should not be empty"
}
]
}