# Shield a refund

Retry shielding after refund settlement if the payout is still outstanding.

```text title="Endpoint"
POST /relayer/v1/reverse/refund-payout
```

## 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 `pay-reverse-refund.json`.

```bash title="cURL"
curl -sS "https://api-testnet.veylor.cash/relayer/v1/reverse/refund-payout" \
  -H "ZecSwap-Ticket: ${SWAP_TICKET:?}" \
  -H 'Content-Type: application/json' \
  --data-binary @pay-reverse-refund.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` · [RelayerPayout](https://docs.veylor.cash/api-types/#relayerpayout)

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `swapId` | `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) | Required | 32-byte escrow identifier. |
| `terms` | `object` · [ForwardTerms](https://docs.veylor.cash/api-types/#forwardterms) | Required | Escrow terms the relayer checks against the on-chain hash. |
| `note` | `object` · [RelayerNote](https://docs.veylor.cash/api-types/#relayernote) | Required | Shield note that must match the escrow's commitment. |
| `fee` | `string` · [DecimalUint128](https://docs.veylor.cash/api-types/#decimaluint128) | Required | Authorized fee in escrow-token base units. |
| `signature` | `string` · [EthereumSignature](https://docs.veylor.cash/api-types/#ethereumsignature) | Required | 65-byte Ethereum authorization signature in r, s, v order. |

**Fields of terms**

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `maker` | `string` · [EthereumAddress](https://docs.veylor.cash/api-types/#ethereumaddress) | Required | Address on the token side. In reverse, this is the user's authorization address. |
| `token` | `string` · [EthereumAddress](https://docs.veylor.cash/api-types/#ethereumaddress) | Required | Ethereum address of the escrow token. |
| `amount` | `string` · [DecimalUint128](https://docs.veylor.cash/api-types/#decimaluint128) | Required | Escrowed amount in token base units. |
| `makerKey` | `string` · [Hex64](https://docs.veylor.cash/api-types/#hex64) | Required | Public Pallas share for the token side. |
| `userKey` | `string` · [Hex64](https://docs.veylor.cash/api-types/#hex64) | Required | Public Pallas share for the Zcash side. |
| `user` | `string` · [EthereumAddress](https://docs.veylor.cash/api-types/#ethereumaddress) | Required | Address on the Zcash side. In reverse, this is the maker's address. |
| `t0` | `integer` · [UnixSeconds](https://docs.veylor.cash/api-types/#unixseconds) | Required | Ready deadline in Unix seconds. |
| `t1` | `integer` · [UnixSeconds](https://docs.veylor.cash/api-types/#unixseconds) | Required | Refund boundary in Unix seconds. |
| `payoutNote` | `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) | Required | Committed forward shield-note hash. Zero for a forward account payout or reverse escrow. |

**Fields of note**

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `npk` | `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) | Required | 32-byte note public key. |
| `encryptedBundle` | array of `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) (exactly 3) | Required | Three ordered 32-byte ciphertext words. |
| `shieldKey` | `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) | Required | 32-byte shield encryption public key. |

## 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. |
