# Fund reverse escrow

Submit the wallet’s proved Relay Adapt funding transaction.

```text title="Endpoint"
POST /relayer/v1/reverse/fund
```

## Examples

**cURL**

To include the optional `ZecSwap-Ticket` header, set `SWAP_TICKET` to the ticket from acceptance. Otherwise, remove the header line. Save the request prepared by your wallet as `fund-reverse.json`.

```bash title="cURL"
curl -sS "https://api-testnet.veylor.cash/relayer/v1/reverse/fund" \
  -H "ZecSwap-Ticket: ${SWAP_TICKET:?}" \
  -H 'Content-Type: application/json' \
  --data-binary @fund-reverse.json
```

**200 JSON**

```json title="HTTP 200"
{
  "transactions": [
    "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  ]
}
```

## Request parameters

| Name | In | Type | Presence | Meaning |
| --- | --- | --- | --- | --- |
| `ZecSwap-Ticket` | header | `string` | *Optional* | Send the ticket returned on acceptance for this swap’s relayer allowance. The wallet still signs and proves the requested action. |

## Request body

`object` · [ReverseFunding](https://docs.veylor.cash/api-types/#reversefunding)

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `swapId` | `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) | Required | 32-byte escrow identifier. |
| `chainId` | `integer` · [Uint64](https://docs.veylor.cash/api-types/#uint64) | Required | EIP-155 chain ID of the settlement network. |
| `to` | `string` · [EthereumAddress](https://docs.veylor.cash/api-types/#ethereumaddress) | Required | Pinned V2 Relay Adapt contract. |
| `data` | `string` · [HexData](https://docs.veylor.cash/api-types/#hexdata) | Required | Complete calldata of the locally proved Relay Adapt transaction. |
| `value` | `string` · [DecimalUint128](https://docs.veylor.cash/api-types/#decimaluint128) | Required | Native ETH value in wei. The sponsored funding route requires zero. |

## Responses

### HTTP 200

`object` · [RelayerSent](https://docs.veylor.cash/api-types/#relayersent)

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `transactions` | array of `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) | Required | Ethereum transaction hashes known to the relayer. Some idempotent operations can return an empty list. |

### Errors

| HTTP | Body | Meaning |
| --- | --- | --- |
| 400 | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | Malformed input or a request rejected for this swap. |
| 413 | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | The request exceeds the service’s body limit. |
| 415 | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | Use Content-Type: application/json. |
| 422 | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | The JSON fields or encoded values do not match the request type. |
| 503 | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | Temporarily unavailable, throttled, or waiting for a chain event. Respect Retry-After when present. `Retry-After` — Seconds to wait before retrying, when supplied. |
| Other | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | Other service error. Read code and error. |

**ErrorResponse fields**

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `code` | `string` · [ErrorCode](https://docs.veylor.cash/api-types/#errorcode) | Required | Machine-readable service error code. |
| `error` | `string` | Required | Human-readable detail. |
