Account.addChildren
Web Session Object
Transaction Object
Token Object
Season Set Object
Refund Object
RatePlan Object
Product Object
Payment Provider Object
Payment Method Object
NameValuePair Object
GiftCard Object
Entitlement Object
Chargeback Object
Campaign Object
BillingPlan Object
AutoBill Object
Address Object
Activity Object
Account Object
Account.addChildren
This method adds one or more child Accounts to a parent Account using an input array of childAccounts.
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.
parent: the Account that will be parent to these children.
child: an array of the child or children Accounts to attach to this parent Account.
force: a Boolean flag that, if set to true, replaces any parents that these children may already have.
payerReplacementBehavior: an action to take on methods that might, as a side effect, change who pays for an Account, for example: Account.addChildren. payerReplacementBehavior may be one of the two following strings:
ReplaceOnAllAutoBills |
This option specifies that any AutoBills that the child has, or will have, are to be paid by the parent Account. |
ReplaceOnlyFutureAutoBills |
This option specifies that all future AutoBills for the child Account are to be paid by the parent Account. Existing AutoBills will be left as is. |
Output
return: an object of type Return that indicates the success or failure of the call.
childAdded: the array of Accounts added.
Returns
This method returns the codes listed in Standard Return Codes.
Example
// to add children to an existing account
$parentAcct = new Account();
// account id for an existing account that will be the parent
$parentAcct->setMerchantAccountId('dad-101);
// existing accounts that will be the children
$childAcct1 = new Account();
$childAcct1->setMerchantAccountId('son-101);
$childAcct2 = new Account();
$childAcct2->setMerchantAccountId('son-102);
// want to replace existing parent of children, if any
$force = true;
// Future autobills for the children will be paid usingautobills for the children will be paid using
// parent's payment method
$payerReplacementBehavior = 'ReplaceOnlyFutureAutoBills';
$response = $parentAcct->addChildren(
array($childAcct1, $childAcct2),
$force,
$payerReplace);
if ($response['returnCode'] == 200) {
// children successfully added to the parent
}
else {
// Error while adding the children
print $response['returnString'] . "\n";
}
For Users
Learn More