Skip to main content
Vindicia Knowledge Center

Account.update

Account.update

Account.update

The update method creates an Account object, or updates an existing one. Use the update method when a new customer record is created.

To create an Account object, initialize it and set the values for its data members as appropriate, and then call the update method to store the changes. When creating a new Account object, do not set a value for VID; CashBox will automatically generate a VID for the object when you call update. When updating an existing Account object, identify it with its VID or your account ID (merchantAccountId).

Note Do not call update to add or change a payment method for Account. Call Account.updatePaymentMethod instead. (See the Account.updatePaymentMethod method.)

When you update an Account, CashBox edits the existing Payment Method.

  • If the merchantPaymentMethod of an existing Payment Method is passed, then that Payment Method is edited. If replaceOnAllAutoBills is false, this edit is applied to all AutoBills using that Payment Method, and no other.
  • If a new merchantPaymentMethodId is passed, then a new Payment Method is created. If replaceOnallAutoBills is false, then the new Payment Method will not be applied to any AutoBills. If it is true, it will be applied to all.

Input

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.

account: the Account object to create or update. Use the merchantAccountId or VID to identify the object.

Output

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

account: the Account object you created or updated.

created: a Boolean flag that, if set to true, indicates that update has created a new Account object. Afalse setting means that update has updated an existing Account object.

Returns

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

Return Code

Return String

400

One of the following:

  • Data validation error. Failed to create Payment-Type-Specific Payment Record: Credit Card conversion failed: Credit Card failed Luhn check.
  • Failed to save account.

Example

// Create a new Account object

$account = new Account();

// Provide basic account information

$account->setName('Somebody Q. Customer'); // Customer name
$account->setMerchantAccountId('IN9430-8421'); // Unique customer id

// To create address information, create an address object

$address = new Address();
$address->setAddr1('123 Main Street');
$address->setAddr2('Apt. 4');
$address->setCity('San Carlos');
$address->setDistrict('CA');
$address->setPostalCode('94070');
$address->setCountry('US');
$address->setPhone('123-456-7890');

// Associate the Address object with the account

$account->setShippingAddress($address);

// Emails

$account->setEmailAddress('John.Doe@gmail.com');
$account->setEmailTypePreference('html');
$account->setWarnBeforeAutoBilling(true);

// Okay, basic information is entered, so save the account

$response = $account->update();

// Check to see that the account was created

if($response['returnCode'] == 200) {

// You can save the VID (Vindicia ID) for later use

$accountVid = $account->getVid();

}

For Users

Learn More
For Users

Cashbox Features

Learn More
Cashbox Features
Back to Top