> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Creating Success or Failure Pages for HOA

When a customer submits an order form, HOA receives and stores the data on Vindicia servers, and redirects the customer's browser to your success page, hosted on your server. Specify the URL of your success page in the `returnURL` attribute of the `WebSession` object. (This is generally a dynamically generated page that intersperses Subscribe API calls with HTML to be sent to the browser.)

If a failure occurs when HOA stores the form data, HOA redirects the customer's browser to the page specified in the WebSession object's `errorURL` attribute. (This is also a dynamically generated page hosted on your server, but which in this case is used to notify your customer of a failure, and its causes.) If you do not specify the `errorURL` attribute, HOA will use the `returnURL` for redirection upon failure.

To work with the Subscribe API and your success and failure pages:

* When HOA redirects to the success or failure pages, it passes the `WebSession` object's `VID`. Use this `WebSessionVid` to make a `finalize()` call on the `WebSessionVid` object. Upon finalization, HOA internally makes the call specified in the `method` data member of the corresponding `WebSessionVid` object, creates the desired object or objects on the Vindicia server, and updates the `WebSessionVid` object with the call's results. This updated `WebSessionVid` object is available to you in the response to your `finalize()` call.
* When creating a success page, extract the non-Vindicia form data submitted by the customer by examining the `WebSession` object's `postValues` data member.
* On the success page, fetch the object created by the API call made by HOA. For example, if your `WebSession` object's `method` data member is set to `AutoBill.update`, after finalization of the `WebSession`, HOA creates an `AutoBill` object. Fetch that object with the `WebSession` object's `VID` by calling `AutoBill.fetchByWebSessionVid()`. Similar methods are available for the `Account`, `Transaction`, and `PaymentMethod` objects. You may then include information from these objects on your success page.

 

**Parent topic:**[Working with HOA with Hosted Fields](../topics/Working_with_HOA_with_Ho)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.