To update a sub-merchant, you must specify the merchantAccountId along with the attributes to be changed. Any attributes not passed in the update call will remain unchanged.

PHP
Click to copy
Copied
$result = Braintree_MerchantAccount::update(
  'blue_ladders_store',
  [
    'individual' => ['firstName' => 'Jane']
  ]
);

if ($result->success) {
  echo 'Merchant account successfully updated';
} else {
  echo $result->errors;
}

If the merchant account cannot be found, you'll receive a Braintree_Exception_NotFound exception.

You can update the sub-merchant details that fall under these 3 attributes:

  • individual
  • business
  • funding

Individual details

Every sub-merchant must have an individual tied to that account. To update or replace the individual information, pass in the details via a merchant account update call as follows:

PHP
Click to copy
Copied
$result = Braintree_MerchantAccount::update(
  'blue_ladders_store',
  [
    'individual' => [
      'firstName' => 'Jane',
      'lastName' => 'Doe',
      'email' => 'jane@14ladders.com',
      'phone' => '5553334444',
      'dateOfBirth' => '1981-11-19',
      'ssn' => '456-45-4567',
      'address' => [
        'streetAddress' => '111 Main St',
        'locality' => 'Chicago',
        'region' => 'IL',
        'postalCode' => '60622'
      ]
    ]
  ]
);

$merchantAccount = $result->merchantAccount;
echo $merchantAccount->individualDetails->firstName;
// Jane

Only the last 4 digits of the SSN will be returned after a successful update since the field contains sensitive data.

Business details

If the sub-merchant is a registered business, you can update the DBA name, legal name, tax ID, and address fields.

PHP
Click to copy
Copied
$result = Braintree_MerchantAccount::update(
  'blue_ladders_store',
  [
    'business' => [
      'legalName' => 'Jane\'s Ladders',
      'dbaName' => 'Jane\'s Ladders',
      'taxId' => '98-7654321',
      'address' => [
        'streetAddress' => '111 Main St',
        'locality' => 'Chicago',
        'region' => 'IL',
        'postalCode' => '60622'
      ]
    ]
  ]
);

$merchantAccount = $result->merchantAccount;
echo $merchantAccount->businessDetails->legalName;
// Jane's Ladders
echo $merchantAccount->businessDetails->taxId;
// 98-7654321

Note that the business details are optional and are in addition to the individual details that are always required. See Onboarding Sub-merchants for more information.

Funding details

The funding section controls where Braintree will disburse the settled funds. The fields can be updated as follows:

PHP
Click to copy
Copied
$result = Braintree_MerchantAccount::update(
  'blue_ladders_store',
  [
    'funding' => [
      'descriptor' => 'Blue Ladders',
      'destination' => Braintree_MerchantAccount::FUNDING_DESTINATION_BANK,
      'email' => 'funding@blueladders.com',
      'mobilePhone' => '5555555555',
      'accountNumber' => '1123581321',
      'routingNumber' => '071101307'
      ]
  ]
);

$merchantAccount = $result->merchantAccount;
echo $merchantAccount->fundingDetails->accountNumberLast4;
// 1321
echo $merchantAccount->fundingDetails->routingNumber;
// 071101307

Only the last 4 digits of the account number will be returned after a successful update since the field contains sensitive data.

See also

Still have questions?

If you can’t find an answer, contact our Support team.