You can add a customer to multiple tenants.
When selecting the customer you can chose how to identify them. You can use the customer’s email, externalId or id.
For this mutation you need the following permissions:
customer:edit
customerTenantMembership:create
import { PlainClient } from '@team-plain/typescript-sdk';
const client = new PlainClient({ apiKey: 'plainApiKey_xxx' });
const res = await client.addCustomerToTenants({
customerIdentifier: {
emailAddress: 'jane@aol.com',
},
tenantIdentifiers: [
{
externalId: 'team_123',
},
{
externalId: 'team_456',
},
],
});
if (res.error) {
console.error(res.error);
} else {
console.log(res.data);
}