Skip to main content
Vindicia Knowledge Center




The initialize method creates a WebSession object. Call this method before presenting your HOA-based Web order form to your customer. The call returns the new WebSession object with a populated VID attribute. Embed that VID in the order form as a hidden form element with the name vin_WebSession_vid to make it available to HOA at form submission. You only need to pass in the CashBox API object attributes that you have collected thus far in the customer’s flow. Remaining attributes can be passed in with the WebSession.finalize call.

To create a WebSession object, set the values for its data members (see WebSession Data Members) and then call initialize() to store the changes in the Vindicia database. Do not set a value for VID because CashBox automatically generates that when you call initialize().


srd: sparse response description, a SOAP string (which must be a JSON object), in which you specify the elements you want returned.This parameter enables the calling system to constrain a method call to return only components you specify. This gives you greater control over returned content, and improves response time within the Vindicia platform by reducing the processing needed for the call.

Some fields are required, either practically or in the WSDL, and will be returned regardless of the srd. A null srd returns the complete response.

session: the WebSession object to create.


return: an object of type Return that indicates the success or failure of the call.

session: the WebSession object that contains the data that you passed, the VID, and the expireTime value assigned by CashBox.


In addition to those listed in Standard Return Codes, this call returns:

Return Code

Return String


One of the following:

  • Missing required parameter: version version.
  • Invalid parameter: Unsupported version.
  • Missing required parameter: method.
  • Invalid parameter: Unsupported method.
  • Missing required parameter: returnURL.


// to create a WebSession object

$ws = new WebSession();

// HOA should make an AutoBill.update call when the form is submitted


// Customer's IP address. When customer submits the form
// it should come from the same IP address


// Page to which HOA will redirect customer's browser
// after successfully making the AutoBill.update call when the
// customer submits the form


// Page to which HOA will redirect customer's browser
// if the AutoBill.update call it makes when the customer submits
// the form unsuccessful


// Private name values pairs. These are needed to create the
// AutoBill object, but we do not want them to appear in the
// form the customer fills in

$pnv1 = new NameValuePair();

// The name is flattened Object name concatenated
// with attribute names with an underscore.

// The CashBox Account object for which HOA should create the
// AutoBill object


// The CashBox Product object HOA should use in constructing
// the AutoBill object

$pnv2 = new NameValuePair();
$pnv2->setValue('StartWars II');

$pnv3 = new NameValuePair();

// When customer submits the form, the billing plan
// should be one of the two comma separated values

$pnv3->setValue('GoldAccess2010, PlatinumAccess2010');

$ws->setPrivateFormValues(array($pnv1, $pnv2, $pnv3));

// Method parameter name values pairs. These are needed to make the
// AutoBill.update call which takes parameters in addition to the
// AutoBill object itself. We do not want these to come from the form
// submission because that makes them susceptible to hacking

$mpnv1 = new NameValuePair();

// The name is flattened object name, method name, and parameter
// name concatenated with an underscore.


// Leave other parameter values to their default values


// Now create the WebSession object on Vindicia servers
// by making the SOAP call to initialize the object

$response = $ws->initialize();
if ($response->['returnCode'] == 200) {

$ret_ws = $response['data']->session;

// The VID of the WebSession object serves as session id

$sessionId = $ret_ws->getVID();

// Embed the sessionId as hidden field in the order web form
// Compose and present the order web form here


else {

// Return error to the customer who requested the web order form


For Users

Learn More
For Users

Vindicia Subscribe Features

Learn More
Vindicia Subscribe Features
Back to Top