0
votes

I run a platform where we use Stripe Connect (custom accounts) to manage platform payments and payouts. On a previous version of the API the following code worked fine.

// Company Details
$account->legal_entity->business_name = $data['business_name'];
$account->legal_entity->business_tax_id = $data['business_tax_id'];


// Legal entity personal details
$account->legal_entity->first_name = $data['first_name'];
$account->legal_entity->last_name = $data['last_name'];

However on a more recent version of the Stripe API (2019-09-09) this no longer works because as I discovered Stripe changed the accounts API. The new mappings are described here: https://stripe.com/docs/connect/required-updates/accounts-arguments

Based on this the following code should work:

// Company Details
$account->company->name = $data['business_name'];
$account->company->tax_id = $data['business_tax_id'];

// Legal entity personal details
$account->individual->first_name = $data['first_name'];
$account->individual->last_name = $data['last_name'];

But this doesn't work and I get the following message:

Creating default object from empty value

I am at a loss, have I misunderstood the new accounts API. Any helps is always appreciated.

1
This sounds like a Laravel-specific issue; maybe this is helpful? stackoverflow.com/a/43489013/379538floatingLomas

1 Answers

1
votes

You cannot combine company with individual. Individual is only a temporary bridge to interact with the Persons API. It will create a new person for your in case the business_type was set to individual but should be null for all other business types. (Similarly the company should be null and the individual property set if your business_type is individual)

From Stripe:

If you create accounts with the business_type set to individual, you need to provide at least one individual property (e.g., individual[first_name] so that a Person object is created automatically. If you create accounts with the business_type set to company, you need to create each Person for the account.

If the business type is anything else then individual, you need to work with the Persons API. (Recommended is of course to work with Persons API all the time, individual only being a special case where only 1 person needs to be maintained on the account)

Legacy running accounts will have the person automatically created for you by Stripe and will show up if you list Persons for that account using the API.

For a new account what you need to do is to create one or more persons. Stripe doc on Persons

\Stripe\Account::createPerson(
  'CONNECTED_ACCOUNT_ID',
  ['first_name' => 'Jane', 'last_name' => 'Diaz ']
);

Look into the relationship field of a Person object to describe the relationship of the person to the company you are onboarding.

After setting up the connected account and have added all the persons you want, you might need to set some flags on the company field of the account like directors_provided or executives_provided to signal for the verification process that you have finished providing Persons for those roles. (ex: you could have more than 1 executive person in a company)