<!-- ZenPays documentation · https://docs.zenpayz.com/docs/api-reference/tenant-hostnames -->

# Tenant Hostnames

White-label hostname management — map your own domain to your ZenPays merchant account and brand the hosted pages served on it. Access via `zenpays.tenantHostnames`.

:::note JavaScript only
The Python SDK does not yet expose a `tenantHostnames` namespace. Call the REST endpoints directly from Python.
:::

## Methods

### create

Map a hostname to the authenticated merchant.

```typescript
const hostname = await zenpays.tenantHostnames.create({
  hostname: 'pay.yourbrand.com',
  slug: 'yourbrand',
})
```

Point the hostname at ZenPays with a CNAME before creating the mapping, or the hosted pages will not resolve.

### list

```typescript
const hostnames = await zenpays.tenantHostnames.list()
```

### resolve

Look up which merchant a hostname belongs to. Useful when your own edge needs to route a request before it reaches ZenPays.

```typescript
const result = await zenpays.tenantHostnames.resolve('pay.yourbrand.com')
// { found: true, merchantId: 'mrc_xxx', slug: 'yourbrand' }
```

| Field | Type | Description |
|-------|------|-------------|
| `found` | `boolean` | Whether the hostname is mapped |
| `merchantId` | `string?` | Owning merchant, when found |
| `slug` | `string?` | Tenant slug, when found |

### get

```typescript
const hostname = await zenpays.tenantHostnames.get('th_xxx')
```

### updateStatus

Enable or disable a hostname without deleting the mapping.

```typescript
await zenpays.tenantHostnames.updateStatus('th_xxx', 'inactive')
```

`status` is `'active'` or `'inactive'`.

### updateBranding

Set the logo, colours, and theme used on pages served from this hostname.

```typescript
await zenpays.tenantHostnames.updateBranding('th_xxx', {
  logoUrl: 'https://cdn.yourbrand.com/logo.svg',
  primaryColor: '#0f172a',
  theme: 'light',
})
```

### delete

```typescript
await zenpays.tenantHostnames.delete('th_xxx')
```

Removes the mapping permanently. Pages served on the hostname stop resolving to your merchant immediately — use [`updateStatus`](#updatestatus) if you only want to disable it temporarily.
