> For the complete documentation index, see [llms.txt](https://docs.trustlesswork.com/trustless-work/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trustlesswork.com/trustless-work/v2-en/escrow-react-sdk/types/payloads.md).

# Payloads

What you pass into deploy / update / fund / release / dispute hooks. Amounts here are human **numbers**.

Milestone **payloads** for deploy are leaner than full entity milestones.

## Milestone payloads (deploy / manage)

```ts
type SingleReleaseMilestonePayload = {
  description: string;
  status?: string;
  approvalsTarget: number;
};

type MultiReleaseMilestonePayload = {
  description: string;
  status?: string;
  approvalsTarget: number;
  amount: number;
  receiver: string;
};
```

## Deploy

{% tabs %}
{% tab title="Single-release" %}

```ts
type DeploySingleReleaseEscrowPayload = {
  signer: string;
  engagementId: string;
  title: string;
  description: string;
  amount: number;
  platformFee: number;
  roles: Roles;
  milestones: SingleReleaseMilestonePayload[];
  trustline: DeployTrustline;
};
```

{% endtab %}

{% tab title="Multi-release" %}

```ts
type DeployMultiReleaseEscrowPayload = {
  signer: string;
  engagementId: string;
  title: string;
  description: string;
  platformFee: number;
  roles: MultiReleaseRoles;
  milestones: MultiReleaseMilestonePayload[];
  trustline: DeployTrustline;
};
```

{% endtab %}
{% endtabs %}

Optional attribution headers (platform-scoped calls):

```ts
type AttributionHeaders = {
  platformId?: string; // → X-TW-Platform
  subjectId?: string;  // → X-TW-Subject
};
```

## Update (full replace)

```ts
type UpdateSingleReleaseEscrowPayload = {
  contractId: string;
  admin: string;
  escrow: {
    engagementId: string;
    title: string;
    description: string;
    amount: number;
    platformFee: number;
    roles: Roles;
    milestones: SingleReleaseMilestonePayload[];
    trustline: Trustline;
  };
};

type UpdateMultiReleaseEscrowPayload = {
  contractId: string;
  admin: string;
  escrow: {
    engagementId: string;
    title: string;
    description: string;
    platformFee: number;
    roles: MultiReleaseRoles;
    milestones: MultiReleaseMilestonePayload[];
    trustline: Trustline;
  };
};
```

## Fund

```ts
type FundEscrowPayload = {
  amount: number;
  contractId: string;
  signer: string;
};
```

## Change milestone status

```ts
type ChangeMilestoneStatusPayload = {
  contractId: string;
  serviceProvider: string;
  updates: Array<{
    index: number;
    newStatus: string;
    newEvidence?: string;
  }>;
};
```

## Approve milestones

```ts
type ApproveMilestonesPayload = {
  contractId: string;
  approver: string;
  milestoneIndexes: number[];
};
```

## Approve and release (multi convenience)

```ts
type ApproveAndReleaseMilestonesPayload = {
  contractId: string;
  signer: string;
  milestoneIndexes: number[];
};
```

## Manage milestones (add / edit descriptions)

```ts
type ManageSingleReleaseMilestonesPayload = {
  contractId: string;
  admin: string;
  newMilestones: SingleReleaseMilestonePayload[];
  milestoneUpdates: Array<{
    index: number;
    newDescription?: string;
  }>;
};

type ManageMultiReleaseMilestonesPayload = {
  contractId: string;
  admin: string;
  newMilestones: MultiReleaseMilestonePayload[];
  milestoneUpdates: Array<{
    index: number;
    newDescription?: string;
    newAmount?: number;
  }>;
};
```

## Release funds

{% tabs %}
{% tab title="Single-release" %}

```ts
type SingleReleaseReleaseFundsPayload = {
  contractId: string;
  releaseSigner: string;
};
```

{% endtab %}

{% tab title="Multi-release" %}

```ts
type MultiReleaseReleaseFundsPayload = {
  contractId: string;
  releaseSigner: string;
  milestoneIndexes: number[];
};
```

{% endtab %}
{% endtabs %}

## Start dispute

{% tabs %}
{% tab title="Single-release" %}

```ts
type SingleReleaseStartDisputePayload = {
  contractId: string;
  signer: string;
  reason: string;
};
```

{% endtab %}

{% tab title="Multi-release" %}

```ts
type MultiReleaseStartDisputePayload = {
  contractId: string;
  signer: string;
  reason: string;
  milestoneIndexes: number[];
};
```

{% endtab %}
{% endtabs %}

## Resolve dispute / withdraw remaining

Shared distribution entry:

```ts
type Distribution = {
  address: string;
  amount: number;
};
```

{% tabs %}
{% tab title="Resolve — single" %}

```ts
type SingleReleaseResolveDisputePayload = {
  contractId: string;
  disputeResolver: string;
  distributions: Distribution[];
};
```

{% endtab %}

{% tab title="Resolve — multi" %}

```ts
type MultiReleaseResolveDisputePayload = {
  contractId: string;
  disputeResolver: string;
  distributions: Distribution[];
  milestoneIndexes: number[];
};
```

{% endtab %}

{% tab title="Withdraw remaining" %}

```ts
type SingleReleaseWithdrawRemainingFundsPayload = {
  contractId: string;
  disputeResolver: string;
  distributions: Distribution[];
};

type MultiReleaseWithdrawRemainingFundsPayload = {
  contractId: string;
  disputeResolver: string;
  distributions: Distribution[];
};
```

{% endtab %}
{% endtabs %}

See Entities for `Roles`, `Trustline`, and `DeployTrustline`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.trustlesswork.com/trustless-work/v2-en/escrow-react-sdk/types/payloads.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
