> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Deliver Asset

> Calldata with which the seller or an operator delivers the asset of a paid sale to the buyer

> [!NOTE]
>
> Seller Financing is in beta and runs on Ethereum Sepolia instances only for now (`DEVELOPMENT` instances on Ethereum). A `PRODUCTION` instance, or one on another network, answers `503 SELLER_FINANCING_UNAVAILABLE`. See [Seller Financing](https://docs.trusset.org/endpoints/seller-financing/introduction.md).

Builds the delivery of the asset on a `REPAID` listing, signed by the seller or by a wallet that holds `OPERATOR_ROLE` on the market. The asset goes to the buyer's own wallet, the wallet that bought the listing, and the listing reads `COMPLETED`. In the same transaction the market credits the held payment, the downpayment plus the principal, to the seller, who withdraws it with [Withdraw](https://docs.trusset.org/endpoints/seller-financing/withdraw.md).

The delivery exists on markets that run delivery against payment, the second market implementation. See [Market generations](https://docs.trusset.org/endpoints/seller-financing/introduction.md#market-generations). On a first-generation market the answer is `409 MARKET_UPGRADE_REQUIRED`, and the buyer takes the asset with [Claim Asset](https://docs.trusset.org/endpoints/seller-financing/claim-asset.md). The buyer can always claim the asset itself, also to another wallet the token admits; the delivery lets the seller complete a sale without waiting for the buyer.

Before building, the API checks, in order:

1. The market runs delivery against payment and has recounted its live sales. Otherwise the answer is `409 MARKET_UPGRADE_REQUIRED` or `409 MIGRATION_PENDING`.
2. The listing is `REPAID`.
3. The asset can be delivered, read from the market's own `isDeliverable(id)` and `encumbrance(seller)`. While it cannot, the answer is `409 ASSET_NOT_DELIVERABLE` with `details.assetLeg` and `details.heldPayment`. See [Asset leg](https://docs.trusset.org/endpoints/seller-financing/introduction.md#asset-leg).
4. The buyer is verified on the asset token's own identity register, when the token names one. A buyer the register answers as not verified is refused with `409 RECIPIENT_NOT_VERIFIED`. The buyer can then claim to a verified wallet of its own with [Claim Asset](https://docs.trusset.org/endpoints/seller-financing/claim-asset.md).
5. In custody mode, the token admits the transfer from the custody adapter to the buyer. A refusal answers `409 RECIPIENT_REFUSED` with the token's `reason`.

The delivery is then simulated from `from`. A wallet that is neither the seller nor an operator answers `409 TX_WOULD_REVERT` with `NotSeller`, naming the seller and the wallets that hold `OPERATOR_ROLE`. A delivery stays open while the market is paused.

## Path Parameters

**marketId** `string` *required*

The market's record ID, as `id` on [List Markets](https://docs.trusset.org/endpoints/seller-financing/list-markets.md).

**listingId** `string` *required*

The listing's ID on the market.

## Body Parameters

**from** `string` *required*

The wallet that signs: the seller of the listing or a wallet that holds `OPERATOR_ROLE` on the market. Without it the answer is `400 FROM_REQUIRED`.

## Response Fields

**data** `object`

**action** `string`

`SIGN_TRANSACTIONS`.

**chainId** `integer`

The chain the step is built for.

**steps** `array`

One step, `deliverAsset` on the market, with `gasLimit`.

**confirmStepIndex** `integer`

`0`.

**preflight** `object`

`{ simulated: true, gasEstimate }`.

**recipient** `string`

The buyer's wallet, which receives the asset.

**heldPayment** `object`

The payment the market holds for this sale, as on [Get Listing](https://docs.trusset.org/endpoints/seller-financing/get-listing.md#response-fields).

**release** `object`

`{ to, amount, amountFormatted, note }`: the seller and what the delivery credits it. `amount` is `"0"` for a sale paid off before the market moved to delivery against payment, because the seller was credited at that payoff. `null` when the held payment could not be read.

**signer** `object`

`{ role: "SELLER_OR_OPERATOR_ROLE", seller }`.

**assetLeg** `object`

Present only when the asset leg carries a warning while the asset can still be delivered, for example a seller whose backing covers fewer than all of its sold amounts.

**warning** `string`

`assetLeg.warning`, present with it.

```bash cURL theme={null}
curl -X POST "https://api.trusset.org/seller-financing/api/markets/cmsg4x7k20003sf9q1d8v6b2e/listings/7/deliver" \
  -H "X-API-Key: trusset_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"from": "0x8cC237798b4E5eE7A07F20e8ad2db554404abF88"}'
```

```typescript TypeScript theme={null}
const res = await fetch(
  `https://api.trusset.org/seller-financing/api/markets/${marketId}/listings/${listingId}/deliver`,
  {
    method: 'POST',
    headers: { 'X-API-Key': 'trusset_your_key_here', 'Content-Type': 'application/json' },
    body: JSON.stringify({ from: await seller.getAddress() })
  }
);
const { data } = await res.json();
const step = data.steps[0];
await (await seller.sendTransaction({ to: step.to, data: step.data, value: 0, gasLimit: step.gasLimit })).wait();
```

```json Response theme={null}
{
  "success": true,
  "data": {
    "action": "SIGN_TRANSACTIONS",
    "chainId": 11155111,
    "steps": [
      {
        "to": "0xC0e7c00eFeE062188d596a5581638BE758F9D5d4",
        "data": "0xaf295927...",
        "value": "0",
        "functionName": "deliverAsset",
        "label": "Deliver the asset of listing 7 to the buyer 0x2396...417F",
        "description": "Deliver the asset of listing 7 to the buyer 0x2396...417F",
        "gasLimit": "201318"
      }
    ],
    "confirmStepIndex": 0,
    "preflight": { "simulated": true, "gasEstimate": "154860" },
    "recipient": "0x23966303b7b8e6cE0223f6A1D34b5a0B1aD2417F",
    "heldPayment": {
      "readable": true,
      "amount": "10000000",
      "amountFormatted": "10.0",
      "repaidAt": 1792580108,
      "deliverBy": 1795172108,
      "unwindableAt": 1795172109,
      "unwindable": false,
      "note": "The market holds the downpayment and the principal until the asset is delivered. Delivered, they are credited to the seller. Not delivered by 2026-11-20T10:55:08.000Z, the buyer can unwind the sale when the asset cannot be delivered, and an operator can unwind it in any case."
    },
    "release": {
      "to": "0x8cC237798b4E5eE7A07F20e8ad2db554404abF88",
      "amount": "10000000",
      "amountFormatted": "10.0",
      "note": "The delivery credits the held payment to the seller in the same transaction; the seller withdraws it with POST /seller-financing/api/markets/:marketId/withdraw."
    },
    "signer": { "role": "SELLER_OR_OPERATOR_ROLE", "seller": "0x8cC237798b4E5eE7A07F20e8ad2db554404abF88" }
  },
  "error": null,
  "metadata": {
    "timestamp": "2026-10-21T10:55:12.000Z",
    "requestId": "3f7c2a91-6d84-4b0e-9a15-c2e8f4d7b603",
    "instanceId": "inst_abc123"
  }
}
```

```json Error - Not Seller or Operator theme={null}
{
  "success": false,
  "data": null,
  "error": {
    "code": "TX_WOULD_REVERT",
    "message": "Only the seller 0x8cC237798b4E5eE7A07F20e8ad2db554404abF88 or a wallet holding OPERATOR_ROLE (0xCeBE3CdF854629823D03892675f7FD4eA3A036a9) can sign the delivery.",
    "details": {
      "action": "delivery",
      "error": "NotSeller",
      "requiredRole": "SELLER_OR_OPERATOR_ROLE",
      "seller": "0x8cC237798b4E5eE7A07F20e8ad2db554404abF88",
      "roleHolders": ["0xCeBE3CdF854629823D03892675f7FD4eA3A036a9"]
    }
  },
  "metadata": {
    "timestamp": "2026-10-21T10:55:12.000Z",
    "requestId": "3f7c2a91-6d84-4b0e-9a15-c2e8f4d7b603",
    "instanceId": "inst_abc123"
  }
}
```

```json Error - First-Generation Market theme={null}
{
  "success": false,
  "data": null,
  "error": {
    "code": "MARKET_UPGRADE_REQUIRED",
    "message": "The delivery exists from the second Seller Financing market implementation (delivery against payment). The market 0xC0e7c00eFeE062188d596a5581638BE758F9D5d4 still runs the first implementation 0xde0Dd200b23De7a21877980A75ea4143543Bab47, where the payoff credits the seller and the buyer takes the asset with claim-asset. Once the factory binds the new implementation, its admin upgrades it with POST /seller-financing/api/markets/:marketId/upgrade. Nothing was built.",
    "details": {
      "action": "delivery",
      "implementation": "0xde0Dd200b23De7a21877980A75ea4143543Bab47",
      "generation": 1
    }
  },
  "metadata": {
    "timestamp": "2026-10-21T10:55:12.000Z",
    "requestId": "3f7c2a91-6d84-4b0e-9a15-c2e8f4d7b603",
    "instanceId": "inst_abc123"
  }
}
```

## Error Codes

| Code | HTTP | Cause |
| - | - | - |
| `INVALID_LISTING_ID` | `400` | `listingId` is not a positive integer of up to 19 digits |
| `VALIDATION_ERROR` | `400` | `from` is malformed, or the body carries another field. `error.details` names it |
| `FROM_REQUIRED` | `400` | `from` is missing. The message names who signs: the seller or a wallet that holds `OPERATOR_ROLE` |
| `MARKET_NOT_FOUND` | `404` | No market with this ID that your instance reaches on its network |
| `LISTING_NOT_FOUND` | `404` | No listing with this ID on the market |
| `MARKET_UPGRADE_REQUIRED` | `409` | The market runs the first implementation. `details` carries `implementation` and `generation` |
| `MIGRATION_PENDING` | `409` | The market runs delivery against payment but has not recounted its live sales. [Upgrade Market](https://docs.trusset.org/endpoints/seller-financing/upgrade-market.md) builds the recount, which any wallet can sign |
| `INVALID_STATUS` | `409` | The listing is not `REPAID`. `details.status` names its status |
| `ASSET_NOT_DELIVERABLE` | `409` | The market reports that the asset cannot be delivered. `details` carries `assetLeg` and `heldPayment` |
| `RECIPIENT_NOT_VERIFIED` | `409` | The buyer is not verified on the asset token's identity register. `details` carries `recipient` and `registry` |
| `RECIPIENT_REFUSED` | `409` | Custody mode: the asset token refuses the transfer from the adapter to the buyer. `details` carries `recipient` and `reason` |
| `TX_WOULD_REVERT` | `409` | The delivery would revert: `NotSeller` with `details.requiredRole`, `details.seller` and `details.roleHolders`, or an adapter or token refusal |
| `CHAIN_UNAVAILABLE` | `503` | The chain could not be read, including the market implementation or the buyer. Nothing was built. Retry shortly |
| `SELLER_FINANCING_UNAVAILABLE` | `503` | The instance is a `PRODUCTION` instance or not on Ethereum |
| `DELIVER_BUILD_FAILED` | `500` | Unexpected failure. Nothing was built. Retry, or contact support with the request ID |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.