Skip to main content
OwnPay is a white-label payment engine. Your customers should see your brand - not a shared platform URL. The domain system lets each brand operate under its own fully qualified domain with automated SSL and zero cross-tenant leakage.

How custom domains work

When a request arrives, OwnPay’s DomainMiddleware inspects the HTTP_HOST header and resolves it against the op_domains table. If it matches a brand’s custom domain, OwnPay injects that brand’s merchant_id into the request context and loads its visual identity.

Domain types

The master domain (configured via the APP_DOMAIN environment variable) is the only domain that can access the admin panel (/admin/*). Custom domains return a 404 for admin routes - this is a security feature, not a bug.

DNS configuration

Point your custom domain to your OwnPay server using one of these records:
If you already have an A record on the root domain, a CNAME for the pay subdomain is usually the cleanest approach.

Domain verification flow

1

Add the domain in OwnPay

Go to System > Domains, click Add Domain, and enter pay.yourbrand.com. Set the domain type to checkout and assign it to your brand.
2

Configure DNS

Add the A or CNAME record at your DNS provider. DNS propagation typically takes a few minutes to a few hours.
3

Verify DNS

Click Verify DNS in the OwnPay domain settings. OwnPay performs a DNS lookup and checks that the record points to your server. Once verified, dns_verified is set to 1.
4

SSL is provisioned

After DNS verification, OwnPay provisions an SSL certificate for the domain. Checkout pages are served over HTTPS automatically.
Until DNS verification passes, the custom domain returns a 503 Service Unavailable response. Make sure your DNS records are correctly configured before verifying.

URL generation

All customer-facing and gateway-facing URLs are built by DomainUrlService - never hardcoded. The priority order is:
  1. GATEWAY_CALLBACK_URL environment variable
  2. Brand’s custom domain
  3. APP_URL from .env
  4. Current request host
If you need to generate a checkout or callback URL in your code, always use DomainUrlService methods like buildCheckoutUrl() and buildCallbackUrl(). Hardcoding URLs will break when brands use custom domains.
Last modified on August 25, 2026