{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rctp.dev/schemas/error.schema.json",
  "title": "Error",
  "description": "Body of every refusal (one registered reason, Draft 0.5 section 13) and of protocol errors (binding 6). A below_floor refusal carries no private value: never the floor (INV-1).",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "reason": {
          "$ref": "common.schema.json#/$defs/Reason"
        },
        "action": {
          "$ref": "common.schema.json#/$defs/Action"
        },
        "retry_after": {
          "type": "integer",
          "minimum": 0
        },
        "approval_id": {
          "$ref": "common.schema.json#/$defs/ApprovalId"
        },
        "offer_id": {
          "$ref": "common.schema.json#/$defs/OfferId"
        },
        "message": {
          "type": "string",
          "maxLength": 500
        }
      },
      "additionalProperties": false,
      "required": [
        "reason"
      ],
      "title": "Refusal"
    },
    {
      "type": "object",
      "properties": {
        "error": {
          "type": "string",
          "enum": [
            "invalid_request",
            "not_found",
            "unsupported_version",
            "idempotency_conflict",
            "unavailable"
          ]
        },
        "message": {
          "type": "string",
          "maxLength": 500
        }
      },
      "additionalProperties": false,
      "required": [
        "error"
      ],
      "title": "ProtocolError"
    }
  ]
}
