{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.1.0-beta.5/core/webhook-challenge-response.json",
  "title": "Webhook Challenge Response",
  "description": "Response body a receiver returns to prove control of an account-level notification_configs[] URL. The receiver must echo the challenge value from webhook-challenge.json in exactly one of `challenge` or `token`.",
  "type": "object",
  "properties": {
    "challenge": {
      "type": "string",
      "description": "Echo of the challenge value supplied by the seller.",
      "minLength": 32,
      "maxLength": 255,
      "pattern": "^[A-Za-z0-9_.:-]{32,255}$"
    },
    "token": {
      "type": "string",
      "description": "Backward-compatible alias for `challenge`. Receivers SHOULD prefer `challenge`; sellers MUST accept either field.",
      "minLength": 32,
      "maxLength": 255,
      "pattern": "^[A-Za-z0-9_.:-]{32,255}$"
    }
  },
  "anyOf": [
    {
      "required": [
        "challenge"
      ]
    },
    {
      "required": [
        "token"
      ]
    }
  ],
  "not": {
    "required": [
      "challenge",
      "token"
    ]
  },
  "additionalProperties": false,
  "examples": [
    {
      "description": "Preferred response shape",
      "data": {
        "challenge": "example-challenge-token-000000000000"
      }
    },
    {
      "description": "Backward-compatible response shape",
      "data": {
        "token": "example-challenge-token-000000000000"
      }
    }
  ]
}
