> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revenuebee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# externalAccounts.add

> Link a customer to their account in another system.

```ts theme={null}
const [result, error] = await crm.externalAccounts.add({
  partyId: contact.id,
  type: "stripe",
  value: "cus_123",
});

if (result?.merged) {
  // a contact the Stripe sync created earlier was folded into this one
}
```

If another contact already holds this account, it is merged into this one and removed. See [Setting up your data](https://docs.revenuebee.ai/concepts/setting-up-your-data.md#both).

**partyId** `string` *required*

The CRM's id for the customer: the `id` that `contacts.upsert` returns, or what
[`contacts.resolve`](https://docs.revenuebee.ai/sdk/resolve-contact) finds from your own id.

**type** `"stripe" | "paddle" | "shopify"` *required*

The system the account lives in. Only systems the CRM knows are accepted.

**value** `string` *required*

Its id there: a Stripe customer id such as `cus_123`, a Paddle customer id such as `ctm_01h8441jn5pcwrfhwh78jqt8hk`,
or a Shopify customer's numeric id such as `8728645861618`.

## Returns

**contact** `Contact`

The contact after the link, merged accounts included.

**merged** `boolean`

Whether another contact was merged into this one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.