---
title: Referrals
editUrl: false
head: []
template: doc
prev: false
next: false
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

Defined in: [src/onboarding/client.gen.ts:8](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/onboarding/client.gen.ts#L8)

## Constructors

### Constructor

> **new Referrals**(`_core`): `Referrals`

Defined in: [src/onboarding/client.gen.ts:9](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/onboarding/client.gen.ts#L9)

#### Parameters

##### \_core

[`BrexCore`](/brex/api/index/classes/brexcore/)

#### Returns

`Referrals`

## Methods

### createDocument()

> **createDocument**(`id`, `body`, `options?`): `Promise`\<\{ `id`: `string`; `uri`: `string`; \}\>

Defined in: [src/onboarding/client.gen.ts:20](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/onboarding/client.gen.ts#L20)

Create a new document upload

The `uri` will be a presigned S3 URL allowing you to upload the referral doc securely. This URL can only be used for a `PUT` operation and expires 30 minutes after its creation. Once your upload is complete, we will use this to prefill the application.

Refer to these [docs](https://docs.aws.amazon.com/AmazonS3/latest/dev/PresignedUrlUploadObject.html) on how to upload to this presigned S3 URL. We highly recommend using one of AWS SDKs if they're available for your language to upload these files.

`POST /v1/referrals/{id}/document_upload`

#### Parameters

##### id

`string`

##### body

###### type

`"ARTICLES_OF_INCORPORATION"` \| `"IRS_EIN_CONFIRMATION"` \| `"IRS_EIN_APPLICATION"` \| `"CERTIFICATE_GOOD_STANDING"`

##### options?

[`RequestOptions`](/brex/api/index/interfaces/requestoptions/)

#### Returns

`Promise`\<\{ `id`: `string`; `uri`: `string`; \}\>

***

### createRequest()

> **createRequest**(`body`, `options?`): `Promise`\<\{ `customer_email?`: `string` \| `null`; `expires_at`: `string`; `id`: `string`; `products`: `object`[]; `referral_signup_url`: `string`; `status`: `"ACTIVE"` \| `"EXPIRED"` \| `"CLOSED"` \| `"UNCLAIMED"`; \}\>

Defined in: [src/onboarding/client.gen.ts:41](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/onboarding/client.gen.ts#L41)

Creates a referral

This creates new referrals. The response will contain an identifier and a unique personalized link to an application flow. Many fields are optional and when they're provided they'll prefill the application flow for Brex.  You should handle and store these references securely as they contain sensitive information about the referral.

`POST /v1/referrals`

#### Parameters

##### body

###### applicant

\{ `email`: `string`; `first_name`: `string`; `last_name`: `string`; \}

###### applicant.email

`string`

Format: email

**Description**

Business email of the applying customer.

**Example**

```ts
jane.smith@example.com
```

###### applicant.first_name

`string`

**Description**

First name of the applying customer.

**Example**

```ts
Jane
```

###### applicant.last_name

`string`

**Description**

Last name of the applying customer.

**Example**

```ts
Smith
```

###### business?

\{ `activity_description?`: `string` \| `null`; `address?`: \{ `city?`: `string` \| `null`; `country?`: `string` \| `null`; `line1?`: `string` \| `null`; `line2?`: `string` \| `null`; `phone_number?`: `string` \| `null`; `postal_code?`: `string` \| `null`; `state?`: `string` \| `null`; \} \| `null`; `alternate_address?`: \{ `city?`: `string` \| `null`; `country?`: `string` \| `null`; `line1?`: `string` \| `null`; `line2?`: `string` \| `null`; `phone_number?`: `string` \| `null`; `postal_code?`: `string` \| `null`; `state?`: `string` \| `null`; \} \| `null`; `beneficial_owners?`: `object`[] \| `null`; `employer_identification_number?`: `string` \| `null`; `incorporation_state?`: `string` \| `null`; `incorporation_type?`: `"C_CORP"` \| `"S_CORP"` \| `"B_CORP"` \| `"LLC"` \| `"LLP"` \| `"SOLE_PROP"` \| `"ORG_501C3"` \| `"LP"` \| `null`; `incorporation_year?`: `number` \| `null`; `legal_name?`: `string` \| `null`; `website_url?`: `string` \| `null`; \} \| `null`

###### contact_preference?

`"NO_OUTBOUND"` \| `"EMAIL_OUTBOUND"` \| `null`

###### referral_code

`string`

**Description**

Referral code that attributes credit to you if the prospect signs up for a Brex account.

**Example**

```ts
partner_abc123
```

##### options?

[`RequestOptions`](/brex/api/index/interfaces/requestoptions/)

#### Returns

`Promise`\<\{ `customer_email?`: `string` \| `null`; `expires_at`: `string`; `id`: `string`; `products`: `object`[]; `referral_signup_url`: `string`; `status`: `"ACTIVE"` \| `"EXPIRED"` \| `"CLOSED"` \| `"UNCLAIMED"`; \}\>

***

### get()

> **get**(`id`, `options?`): `Promise`\<\{ `customer_email?`: `string` \| `null`; `expires_at`: `string`; `id`: `string`; `products`: `object`[]; `referral_signup_url`: `string`; `status`: `"ACTIVE"` \| `"EXPIRED"` \| `"CLOSED"` \| `"UNCLAIMED"`; \}\>

Defined in: [src/onboarding/client.gen.ts:59](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/onboarding/client.gen.ts#L59)

Gets a referral by ID

Returns a referral object by ID if it exists.

`GET /v1/referrals/{id}`

#### Parameters

##### id

`string`

##### options?

[`RequestOptions`](/brex/api/index/interfaces/requestoptions/)

#### Returns

`Promise`\<\{ `customer_email?`: `string` \| `null`; `expires_at`: `string`; `id`: `string`; `products`: `object`[]; `referral_signup_url`: `string`; `status`: `"ACTIVE"` \| `"EXPIRED"` \| `"CLOSED"` \| `"UNCLAIMED"`; \}\>

***

### list()

> **list**(`query?`, `options?`): [`PagePromise`](/brex/api/index/classes/pagepromise/)\<\{ `items`: `object`[]; `next_cursor?`: `string` \| `null`; \}\>

Defined in: [src/onboarding/client.gen.ts:79](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/onboarding/client.gen.ts#L79)

List referrals

Returns referrals created.
*Note*: This doesn't include referrals that have expired.

`GET /v1/referrals`
Await for a single page, or `for await` to iterate items across all pages.

#### Parameters

##### query?

###### cursor?

`string` \| `null`

##### options?

[`RequestOptions`](/brex/api/index/interfaces/requestoptions/)

#### Returns

[`PagePromise`](/brex/api/index/classes/pagepromise/)\<\{ `items`: `object`[]; `next_cursor?`: `string` \| `null`; \}\>

***

### processDelayedEINDocument()

> **processDelayedEINDocument**(`id`, `body`, `options?`): `Promise`\<`void`\>

Defined in: [src/onboarding/client.gen.ts:102](https://github.com/slingshot/brex/blob/9dff46b5d5637a0dd072bca56d02d8a0f4425312/src/onboarding/client.gen.ts#L102)

Process a delayed EIN document after upload

Processes a delayed EIN document after it has been uploaded.

This endpoint should be called after successfully uploading an IRS EIN Confirmation document (CP-575, CP-575 fax sheet, or 147C) using the
standard document upload flow (`/v1/referrals/{id}/document_upload` with `type: IRS_EIN_CONFIRMATION`).

The `document_id` should be the `id` returned from the document upload request.

`POST /v1/referrals/{id}/process_ein_document`

#### Parameters

##### id

`string`

##### body

###### document_id

`string`

**Description**

The document ID returned from the initial document creation request

##### options?

[`RequestOptions`](/brex/api/index/interfaces/requestoptions/)

#### Returns

`Promise`\<`void`\>