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.
One-time setup
Section titled “One-time setup”-
Decide on a sub-zone you control (e.g.
checkouts.unstack.co.uk). -
At your registrar, set the NS records for the sub-zone to point at the nameservers Swft gives you.
-
Swft creates the zone in its Cloudflare account and writes the
zone_id+apexto your workspace row (workspaces.partner_default_zone_id/workspaces.partner_default_zone_apex). -
From then on you call:
POST /v2/agencies/{ws}/merchants/{mid}/custom-domain{ "subdomain": "cobalt-pilates" }Swft registers
cobalt-pilates.checkouts.unstack.co.ukas a Cloudflare custom hostname against the delegated zone. SSL provisions automatically; the merchant doesn’t add any DNS records.
Manual hostname (no delegation)
Section titled “Manual hostname (no delegation)”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.