im trying to create a company account via Stripe Connect. The problem is that whatever i do i always receive that there is missing representative. I'm attaching my JS code below.
Thanks in advance for the help people !
currently_due: [
"representative.address.city",
"representative.address.line1",
"representative.address.postal_code",
"representative.dob.day",
"representative.dob.month",
"representative.dob.year",
"representative.email",
"representative.first_name",
"representative.last_name",
"representative.phone",
"representative.relationship.executive",
"representative.relationship.title"
],
const account = await stripe.accounts.create({
country: payload.country,
type: 'custom',
capabilities: {
card_payments: {
requested: payload.capabilities.card_payments
},
transfers: {
requested: payload.capabilities.transfers
},
},
business_profile: payload.business_profile,
business_type: payload.business_type,
tos_acceptance: {
date: Math.round(+(new Date()) / 1000),
ip: ip
},
company: {
...payload.company,
directors_provided: true,
executives_provided: true,
owners_provided: true,
},
external_account: {
object: 'bank_account',
country: 'BG',
currency: 'BGN',
account_number: 'BG80BNBG96611020345678'
}
});
const person = await stripe.accounts.createPerson(
account.id,
{
...payload.representative
}
);
let updatedAccount = await stripe.accounts.retrieve(
account.id,
);
The person representative payload looks like this. All fields are filled according to documentation and the creation passes
representative: {
first_name: document.getElementById('representative.first_name').value,
last_name: document.getElementById('representative.last_name').value,
email: document.getElementById('representative.email').value,
phone: document.getElementById('representative.phone').value,
ssn_last_4: document.getElementById('representative.ssn_last_4').value,
dob: {
month: document.getElementById('representative.dob.month').value,
day: document.getElementById('representative.dob.day').value,
year: document.getElementById('representative.dob.year').value,
},
address: {
line1: document.getElementById('representative.address.line1').value,
postal_code: document.getElementById('representative.address.postal_code').value,
city: document.getElementById('representative.address.city').value,
state: document.getElementById('representative.address.state').value,
},
relationship: {
title: document.getElementById('representative.relationship.title').value,
executive: document.getElementById('representative.relationship.executive').value === 'true',
}
}