# Accept a reverse quote

Accept the saved reverse quote. The response supplies the escrow deadlines and swap ticket.

```text title="Endpoint"
POST /maker/v1/reverse/quote/{quoteId}/accept
```

## Examples

**cURL**

Set `QUOTE_ID` to the `quoteId` returned by the maker. Save the request prepared by your wallet as `accept-reverse.json`.

```bash title="cURL"
curl -sS "https://api-testnet.veylor.cash/maker/v1/reverse/quote/${QUOTE_ID:?}/accept" \
  -H 'Content-Type: application/json' \
  --data-binary @accept-reverse.json
```

**200 JSON**

```json title="HTTP 200"
{
  "swapId": "0x0000000000000000000000000000000000000000000000000000000000000001",
  "t0": 1900000000,
  "t1": 1900003600,
  "ticket": "example-swap-ticket"
}
```

**404 JSON**

```json title="HTTP 404"
{
  "code": "unknownQuote",
  "error": "quote is unknown, expired or already accepted"
}
```

## Request parameters

| Name | In | Type | Presence | Meaning |
| --- | --- | --- | --- | --- |
| `quoteId` | path | `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) | Required | The quoteId returned for this direction. |

## Request body

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

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `userShare` | `string` · [Hex64](https://docs.veylor.cash/api-types/#hex64) | Required | User's public Pallas share, encoded as two 32-byte affine coordinates. |
| `userProof` | `string` · [Hex64](https://docs.veylor.cash/api-types/#hex64) | Required | Proof of knowledge of the user's swap share. |
| `viewingKeys` | `string` · [Hex64](https://docs.veylor.cash/api-types/#hex64) | Required | 64-byte Zcash viewing material for this joint account only. |

## Responses

### HTTP 200

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

| Field | JSON type | Presence | Meaning |
| --- | --- | --- | --- |
| `swapId` | `string` · [Hex32](https://docs.veylor.cash/api-types/#hex32) | Required | 32-byte escrow identifier. |
| `t0` | `integer` · [UnixSeconds](https://docs.veylor.cash/api-types/#unixseconds) | Required | End of the initial ready window, in Unix seconds. |
| `t1` | `integer` · [UnixSeconds](https://docs.veylor.cash/api-types/#unixseconds) | Required | Start of the refund window for a ready swap, in Unix seconds. |
| `lateWindow` | `integer` · [Uint64](https://docs.veylor.cash/api-types/#uint64) | *Optional* | Length of the forward maker's refund window after t1, in seconds. |
| `ticket` | `string` | Required | Opaque credential for this swap. Supply it in the ZecSwap-Ticket header on protected relay routes. |

### Errors

| HTTP | Body | Meaning |
| --- | --- | --- |
| 400 | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | Malformed input or a request rejected for this swap. |
| 404 | `object` · [ErrorResponse](https://docs.veylor.cash/api-types/#errorresponse) | Unknown quote, swap or route. An expired quote can be unknown. |
| 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. |
