{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nogpets-com/json-schema/nogpets-com-business-details-schema.json",
  "title": "BusinessDetails",
  "description": "New application: businessName, categories, town and a phone or email are required. With applicationId: only what changes.",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nogpets-com-openapi.json#/components/schemas/BusinessDetails",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "applicationId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{1,128}$",
      "description": "Update this application instead of starting one."
    },
    "businessName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "description": "The registered or main business name."
    },
    "tradingName": {
      "type": "string",
      "maxLength": 120,
      "description": "The name clients know, if different."
    },
    "contactName": {
      "type": "string",
      "maxLength": 120,
      "description": "The owner or the person NogPets talks to."
    },
    "phone": {
      "type": "string",
      "maxLength": 30,
      "description": "With its country code (+1 512 555 0100), or national for the business's country (082 555 0101 in South Africa); stored as E.164."
    },
    "email": {
      "type": "string",
      "maxLength": 254
    },
    "website": {
      "type": "string",
      "maxLength": 300
    },
    "town": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80,
      "description": "Where the business is based, e.g. Somerset West, Austin TX, Manchester."
    },
    "country": {
      "type": "string",
      "pattern": "^[A-Za-z]{2}$",
      "description": "ISO 3166-1 alpha-2 code of the country the business is in: ZA, US, GB, AU, DE… Required for a new application unless the phone's country code says it."
    },
    "currency": {
      "type": "string",
      "pattern": "^[A-Za-z]{3}$",
      "description": "ISO 4217 code the business charges in (ZAR, USD, GBP, EUR…). Defaults from the country; prices are in its minor units."
    },
    "timezone": {
      "type": "string",
      "maxLength": 64,
      "description": "IANA time zone of its hours, e.g. America/Chicago. Defaults when the country has one zone."
    },
    "payoutPreference": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "method"
          ],
          "description": "Outside South Africa: how they'd like to be paid, for NogPets to arrange after approval. Information only: never account numbers, IBANs, cards, keys or passwords (refused).",
          "properties": {
            "method": {
              "type": "string",
              "enum": [
                "BANK_TRANSFER",
                "PAYPAL",
                "STRIPE",
                "WISE",
                "CASH",
                "OTHER"
              ]
            },
            "note": {
              "type": "string",
              "maxLength": 200,
              "description": "A few words, e.g. \"ACH in USD\" or \"PayPal business account\"."
            }
          }
        }
      ]
    },
    "suburbs": {
      "type": "array",
      "maxItems": 40,
      "items": {
        "type": "string",
        "maxLength": 80
      },
      "description": "Suburbs they serve, as they say them (set_service_area makes them bookable areas)."
    },
    "categories": {
      "type": "array",
      "minItems": 1,
      "maxItems": 3,
      "items": {
        "$ref": "#/$defs/LineId"
      }
    },
    "mode": {
      "type": "string",
      "enum": [
        "MOBILE",
        "SALON",
        "BOTH"
      ],
      "description": "MOBILE goes to the client (what NogPets books today); SALON is at their premises; BOTH."
    },
    "vans": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100
    },
    "staff": {
      "type": "integer",
      "minimum": 0,
      "maximum": 500
    },
    "about": {
      "type": "string",
      "maxLength": 300,
      "description": "One or two plain sentences about the business."
    },
    "claimListingId": {
      "type": "string",
      "pattern": "^([a-z0-9-]{1,120})?$",
      "description": "A directory listing id (from possibleListings or find_pet_businesses) this business owns; \"\" unclaims."
    },
    "whatsappOptIn": {
      "type": "boolean",
      "description": "The owner agrees to NogPets WhatsApp messages about the application."
    }
  },
  "$defs": {
    "LineId": {
      "type": "string",
      "enum": [
        "grooming",
        "walking",
        "sitting"
      ],
      "description": "A NogPets service line."
    }
  }
}