# Interface: ReferralHandle

Defined in: ../../../../plandalf/numi/packages/sdk/src/core/referral.ts:138

## Extends

- `Promise`\<[`Referral`](https://plandalf.com/docs/packages/sdk/interfaces/Referral) \| `null`\>

## Properties

### \[toStringTag\]

> `readonly` **\[toStringTag\]**: `string`

Defined in: ../../../../plandalf/numi/node\_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:176

#### Inherited from

`Promise.[toStringTag]`

***

### events

> **events**: `AsyncIterable`\<[`ReferralEvent`](https://plandalf.com/docs/packages/sdk/interfaces/ReferralEvent)\>

Defined in: ../../../../plandalf/numi/packages/sdk/src/core/referral.ts:139

## Methods

### catch()

> **catch**\<`TResult`\>(`onrejected?`): `Promise`\<[`Referral`](https://plandalf.com/docs/packages/sdk/interfaces/Referral) \| `TResult` \| `null`\>

Defined in: ../../../../plandalf/numi/node\_modules/typescript/lib/lib.es5.d.ts:1564

Attaches a callback for only the rejection of the Promise.

#### Type Parameters

##### TResult

`TResult` = `never`

#### Parameters

##### onrejected?

((`reason`) => `TResult` \| `PromiseLike`\<`TResult`\>) \| `null`

The callback to execute when the Promise is rejected.

#### Returns

`Promise`\<[`Referral`](https://plandalf.com/docs/packages/sdk/interfaces/Referral) \| `TResult` \| `null`\>

A Promise for the completion of the callback.

#### Inherited from

`Promise.catch`

***

### close()

> **close**(): `void`

Defined in: ../../../../plandalf/numi/packages/sdk/src/core/referral.ts:144

#### Returns

`void`

***

### decorate()

> **decorate**(`url`): `string`

Defined in: ../../../../plandalf/numi/packages/sdk/src/core/referral.ts:141

Append `pf_rt=<token>` (and Stripe's `client_reference_id` on buy.stripe.com). No-op without a referral.

#### Parameters

##### url

`string`

#### Returns

`string`

***

### finally()

> **finally**(`onfinally?`): `Promise`\<[`Referral`](https://plandalf.com/docs/packages/sdk/interfaces/Referral) \| `null`\>

Defined in: ../../../../plandalf/numi/node\_modules/typescript/lib/lib.es2018.promise.d.ts:29

Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The
resolved value cannot be modified from the callback.

#### Parameters

##### onfinally?

(() => `void`) \| `null`

The callback to execute when the Promise is settled (fulfilled or rejected).

#### Returns

`Promise`\<[`Referral`](https://plandalf.com/docs/packages/sdk/interfaces/Referral) \| `null`\>

A Promise for the completion of the callback.

#### Inherited from

`Promise.finally`

***

### metadata()

> **metadata**(): `Record`\<`string`, `string`\>

Defined in: ../../../../plandalf/numi/packages/sdk/src/core/referral.ts:143

`{ [metadata_key]: token }` for server-created Stripe sessions, or `{}`.

#### Returns

`Record`\<`string`, `string`\>

***

### then()

> **then**\<`TResult1`, `TResult2`\>(`onfulfilled?`, `onrejected?`): `Promise`\<`TResult1` \| `TResult2`\>

Defined in: ../../../../plandalf/numi/node\_modules/typescript/lib/lib.es5.d.ts:1557

Attaches callbacks for the resolution and/or rejection of the Promise.

#### Type Parameters

##### TResult1

`TResult1` = [`Referral`](https://plandalf.com/docs/packages/sdk/interfaces/Referral) \| `null`

##### TResult2

`TResult2` = `never`

#### Parameters

##### onfulfilled?

((`value`) => `TResult1` \| `PromiseLike`\<`TResult1`\>) \| `null`

The callback to execute when the Promise is resolved.

##### onrejected?

((`reason`) => `TResult2` \| `PromiseLike`\<`TResult2`\>) \| `null`

The callback to execute when the Promise is rejected.

#### Returns

`Promise`\<`TResult1` \| `TResult2`\>

A Promise for the completion of which ever callback is executed.

#### Inherited from

`Promise.then`

Source: https://plandalf.com/docs/packages/sdk/interfaces/ReferralHandle
