# @integraledger/lcp/acp

> The exports of @integraledger/lcp/acp.

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

## Interfaces

### AcpBinding

#### Type Parameters

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

#### Properties

| Property   | Type                                                                                      |
| ---------- | ----------------------------------------------------------------------------------------- |
|  `claims`  | `boolean`                                                                                 |
|  `id`      | `Id`                                                                                      |
|  `pattern` | [`LcpPattern`](https://lcp.integraledger.com/reference/api/x402#lcppattern)                                            |
|  `tie`     | (`options`) => \[`"acp"`, \{ `options`: readonly [`HandlerOption`](#handleroption)\[]; }] |

#### Methods

##### advertise()

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

###### Parameters

| Parameter       | Type                              |
| --------------- | --------------------------------- |
| `doc`           | [`Session`](#session)             |
| `h`             | `` `0x${string}` ``               |
| `link`          | `string`                          |
| `offer`         | [`HandlerOption`](#handleroption) |
| `agreementUrl?` | `string`                          |

###### Returns

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

##### 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**(`choice`, `h`): `Promise`\<[`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`Unsigned`](#unsigned)>

###### Parameters

| Parameter | Type                      |
| --------- | ------------------------- |
| `choice`  | [`AcpChoice`](#acpchoice) |
| `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`: \{ `session`: [`Session`](#session); }; }

###### Parameters

| Parameter | Type                  |
| --------- | --------------------- |
| `doc`     | [`Session`](#session) |

###### Returns

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

##### unplaced()

> **unplaced**(`option`): [`HandlerOption`](#handleroption)

###### Parameters

| Parameter | Type                              |
| --------- | --------------------------------- |
| `option`  | [`HandlerOption`](#handleroption) |

###### Returns

[`HandlerOption`](#handleroption)

***

### AcpChoice

The buyer's own values for the allowance, and the session it pays.

#### Properties

| Property       | Type                  |
| -------------- | --------------------- |
|  `currency`    | `string`              |
|  `expires_at`  | `string`              |
|  `max_amount`  | `number`              |
|  `merchant_id` | `string`              |
|  `session`     | [`Session`](#session) |

***

### Unsigned

#### Properties

| Property     | Type                      |
| ------------ | ------------------------- |
|  `allowance` | [`Allowance`](#allowance) |

#### Methods

##### complete()

> **complete**(`request`): [`Refusal`](https://lcp.integraledger.com/reference/api#refusal) | [`Presented`](#presented)

###### Parameters

| Parameter | Type                      |
| --------- | ------------------------- |
| `request` | [`Presented`](#presented) |

###### Returns

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

## Type Aliases

### Allowance

> **Allowance** = `object`

ACP's Allowance: six members, closed.

#### Properties

| Property               | Type         |
| ---------------------- | ------------ |
|  `checkout_session_id` | `string`     |
|  `currency`            | `string`     |
|  `expires_at`          | `string`     |
|  `max_amount`          | `number`     |
|  `merchant_id`         | `string`     |
|  `reason`              | `"one_time"` |

***

### HandlerOption

> **HandlerOption** = `object`

The kind of payment handler a session offers: ACP's own `requires_delegate_payment` flag.

#### Properties

| Property                     | Type      |
| ---------------------------- | --------- |
|  `requires_delegate_payment` | `boolean` |

***

### Presented

> **Presented** = `object` & `object`

The `delegate_payment` request as the agent signs it.

#### Type Declaration

| Name        | Type                      |
| ----------- | ------------------------- |
| `allowance` | [`Allowance`](#allowance) |

***

### Session

> **Session** = `object` & `object`

A CheckoutSession. Every member other than `id` and `metadata.legal_context` is carried untouched.

#### Type Declaration

| Name        | Type     |
| ----------- | -------- |
| `id?`       | `string` |
| `metadata?` | `object` |

## Variables

### delegated

> `const` **delegated**: [`AcpBinding`](#acpbinding)\<`"acp/checkout/delegated"`>

***

### issuedDigest

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

SHA-256 over the RFC 8785 form of an issued handler option.

***

### METADATA\_KEY

> `const` **METADATA\_KEY**: `"legal_context"` = `"legal_context"`

***

### undelegated

> `const` **undelegated**: [`AcpBinding`](#acpbinding)\<`"acp/checkout/undelegated"`>

## Functions

### tie()

> **tie**(`options`): \[`"acp"`, \{ `options`: readonly [`HandlerOption`](#handleroption)\[]; }]

The binding slot: one option per kind of payment handler the session offers, and nothing from the checkout.

#### Parameters

| Parameter | Type                                          |
| --------- | --------------------------------------------- |
| `options` | readonly [`HandlerOption`](#handleroption)\[] |

#### Returns

\[`"acp"`, \{ `options`: readonly [`HandlerOption`](#handleroption)\[]; }]
