# Unversioned

Buyer-facing routes that stay at the root forever. A printed QR and a shared link encode them, so a version bump must never move them.

## Deployment health probe

`GET /health`

Intentionally unversioned. Stays at the root forever.

### Responses

#### `200`: Healthy.

Body (`application/json`):

- `status` `string` _(required)_

### Example request

```bash
curl https://api.mayarin.xyz/health
```

```ts
fetch('https://api.mayarin.xyz/health')
```

## Hosted checkout page

`GET /checkout/{id}`

Intentionally unversioned. Renders the hosted checkout for a payment link. A printed QR and a shared link encode this URL, so a version bump must never move it.

### Path parameters

- `id` `string` _(required)_

### Responses

#### `200`: Checkout HTML page.

#### `404`: No link with that id.

Body (`application/json`):

- `error` `object` _(required)_
  - `code` `string` _(required)_
  - `message` `string` _(required)_
  - `retryable` `boolean` _(required)_
  - `details` `object`

### Example request

```bash
curl https://api.mayarin.xyz/checkout/string
```

```ts
fetch('https://api.mayarin.xyz/checkout/string')
```

## Hosted pay page for one intent

`GET /checkout/pay/{intentId}`

Intentionally unversioned. Renders the pay flow for a single payment intent.

### Path parameters

- `intentId` `string` _(required)_

### Responses

#### `200`: Pay HTML page.

### Example request

```bash
curl https://api.mayarin.xyz/checkout/pay/string
```

```ts
fetch('https://api.mayarin.xyz/checkout/pay/string')
```

## Render a QR as SVG

`GET /checkout/qr`

Intentionally unversioned. Renders an SVG QR for a `value` query string.

### Query parameters

- `value` `string`

### Responses

#### `200`: QR SVG image.

### Example request

```bash
curl 'https://api.mayarin.xyz/checkout/qr?value=string'
```

```ts
fetch('https://api.mayarin.xyz/checkout/qr?value=string')
```

## Live payment status stream

`GET /checkout/events/{intentId}`

Intentionally unversioned. Server-Sent Events: the first frame carries the current status; later frames are a nudge (`event: payment`) that tells the client to re-read the payment. The stream closes once the payment is terminal.

### Path parameters

- `intentId` `string` _(required)_

### Responses

#### `200`: SSE stream of payment status nudges.

### Example request

```bash
curl https://api.mayarin.xyz/checkout/events/string
```

```ts
fetch('https://api.mayarin.xyz/checkout/events/string')
```

## Hosted invoice page

`GET /invoices/{id}/view`

Intentionally unversioned. Renders the hosted invoice a buyer sees.

### Path parameters

- `id` `string` _(required)_

### Responses

#### `200`: Invoice HTML page.

#### `404`: No invoice with that id.

Body (`application/json`):

- `error` `object` _(required)_
  - `code` `string` _(required)_
  - `message` `string` _(required)_
  - `retryable` `boolean` _(required)_
  - `details` `object`

### Example request

```bash
curl https://api.mayarin.xyz/invoices/string/view
```

```ts
fetch('https://api.mayarin.xyz/invoices/string/view')
```
