Skip to content

Assign a custom checkout hostname to a merchant.

POST
/agencies/{workspaceId}/merchants/{merchantId}/custom-domain
curl --request POST \
--url https://api.swft.co.uk/agencies/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/merchants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/custom-domain \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: example' \
--data '{ "hostname": "example" }'

Pass hostname for a fully-qualified domain on the shared Swft zone (e.g. checkout.example.com). Pass subdomain to provision under the partner’s delegated zone — the workspace must have partner_default_zone_id + partner_default_zone_apex configured (typically a one-time setup done by Swft when the partner delegates their sub-zone via NS records).

workspaceId
required
string format: uuid
merchantId
required
string format: uuid
idempotency-key
required
string
>= 1 characters
Media type application/json
Any of:
object
hostname
required
string
/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i/
Example generated
{
"hostname": "example"
}

Hostname registered. Customer must add the verification record(s).

Media type application/json
object
hostname
required
string
cname_target
required
string
ssl_status
required
string
ownership_verification
required
object
type
required
string
name
required
string
value
required
string
cloudflare_id
required
string
Example generated
{
"hostname": "example",
"cname_target": "example",
"ssl_status": "example",
"ownership_verification": {
"type": "example",
"name": "example",
"value": "example"
},
"cloudflare_id": "example"
}

Bad request — malformed input or missing/invalid parameters.

Media type application/json
object
error
required
object
type
required
string format: uri
code
required
string
message
required
string
doc_url
required
string format: uri
request_id
required
string
param
string
meta
object
key
additional properties
Example generated
{
"error": {
"type": "https://example.com",
"code": "example",
"message": "example",
"doc_url": "https://example.com",
"request_id": "example",
"param": "example",
"meta": {
"additionalProperty": "example"
}
}
}

Missing or invalid authentication.

Media type application/json
object
error
required
object
type
required
string format: uri
code
required
string
message
required
string
doc_url
required
string format: uri
request_id
required
string
param
string
meta
object
key
additional properties
Example generated
{
"error": {
"type": "https://example.com",
"code": "example",
"message": "example",
"doc_url": "https://example.com",
"request_id": "example",
"param": "example",
"meta": {
"additionalProperty": "example"
}
}
}

Authenticated but not authorised (e.g. wrong workspace).

Media type application/json
object
error
required
object
type
required
string format: uri
code
required
string
message
required
string
doc_url
required
string format: uri
request_id
required
string
param
string
meta
object
key
additional properties
Example generated
{
"error": {
"type": "https://example.com",
"code": "example",
"message": "example",
"doc_url": "https://example.com",
"request_id": "example",
"param": "example",
"meta": {
"additionalProperty": "example"
}
}
}

Resource not found.

Media type application/json
object
error
required
object
type
required
string format: uri
code
required
string
message
required
string
doc_url
required
string format: uri
request_id
required
string
param
string
meta
object
key
additional properties
Example generated
{
"error": {
"type": "https://example.com",
"code": "example",
"message": "example",
"doc_url": "https://example.com",
"request_id": "example",
"param": "example",
"meta": {
"additionalProperty": "example"
}
}
}

Conflict — idempotency-key reuse, duplicate resource, etc.

Media type application/json
object
error
required
object
type
required
string format: uri
code
required
string
message
required
string
doc_url
required
string format: uri
request_id
required
string
param
string
meta
object
key
additional properties
Example generated
{
"error": {
"type": "https://example.com",
"code": "example",
"message": "example",
"doc_url": "https://example.com",
"request_id": "example",
"param": "example",
"meta": {
"additionalProperty": "example"
}
}
}

Rate-limited.

Media type application/json
object
error
required
object
type
required
string format: uri
code
required
string
message
required
string
doc_url
required
string format: uri
request_id
required
string
param
string
meta
object
key
additional properties
Example generated
{
"error": {
"type": "https://example.com",
"code": "example",
"message": "example",
"doc_url": "https://example.com",
"request_id": "example",
"param": "example",
"meta": {
"additionalProperty": "example"
}
}
}

Internal server error.

Media type application/json
object
error
required
object
type
required
string format: uri
code
required
string
message
required
string
doc_url
required
string format: uri
request_id
required
string
param
string
meta
object
key
additional properties
Example generated
{
"error": {
"type": "https://example.com",
"code": "example",
"message": "example",
"doc_url": "https://example.com",
"request_id": "example",
"param": "example",
"meta": {
"additionalProperty": "example"
}
}
}