# @integraledger/lcp/ucp

> The exports of @integraledger/lcp/ucp.

Source: https://lcp.integraledger.com/reference/api/ucp

## Interfaces

### UcpBinding

#### Type Parameters

| Type Parameter          |
| ----------------------- |
| `Id` *extends* `string` |
| `O` *extends* `Option`  |

#### Properties

| Property   | Type                                           |
| ---------- | ---------------------------------------------- |
|  `claims`  | `boolean`                                      |
|  `id`      | `Id`                                           |
|  `pattern` | [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402#lcppattern) |

#### Methods

##### advertise()

> **advertise**(`doc`, `h`, `link`, `offer`, `agreementUrl?`): [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`Checkout`](#checkout)

###### Parameters

| Parameter       | Type                    |
| --------------- | ----------------------- |
| `doc`           | [`Checkout`](#checkout) |
| `h`             | `` `0x${string}` ``     |
| `link`          | `string`                |
| `offer`         | `O`                     |
| `agreementUrl?` | `string`                |

###### Returns

[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`Checkout`](#checkout)

##### bound()

> **bound**(`presented`): `Promise`\<`` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)>

###### Parameters

| Parameter   | Type      |
| ----------- | --------- |
| `presented` | `unknown` |

###### Returns

`Promise`\<`` `0x${string}` `` | [`Refusal`](https://lcp.integraledger.com/reference/api#refusal)>

##### build()

> **build**(`offer`, `h`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`Unsigned`](#unsigned)>

###### Parameters

| Parameter | Type                    |
| --------- | ----------------------- |
| `offer`   | [`UcpOffer`](#ucpoffer) |
| `h`       | `` `0x${string}` ``     |

###### Returns

`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`Unsigned`](#unsigned)>

##### read()

> **read**(`doc`): [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | \{ `agreement?`: `string`; `h`: `` `0x${string}` ``; `link`: `string`; `offer`: [`UcpOffer`](#ucpoffer); }

###### Parameters

| Parameter | Type                    |
| --------- | ----------------------- |
| `doc`     | [`Checkout`](#checkout) |

###### Returns

[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | \{ `agreement?`: `string`; `h`: `` `0x${string}` ``; `link`: `string`; `offer`: [`UcpOffer`](#ucpoffer); }

##### tie()

> **tie**(`options`): \[`"ucp"`, \{ `options`: readonly `O`\[]; }]

###### Parameters

| Parameter | Type            |
| --------- | --------------- |
| `options` | readonly `O`\[] |

###### Returns

\[`"ucp"`, \{ `options`: readonly `O`\[]; }]

##### unplaced()

> **unplaced**(`option`): `O`

###### Parameters

| Parameter | Type |
| --------- | ---- |
| `option`  | `O`  |

###### Returns

`O`

***

### UcpOffer

#### Properties

| Property    | Type                    |
| ----------- | ----------------------- |
|  `checkout` | [`Checkout`](#checkout) |

***

### Unsigned

#### Properties

| Property    | Type                    |
| ----------- | ----------------------- |
|  `checkout` | [`Checkout`](#checkout) |

#### Methods

##### complete()

> **complete**(`checkout_mandate`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`Presented`](https://lcp.integraledger.com/reference/api/ap2#presented)>

###### Parameters

| Parameter          | Type     |
| ------------------ | -------- |
| `checkout_mandate` | `string` |

###### Returns

`Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`Presented`](https://lcp.integraledger.com/reference/api/ap2#presented)>

## Type Aliases

### BookingOption

> **BookingOption** = `object`

A booking session's own `id`, 1–256 characters.

#### Properties

| Property   | Type     |
| ---------- | -------- |
|  `booking` | `string` |

***

### Checkout

> **Checkout** = `object` & `object`

#### Type Declaration

| Name     | Type                |
| -------- | ------------------- |
| `ap2?`   | `object` & `object` |
| `id`     | `string`            |
| `links?` | [`Link`](#link)\[]  |

***

### CheckoutOption

> **CheckoutOption** = `object`

A checkout's own `id`, 1–256 characters.

#### Properties

| Property    | Type     |
| ----------- | -------- |
|  `checkout` | `string` |

***

### Link

> **Link** = `object`

#### Properties

| Property  | Type     |
| --------- | -------- |
|  `title?` | `string` |
|  `type`   | `string` |
|  `url`    | `string` |

## Variables

### AGREEMENT\_LINK\_TYPE

> `const` **AGREEMENT\_LINK\_TYPE**: `"legal_context_agreement"` = `"legal_context_agreement"`

***

### ap2Mandate

> `const` **ap2Mandate**: [`UcpBinding`](#ucpbinding)\<`"ucp/checkout/ap2-mandate"`, [`CheckoutOption`](#checkoutoption)>

***

### bookingAp2Mandate

> `const` **bookingAp2Mandate**: [`UcpBinding`](#ucpbinding)\<`"ucp/booking/ap2-mandate"`, [`BookingOption`](#bookingoption)>

***

### bookingUnsigned

> `const` **bookingUnsigned**: [`UcpBinding`](#ucpbinding)\<`"ucp/booking/unsigned"`, [`BookingOption`](#bookingoption)>

***

### issuedDigest

> `const` **issuedDigest**: *typeof* [`digestJson`](https://lcp.integraledger.com/reference/api#digestjson) = `digestJson`

The option digest the issuer keeps: SHA-256 over the RFC 8785 form.

***

### LINK\_TYPE

> `const` **LINK\_TYPE**: `"legal_context"` = `"legal_context"`

***

### unsigned

> `const` **unsigned**: [`UcpBinding`](#ucpbinding)\<`"ucp/checkout/unsigned"`, [`CheckoutOption`](#checkoutoption)>

## Functions

### legalContextLink()

> **legalContextLink**(`c`): [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | \{ `h`: `` `0x${string}` ``; `link`: `string`; }

The hash and link of the checkout's one `legal_context` link. Nothing else of the checkout is read.

#### Parameters

| Parameter | Type                    |
| --------- | ----------------------- |
| `c`       | [`Checkout`](#checkout) |

#### Returns

[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | \{ `h`: `` `0x${string}` ``; `link`: `string`; }

***

### tie()

> **tie**\<`O`>(`options`): \[`"ucp"`, \{ `options`: readonly `O`\[]; }]

The binding slot: the checkouts or bookings this ATR was minted for, each by its own `id`.

#### Type Parameters

| Type Parameter         |
| ---------------------- |
| `O` *extends* `Option` |

#### Parameters

| Parameter | Type            |
| --------- | --------------- |
| `options` | readonly `O`\[] |

#### Returns

\[`"ucp"`, \{ `options`: readonly `O`\[]; }]
