{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/winnr-app/json-schema/winnr-app-purchase-domains-request-schema.json",
  "title": "PurchaseDomainsRequest",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/winnr-app-openapi.yaml#/components/schemas/PurchaseDomainsRequest",
  "type": "object",
  "required": [
    "domains"
  ],
  "properties": {
    "async": {
      "type": "boolean",
      "default": false,
      "description": "Run the purchase in the background and return 202 + job_id immediately. Recommended for orders of more than 2-3 domains (the synchronous path can exceed the gateway's ~30s response window). The job result carries the synchronous response payload."
    },
    "domains": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "items": {
        "type": "object",
        "required": [
          "domain"
        ],
        "properties": {
          "domain": {
            "type": "string",
            "description": "Domain name to purchase (e.g. example.com)."
          },
          "register": {
            "type": "boolean",
            "default": true,
            "description": "Register the domain at a registrar (charged). Set false to bring a domain you already own through checkout unbilled (setup only)."
          },
          "setup_dns": {
            "type": "boolean",
            "default": true
          },
          "setup_email": {
            "type": "boolean",
            "default": true
          },
          "users": {
            "type": "array",
            "description": "Email users to create on the domain after setup.",
            "items": {
              "type": "object",
              "required": [
                "name",
                "username"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "username": {
                  "type": "string"
                }
              }
            }
          },
          "redirect_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "forward_address": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "description": "Optional. Once the domain is set up, send a copy of every message that reaches its mailboxes to this address (the same forwarding as POST /v1/domains/{domain_id}/forward). It is not a catch-all: mail to addresses that do not exist on the domain is not forwarded. Validated before any charge (400 if it is not an email address); blank means no forwarding. On a Subdomain Strategy entry it applies to each subdomain, since the parent hosts no mailboxes."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "subdomains": {
            "type": "array",
            "description": "Subdomain Strategy only (register:true, on the standard four or a premium .io/.sh/.to/.vc): up to 5 subdomains provisioned under this domain, each with up to 10 mailboxes. Subdomains are free - only the parent registration is charged.",
            "items": {
              "type": "object",
              "required": [
                "label"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "users": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "name",
                      "username"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "username": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}