Skip to main content

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.

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.

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

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.

const result = await zenpays.tenantHostnames.resolve('pay.yourbrand.com')
// { found: true, merchantId: 'mrc_xxx', slug: 'yourbrand' }
FieldTypeDescription
foundbooleanWhether the hostname is mapped
merchantIdstring?Owning merchant, when found
slugstring?Tenant slug, when found

get

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

updateStatus

Enable or disable a hostname without deleting the mapping.

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.

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

delete

await zenpays.tenantHostnames.delete('th_xxx')

Removes the mapping permanently. Pages served on the hostname stop resolving to your merchant immediately — use updateStatus if you only want to disable it temporarily.