Braintree Marketplace
Updating Sub-merchants
To update a sub-merchant, you must specify the merchant_account_id
along with the attributes to be changed. Any attributes not passed in the update call will remain unchanged.
- Ruby
result = gateway.merchant_account.update(
"blue_ladders_store",
:individual => {
:first_name => "Jane"
}
)
if result.success?
p "Merchant account successfully updated"
else
p result.errors
end
If the merchant account can't be found, it will raise a Braintree::NotFoundError
.
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:
- Ruby
result = gateway.merchant_account.update(
"blue_ladders_store",
:individual => {
:first_name => "Jane",
:last_name => "Doe",
:email => "jane@14ladders.com",
:phone => "5553334444",
:date_of_birth => "1981-11-19",
:ssn => "456-45-4567",
:address => {
:street_address => "111 Main St",
:locality => "Chicago",
:region => "IL",
:postal_code => "60622"
}
})
merchant_account = result.merchant_account
merchant_account.individual_details.first_name
# => "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.
- Ruby
result = gateway.merchant_account.update(
"blue_ladders_store",
:business => {
:legal_name => "Jane's Ladders",
:dba_name => "Jane's Ladders",
:tax_id => "98-7654321",
:address => {
:street_address => "111 Main St",
:locality => "Chicago",
:region => "IL",
:postal_code => "60622"
}
})
merchant_account = result.merchant_account
merchant_account.business_details.legal_name
# => "Jane's Ladders"
merchant_account.business_details.tax_id
# => "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:
- Ruby
result = gateway.merchant_account.update(
"blue_ladders_store",
:funding => {
:descriptor => "Blue Ladders",
:destination => Braintree::MerchantAccount::FundingDestination::Bank,
:email => "funding@blueladders.com",
:mobile_phone => "5555555555",
:account_number => "1123581321",
:routing_number => "071101307"
})
merchant_account = result.merchant_account
merchant_account.funding_details.account_number_last_four
# => "1321"
merchant_account.funding_details.routing_number
# => "071101307"
Only the last 4 digits of the account number will be returned after a successful update since the field contains sensitive data.