Skip to content

DNS delegation for partner subdomains

To let Swft programmatically create {studio}.checkouts.unstack.co.uk subdomains on your behalf, delegate a sub-zone to Swft’s Cloudflare account. This is a one-time setup per workspace.

  1. Decide on a sub-zone you control (e.g. checkouts.unstack.co.uk).

  2. At your registrar, set the NS records for the sub-zone to point at the nameservers Swft gives you.

  3. Swft creates the zone in its Cloudflare account and writes the zone_id + apex to your workspace row (workspaces.partner_default_zone_id / workspaces.partner_default_zone_apex).

  4. From then on you call:

    POST /v2/agencies/{ws}/merchants/{mid}/custom-domain
    { "subdomain": "cobalt-pilates" }

    Swft registers cobalt-pilates.checkouts.unstack.co.uk as a Cloudflare custom hostname against the delegated zone. SSL provisions automatically; the merchant doesn’t add any DNS records.

If you’d rather keep DNS in your own Cloudflare account, pass a fully-qualified hostname instead of subdomain. The merchant (or you) then add the CNAME + verification TXT records returned in the response.

POST /v2/agencies/{ws}/merchants/{mid}/custom-domain
{ "hostname": "checkout.example.com" }

The response includes:

{
"hostname": "checkout.example.com",
"cname_target": "checkout.swft.co.uk",
"ssl_status": "pending_validation",
"ownership_verification": {
"type": "txt",
"name": "_cf-custom-hostname.checkout.example.com",
"value": "..."
}
}

ssl_status flips to active within ~5 minutes once both records resolve.