{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/salesforce-commerce-cloud/json-schema/salesforce-commerce-cloud-store-result-schema.json",
  "title": "StoreResult",
  "description": "Result object containing an array of stores.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/salesforce-commerce-cloud-shopper-stores-api-openapi.yml#/components/schemas/StoreResult",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/ResultBase"
    }
  ],
  "properties": {
    "data": {
      "description": "The list of stores in the search result.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/Store"
      }
    }
  },
  "$defs": {
    "CountryCode": {
      "pattern": "^[A-Z][A-Z]$",
      "description": "A two letter uppercase country code conforming to the [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) alpha-2 standard.",
      "type": "string"
    },
    "Distance": {
      "minimum": 0,
      "maximum": 20012,
      "format": "double",
      "description": "The distance to the given geolocation where the stores will be searched, using the unit given in the attribute 'DistanceUnit' (miles or kilometers).",
      "type": "number"
    },
    "DistanceUnit": {
      "description": "The unit the distance attribute is measured in (either in miles or kilometers).",
      "enum": [
        "km",
        "mi"
      ],
      "type": "string"
    },
    "Latitude": {
      "minimum": -90,
      "maximum": 90,
      "format": "double",
      "description": "The latitude of the store.",
      "type": "number"
    },
    "Longitude": {
      "minimum": -180,
      "maximum": 180,
      "format": "double",
      "description": "The longitude of the store.",
      "type": "number"
    },
    "PostalCode": {
      "minLength": 3,
      "maxLength": 10,
      "description": "The postal code of the store.",
      "type": "string"
    },
    "ResultBase": {
      "description": "Schema defining generic list result. Each response schema of a resource requiring a list response should extend this schema. \nAdditionally it needs to be defined what data is returned.",
      "type": "object",
      "required": [
        "limit",
        "total"
      ],
      "properties": {
        "limit": {
          "format": "int32",
          "description": "Maximum records to retrieve per request. The limit with its constraints (minimum, maximum, default) is defined by the request parameter `limit` of the endpoint returning this schema.",
          "type": "integer"
        },
        "total": {
          "$ref": "#/$defs/Total"
        }
      }
    },
    "Store": {
      "description": "Document representing a store.",
      "properties": {
        "address1": {
          "minLength": 1,
          "description": "The primary address of the store.",
          "type": "string"
        },
        "address2": {
          "description": "The secondary address of the store.",
          "type": "string"
        },
        "city": {
          "description": "The city of the store.",
          "type": "string"
        },
        "countryCode": {
          "$ref": "#/$defs/CountryCode"
        },
        "distance": {
          "$ref": "#/$defs/Distance"
        },
        "distanceUnit": {
          "$ref": "#/$defs/DistanceUnit"
        },
        "email": {
          "description": "The email address of the store.",
          "type": "string"
        },
        "fax": {
          "description": "The fax number of the store.",
          "type": "string"
        },
        "id": {
          "minLength": 1,
          "maxLength": 256,
          "description": "The id of the store.",
          "type": "string"
        },
        "image": {
          "description": "The store image.",
          "type": "string"
        },
        "inventoryId": {
          "maxLength": 256,
          "description": "The inventory list id associated with this store.",
          "type": "string"
        },
        "latitude": {
          "$ref": "#/$defs/Latitude"
        },
        "longitude": {
          "$ref": "#/$defs/Longitude"
        },
        "name": {
          "description": "The store name.",
          "type": "string"
        },
        "phone": {
          "description": "The phone number of the store.",
          "type": "string"
        },
        "posEnabled": {
          "description": "Whether this store uses Store Point-of-Sale.",
          "type": "boolean"
        },
        "postalCode": {
          "description": "The postal code of the store.",
          "allOf": [
            {
              "$ref": "#/$defs/PostalCode"
            }
          ]
        },
        "stateCode": {
          "description": "The state code of the store.",
          "type": "string"
        },
        "storeEvents": {
          "description": "The store events.",
          "type": "string"
        },
        "storeHours": {
          "description": "The opening hours of the store.",
          "type": "string"
        },
        "storeLocatorEnabled": {
          "description": "Whether this store should show up in store locator results.",
          "type": "boolean"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "Total": {
      "default": 0,
      "minimum": 0,
      "format": "int32",
      "description": "The total number of hits that match the search's criteria. This can be greater than the number of results returned as search results are pagenated.",
      "type": "integer"
    }
  }
}