Form Completion Example

Form Selection

Payroll form determination requires a user's home location and one or more work locations. This process is sometimes referred to as "Choose Mode" because the user is presented with a listing of all possible withholding forms to choose from. When a user may know what form(s) they need to complete, providing them with a listing of relevant forms may be the optimal approach. The alternate approach is to use the "Guided Process" which asks the user targeted questions to help determine the appropriate form(s). See the Guided Flows Example for more details.

Example

Below is a high-level example of the endpoints that can be used to complete the forms necessary for an employee's payroll withholding elections. Please refer to the individual endpoint documentation for specific implementation details.

  1. Provide address information to the forms POST endpoint (this step can be omitted if the withholding forms have already been determined or if provided by the Guided process.
  2. An unfiltered Forms listing is provided when the /forms endpoint is used.
  3. Using a provided formID, use the formQuestionSet endpoint and specify the first question set for the form: /formQuestionSet/W4101/QS1.
  4. Iterate over the formQuestionSet while ensuring to capture the answers to each question. The SPF-API response will also provide the next relevant question set to present to the user based on their answers to the current question set. The final question set can be identified when hasMoreQuestions equals false. See the formQuestionSet endpoint for more detailed implementation instructions.
  5. To generate the final PDF, use the fillPdf POST endpoint and provide the field values collected to receive a base64 encoded PDF and the applicable tax parameters. The fillPdf GET endpoint can be used to view all the relevant form fields that may be necessary to complete a PDF version of the form.

The image below provides a graphical representation of the form completion process and includes the SPF-API endpoints necessary to complete the relevant withholding forms.

1354

Jump to top