{
  "swagger": "2.0",
  "info": {
    "title": "Decision Making Service",
    "description": "API for RDG's Railcard Decision Making Service (DMS)",
    "version": "1"
  },
  "host": "api.nationalrail.co.uk",
  "basePath": "/api/v1/railcards/",
  "schemes": [
    "https"
  ],
  "paths": {
    "/preSignedUrl": {
      "get": {
        "operationId": "preSignedUrl",
        "description": "Gets a RDG AWS S3 object details to upload a DMS eligibility file (Pre-Signed URL)",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "fileKey",
            "description": "A new UUID with the file extension to represent the file to be uploaded e.g. 034f8b94-9868-4372-9055-755ec261f272.pdf",
            "required": true,
            "in": "query",
            "type": "string",
            "minLength": 38,
            "maxLength": 46
          },
          {
            "name": "Authorization",
            "description": "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
            "required": true,
            "in": "header",
            "type": "string"
          },
          {
            "name": "client_id",
            "description": "Client ID of the calling organisation",
            "required": true,
            "in": "header",
            "type": "string"
          },
          {
            "name": "User-Agent",
            "description": "String identyfing the user's software name and version",
            "required": true,
            "in": "header",
            "type": "string"
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved presigned URL details",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/PresignedUrlResponse"
            }
          },
          "400": {
            "description": "Bad request.",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          },
          "401": {
            "description": "Unauthorized request",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          },
          "403": {
            "description": "This request is forbidden",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/submitApplication": {
      "post": {
        "operationId": "submitApplication",
        "description": "Submits application information along with associated object keys for previously uploaded documents.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "description": "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
            "required": true,
            "in": "header",
            "type": "string"
          },
          {
            "name": "client_id",
            "description": "Client ID of the calling organisation",
            "required": true,
            "in": "header",
            "type": "string"
          },
          {
            "name": "User-Agent",
            "description": "String identifying the user's software name and version",
            "required": true,
            "in": "header",
            "type": "string"
          },
          {
            "x-amf-mediaType": "application/json",
            "in": "body",
            "name": "generated",
            "description": "Application details and uploaded documents",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SubmitApplicationRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Application submitted successfully",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/SubmitApplicationResponse"
            }
          },
          "400": {
            "description": "Bad Request - Invalid input parameters",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing authentication token",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/submitApplicationExternalDocuments": {
      "post": {
        "operationId": "submitApplicationExternalDocuments",
        "description": "Submits application information along with public URLs for non previously uploaded documents.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "Authorization",
            "description": "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
            "required": true,
            "in": "header",
            "type": "string"
          },
          {
            "name": "client_id",
            "description": "Client ID of the calling organisation",
            "required": true,
            "in": "header",
            "type": "string"
          },
          {
            "name": "User-Agent",
            "description": "String identifying the user's software name and version",
            "required": true,
            "in": "header",
            "type": "string"
          },
          {
            "x-amf-mediaType": "application/json",
            "in": "body",
            "name": "generated",
            "description": "Application details and uploaded documents",
            "required": true,
            "schema": {
              "$ref": "#/definitions/SubmitApplicationExternalDocumentsRequest"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Application submitted successfully",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/SubmitApplicationResponse"
            }
          },
          "400": {
            "description": "Bad Request - Invalid input parameters",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing authentication token",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/caseResponseWebhookRequest": {
      "post": {
        "operationId": "CaseResponseWebhookRequest",
        "description": "Details of the POST request which RDG will send to the Client once the case has been completed.\n The Client <b>must</b> provide RDG with an API endpoint to call which using the below specified security model will accept this request and respond appropriately.",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "X-Signature",
            "description": "HMAC-SHA256 signature of the requestbody.timestamp\n",
            "required": true,
            "in": "header",
            "type": "string"
          },
          {
            "name": "X-Timestamp",
            "description": "Unix epoch timestamp of the request with (e.g., 1753628785711).\n",
            "required": true,
            "in": "header",
            "type": "string"
          },
          {
            "x-amf-mediaType": "application/json",
            "in": "body",
            "name": "generated",
            "description": "Application details and uploaded documents.",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CaseResponseWebhook"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Webhook submitted successfully"
          },
          "400": {
            "description": "Bad Request - Invalid input parameters",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing HMAC signature",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          },
          "500": {
            "description": "Internal Server Error",
            "x-amf-mediaType": "application/json",
            "schema": {
              "$ref": "#/definitions/RDGError"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "RDGError": {
      "title": "RDG Error",
      "type": "object",
      "properties": {
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Error"
          }
        }
      }
    },
    "Error": {
      "type": "object",
      "required": [
        "code",
        "timestamp"
      ],
      "properties": {
        "code": {
          "title": "Error Code",
          "description": "A unique (by service) code for an error.",
          "example": {
            "strict": false,
            "value": "GBR_EXCEPTION_3001"
          },
          "type": "string"
        },
        "message": {
          "title": "Error Message",
          "description": "Short description of an error.",
          "example": {
            "strict": false,
            "value": "The specified railcard can not be found."
          },
          "type": "string"
        },
        "timestamp": {
          "title": "Error Timestamp",
          "description": "Timestamp of an error.",
          "example": {
            "strict": false,
            "value": "2021-05-14T14:39:38+00:00"
          },
          "type": "string",
          "format": "date-time"
        },
        "context": {
          "title": "Optional Error Context",
          "description": "Optional context in relation to the error.",
          "type": "string"
        }
      }
    },
    "PresignedUrlResponse": {
      "type": "object",
      "required": [
        "url"
      ],
      "properties": {
        "url": {
          "example": {
            "strict": false,
            "value": "https://url.uk.m.mimecastprotect.com/s/wTlcCjZw4C3YA8AC5i9img6e1?domain=9c039714-91ed-452d-bc2e-10296dc7950c.s3.eu-west-1.amazonaws.com"
          },
          "type": "string"
        }
      }
    },
    "SubmitApplicationRequest": {
      "type": "object",
      "required": [
        "applicationReference",
        "railcardType",
        "disabilityReasonCode",
        "disabilityDocumentTypeCode",
        "documents",
        "customerFirstname",
        "customerLastname",
        "customerAddressLine1",
        "customerCity",
        "customerCountry"
      ],
      "properties": {
        "applicationReference": {
          "description": "The order or application id reference from the TPR - alphanumeric",
          "example": {
            "strict": false,
            "value": "A1B2C3D4E5F6G7H8I9J"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 20
        },
        "railcardType": {
          "description": "This is to identify the duration of the railcard",
          "enum": [
            "DPRC 1 Year",
            "DPRC 3 Year"
          ],
          "example": {
            "strict": false,
            "value": "DPRC 1 Year"
          },
          "type": "string"
        },
        "disabilityReasonCode": {
          "description": "The specific reason of disability, based on a pre-seeded list of values:<br />\n- DR001: Receive a Disability Living Allowance (DLA) or Child Disability Payment (CDP)<br />\n- DR002: Receive Personal Independence Payments (PIP) or Adult Disability Payment (ADP)<br />\n- DR003: Are registered as having a visual impairment<br />\n- DR004: Are registered as deaf or use a hearing aid<br />\n- DR006: Receive Attendance Allowance or Pension Age Disability Payment (PADP)<br />\n- DR007: Receive Severe Disablement Allowance<br />\n- DR008: Receive War Pensioner?s Mobility Supplement<br />\n- DR009: Receive War or Service Disablement Pension for 80% or more disability<br />\n- DR010: Are buying or leasing a vehicle through the Motability scheme<br />\n- DR011: Receive Armed Forces Compensation Scheme (AFCS) benefit<br />\n- DR012: Receive Industrial Injuries Benefit for 20% degree of disablement or higher<br />\n- DR013: Are unable to drive on medical grounds (lasted or likely to last at least 12 months)<br />\n- DR014: Receive a Disabled Persons Bus Pass or a London Disabled Persons Freedom Pass<br />\n- DR015: Have an individual Blue Badge<br />\n- DR016: Are without speech<br />\n- DR017: Have epilepsy and receive drug treatment for this<br />\nDR018: Have an impairment or health condition that is long-term (lasted or likely to last at least 12 months) and causes significant barriers when using rail services<br />\n- DR019: Have a neurodivergence that is long-term (lasted or likely to last at least 12 months) and causes significant barriers when using rail services<br />",
          "enum": [
            "DR001",
            "DR002",
            "DR003",
            "DR004",
            "DR006",
            "DR007",
            "DR008",
            "DR009",
            "DR010",
            "DR011",
            "DR012",
            "DR013",
            "DR014",
            "DR015",
            "DR016",
            "DR017",
            "DR018",
            "DR019"
          ],
          "type": "string"
        },
        "disabilityDocumentTypeCode": {
          "description": "The specific category of disability documents, based on a pre-seeded list of values:<br />\n- DT001: A copy of your award letter showing receipt of Disability Living Allowance (DLA) or Child Disability Payment (CDP) in the past 12 months<br />\n- DT002: A copy of your award letter<br />\n- DT003: A copy of your Certificate of Visual Impairment (CVI), BP1 Certificate (Scotland) or BD8 certificate for being registered blind or partially-sighted<br />\n- DT004: A completed copy of our downloadable form that has been stamped by Social Services<br />\n- DT005: A copy of the front page of your NHS battery book, a copy of your dispensing prescription or other evidence that you are deaf or use a hearing aid from an official health provider or local authority<br />\n- DT009: A copy of the letter of approval from the Disabled Persons Railcard Appeals body<br />\n- DT010: A copy of your award letter showing receipt of Personal Independence Payment or Adult Disability Payment in the past 12 months<br />\n- DT011: A copy of your award letter showing receipt of Attendance Allowance or Pension Age Disability Payment in the last 12 months<br />\n- DT012: A copy of your award letter showing receipt of Severe Disablement Allowance in the last 12 months<br />\n- DT013: A copy of your award letter showing receipt of War Pensioner?s Mobility Supplement in the last 12 months<br />\n- DT014: A copy of your award letter showing receipt of War or Service Disablement Pension for 80% or more disability in the last 12 months<br />\n- DT015: A copy of your award letter showing you are currently in receipt of Armed Forces Compensation Scheme (AFCS) benefit<br />\n- DT016: A copy of your award letter showing you are currently in receipt of  Industrial Injuries Benefit for 20% degree of disablement or higher<br />\n- DT017: A copy of a letter from DVLA or a health professional stating you are unable to drive on medical grounds. Must be dated within last 2 years<br />\n- DT018: A copy of your Disabled Persons Bus Pass or London Disabled Persons Freedom Pass<br />\n- DT019: A copy of the back and front of your Blue Badge<br />\n- DT020: A document from a health professional showing you are without speech<br />\n- DT021: A copy of a document from a health professional showing you have epilepsy and a copy of your prescription for drugs<br />\n- DT022: A copy of your leasing agreement showing you are currently leasing a vehicle<br />\n- DT023: A report or letter from a health professional that helps explain your access needs. Must be on surgery/official headed paper, signed and stamped and dated within the last 2 years.<br />\n- DT024: Completed impact declaration form signed by a suitably qualified and regulated health or social care professional<br />",
          "enum": [
            "DT001",
            "DT002",
            "DT003",
            "DT004",
            "DT005",
            "DT006",
            "DT007",
            "DT008",
            "DT009",
            "DT010",
            "DT011",
            "DT012",
            "DT013",
            "DT014",
            "DT015",
            "DT016",
            "DT017",
            "DT018",
            "DT019",
            "DT020",
            "DT021",
            "DT022",
            "DT023",
            "DT024"
          ],
          "type": "string"
        },
        "documents": {
          "description": "List of documents uploaded",
          "type": "array",
          "items": {
            "$ref": "#/definitions/Document"
          }
        },
        "customerTitle": {
          "description": "Title of the customer",
          "example": {
            "strict": false,
            "value": "Mr"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 20
        },
        "customerFirstname": {
          "description": "Customer firstname",
          "example": {
            "strict": false,
            "value": "Sample"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 40
        },
        "customerLastname": {
          "description": "Customer surname",
          "example": {
            "strict": false,
            "value": "Person"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "customerAddressLine1": {
          "description": "Customer address (first line)",
          "example": {
            "strict": false,
            "value": "Apartment 20"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "customerAddressLine2": {
          "description": "2nd line of customer address (optional)",
          "example": {
            "strict": false,
            "value": "Floor 3"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "customerAddressLine3": {
          "description": "3rd line of customer address (optional)",
          "example": {
            "strict": false,
            "value": "49 Featherstone Street"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "customerCity": {
          "description": "City of customer address",
          "example": {
            "strict": false,
            "value": "London"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 40
        },
        "customerPostcode": {
          "description": "Postcode of customer address",
          "example": {
            "strict": false,
            "value": "EC1Y 8SY"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 20
        },
        "customerCountry": {
          "description": "Country of customer address",
          "example": {
            "strict": false,
            "value": "United Kingdom"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "customerEmail": {
          "description": "Email address for the customer",
          "example": {
            "strict": false,
            "value": "sample@testsystem.com"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      }
    },
    "SubmitApplicationExternalDocumentsRequest": {
      "type": "object",
      "required": [
        "applicationReference",
        "railcardType",
        "disabilityReasonCode",
        "disabilityDocumentTypeCode",
        "documents",
        "customerFirstname",
        "customerLastname",
        "customerAddressLine1",
        "customerCity",
        "customerCountry"
      ],
      "properties": {
        "applicationReference": {
          "description": "The order or application id reference from the TPR - alphanumeric",
          "example": {
            "strict": false,
            "value": "A1B2C3D4E5F6G7H8I9J"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 20
        },
        "railcardType": {
          "description": "This is to identify the duration of the railcard",
          "enum": [
            "DPRC 1 Year",
            "DPRC 3 Year"
          ],
          "example": {
            "strict": false,
            "value": "DPRC 1 Year"
          },
          "type": "string"
        },
        "disabilityReasonCode": {
          "description": "The specific reason of disability, based on a pre-seeded list of values:<br />\n- DR001: Receive a Disability Living Allowance (DLA) or Child Disability Payment (CDP)<br />\n- DR002: Receive Personal Independence Payments (PIP) or Adult Disability Payment (ADP)<br />\n- DR003: Are registered as having a visual impairment<br />\n- DR004: Are registered as deaf or use a hearing aid<br />\n- DR006: Receive Attendance Allowance or Pension Age Disability Payment (PADP)<br />\n- DR007: Receive Severe Disablement Allowance<br />\n- DR008: Receive War Pensioner?s Mobility Supplement<br />\n- DR009: Receive War or Service Disablement Pension for 80% or more disability<br />\n- DR010: Are buying or leasing a vehicle through the Motability scheme<br />\n- DR011: Receive Armed Forces Compensation Scheme (AFCS) benefit<br />\n- DR012: Receive Industrial Injuries Benefit for 20% degree of disablement or higher<br />\n- DR013: Are unable to drive on medical grounds (lasted or likely to last at least 12 months)<br />\n- DR014: Receive a Disabled Persons Bus Pass or a London Disabled Persons Freedom Pass<br />\n- DR015: Have an individual Blue Badge<br />\n- DR016: Are without speech<br />\n- DR017: Have epilepsy and receive drug treatment for this<br />\nDR018: Have an impairment or health condition that is long-term (lasted or likely to last at least 12 months) and causes significant barriers when using rail services<br />\n- DR019: Have a neurodivergence that is long-term (lasted or likely to last at least 12 months) and causes significant barriers when using rail services<br />",
          "enum": [
            "DR001",
            "DR002",
            "DR003",
            "DR004",
            "DR006",
            "DR007",
            "DR008",
            "DR009",
            "DR010",
            "DR011",
            "DR012",
            "DR013",
            "DR014",
            "DR015",
            "DR016",
            "DR017",
            "DR018",
            "DR019"
          ],
          "type": "string"
        },
        "disabilityDocumentTypeCode": {
          "description": "The specific category of disability documents, based on a pre-seeded list of values:<br />\n- DT001: A copy of your award letter showing receipt of Disability Living Allowance (DLA) or Child Disability Payment (CDP) in the past 12 months<br />\n- DT002: A copy of your award letter<br />\n- DT003: A copy of your Certificate of Visual Impairment (CVI), BP1 Certificate (Scotland) or BD8 certificate for being registered blind or partially-sighted<br />\n- DT004: A completed copy of our downloadable form that has been stamped by Social Services<br />\n- DT005: A copy of the front page of your NHS battery book, a copy of your dispensing prescription or other evidence that you are deaf or use a hearing aid from an official health provider or local authority<br />\n- DT009: A copy of the letter of approval from the Disabled Persons Railcard Appeals body<br />\n- DT010: A copy of your award letter showing receipt of Personal Independence Payment or Adult Disability Payment in the past 12 months<br />\n- DT011: A copy of your award letter showing receipt of Attendance Allowance or Pension Age Disability Payment in the last 12 months<br />\n- DT012: A copy of your award letter showing receipt of Severe Disablement Allowance in the last 12 months<br />\n- DT013: A copy of your award letter showing receipt of War Pensioner?s Mobility Supplement in the last 12 months<br />\n- DT014: A copy of your award letter showing receipt of War or Service Disablement Pension for 80% or more disability in the last 12 months<br />\n- DT015: A copy of your award letter showing you are currently in receipt of Armed Forces Compensation Scheme (AFCS) benefit<br />\n- DT016: A copy of your award letter showing you are currently in receipt of  Industrial Injuries Benefit for 20% degree of disablement or higher<br />\n- DT017: A copy of a letter from DVLA or a health professional stating you are unable to drive on medical grounds. Must be dated within last 2 years<br />\n- DT018: A copy of your Disabled Persons Bus Pass or London Disabled Persons Freedom Pass<br />\n- DT019: A copy of the back and front of your Blue Badge<br />\n- DT020: A document from a health professional showing you are without speech<br />\n- DT021: A copy of a document from a health professional showing you have epilepsy and a copy of your prescription for drugs<br />\n- DT022: A copy of your leasing agreement showing you are currently leasing a vehicle<br />\n- DT023: A report or letter from a health professional that helps explain your access needs. Must be on surgery/official headed paper, signed and stamped and dated within the last 2 years.<br />\n- DT024: Completed impact declaration form signed by a suitably qualified and regulated health or social care professional<br />",
          "enum": [
            "DT001",
            "DT002",
            "DT003",
            "DT004",
            "DT005",
            "DT006",
            "DT007",
            "DT008",
            "DT009",
            "DT010",
            "DT011",
            "DT012",
            "DT013",
            "DT014",
            "DT015",
            "DT016",
            "DT017",
            "DT018",
            "DT019",
            "DT020",
            "DT021",
            "DT022",
            "DT023",
            "DT024"
          ],
          "type": "string"
        },
        "documents": {
          "description": "List of documents uploaded",
          "type": "array",
          "items": {
            "$ref": "#/definitions/ExternalDocument"
          }
        },
        "customerTitle": {
          "description": "Title of the customer",
          "example": {
            "strict": false,
            "value": "Mr"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 20
        },
        "customerFirstname": {
          "description": "Customer firstname",
          "example": {
            "strict": false,
            "value": "Sample"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 40
        },
        "customerLastname": {
          "description": "Customer surname",
          "example": {
            "strict": false,
            "value": "Person"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "customerAddressLine1": {
          "description": "Customer address (first line)",
          "example": {
            "strict": false,
            "value": "Apartment 20"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "customerAddressLine2": {
          "description": "2nd line of customer address (optional)",
          "example": {
            "strict": false,
            "value": "Floor 3"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "customerAddressLine3": {
          "description": "3rd line of customer address (optional)",
          "example": {
            "strict": false,
            "value": "49 Featherstone Street"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "customerCity": {
          "description": "City of customer address",
          "example": {
            "strict": false,
            "value": "London"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 40
        },
        "customerPostcode": {
          "description": "Postcode of customer address",
          "example": {
            "strict": false,
            "value": "EC1Y 8SY"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 20
        },
        "customerCountry": {
          "description": "Country of customer address",
          "example": {
            "strict": false,
            "value": "United Kingdom"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "customerEmail": {
          "description": "Email address for the customer",
          "example": {
            "strict": false,
            "value": "sample@testsystem.com"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      }
    },
    "Document": {
      "type": "object",
      "required": [
        "fileKey",
        "extension"
      ],
      "properties": {
        "fileKey": {
          "description": "The file key provided by the presigned URL interface",
          "example": {
            "strict": false,
            "value": "024788be-f43b-4a55-aa0a-2924bd9f58ae.pdf"
          },
          "type": "string",
          "minLength": 38,
          "maxLength": 46
        },
        "extension": {}
      }
    },
    "ExternalDocument": {
      "type": "object",
      "required": [
        "URI"
      ],
      "properties": {
        "URI": {
          "description": "The full URI of the location of the file in the S3 bucket with any presigned details needed to access",
          "example": {
            "strict": false,
            "value": "https://url.uk.m.mimecastprotect.com/s/oz7rClxy4HA1kxkH1t3iz1XdB?domain=rdg-dms-test.s3.eu-west-1.amazonaws.com"
          },
          "type": "string"
        }
      }
    },
    "SubmitApplicationResponse": {
      "type": "object",
      "required": [
        "caseNumber",
        "caseCreationDateTime"
      ],
      "properties": {
        "caseNumber": {
          "example": {
            "strict": false,
            "value": "12345678"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 10
        },
        "caseCreationDateTime": {
          "example": {
            "strict": false,
            "value": "2024-02-15T14:12:56Z"
          },
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "CaseResponseWebhook": {
      "type": "object",
      "required": [
        "applicationReference",
        "caseNumber",
        "caseDecision",
        "decisionDateTime"
      ],
      "properties": {
        "applicationReference": {
          "description": "The order or application id reference from the TPR - alphanumeric",
          "example": {
            "strict": false,
            "value": "A1B2C3D4E5F6G7H8I9J"
          },
          "type": "string",
          "maxLength": 20
        },
        "caseNumber": {
          "description": "The number of the DMS case, not left padded with zeros",
          "example": {
            "strict": false,
            "value": "12345678"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 10
        },
        "caseDecision": {
          "description": "Will contain either 'Approved' or 'Declined' depending on outcome of application",
          "enum": [
            "Approved",
            "Declined"
          ],
          "example": {
            "strict": false,
            "value": "Approved"
          },
          "type": "string"
        },
        "rejectionResponse": {
          "description": "This block is mandatory if the CaseDecision is 'Declined'",
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/definitions/rejectionResponseDetails"
          }
        },
        "decisionDateTime": {
          "description": "The date and time of the case decision in the format: YYYY-MM-DDTHH:MI:SSZ. Used as the start time of the SLA for the DMS service",
          "example": {
            "strict": false,
            "value": "2024-02-15T14:12:56Z"
          },
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "rejectionResponseDetails": {
      "description": "This block is mandatory if the CaseDecision is 'Declined'",
      "type": "object",
      "required": [
        "rejectionReasonCode",
        "rejectionReason"
      ],
      "properties": {
        "rejectionReasonCode": {
          "description": "The rejecton reason code, based on a pre-seeded list of values:<br />\n- RR001: The document cannot be read clearly<br/>\n- RR002: The document looks valid, however pages or sections with the information required to prove eligibility have not been provided<br/>\n- RR003: The document uploaded does not show your name or is not in the name of the applicant<br/>\n- RR004: The document is not dated within the past 12 months as required by the eligibility criteria<br/>\n- RR005: Multiple documents are required to prove eligibility and not all documents have been submitted<br/>\n- RR006: The address and/or personal details listed on your documents do not match those provided to us on your Railcard application form<br/>\n- RR007: Your disability/condition does not meet the eligibility criteria for a Disabled Persons Railcard<br/>\n- RR008: You have provided evidence of Disability Living Allowance / Child Disability Payment however it is not at the rate required to meet the eligibility criteria<br/>\n- RR009: The evidence provided is not on the list of accepted documents for your disability/condition\n- RR010: The Social Services official stamp required to prove eligibility for your disability/condition is missing\n- RR011: You have not uploaded both the front and back of your Blue Badge\n- RR012: Your Bus Pass / Freedom Pass is not specifically a Disabled Persons Bus Pass / Freedom Pass\n- RR013: The Blue Badge has expired\n- RR014: The Bus Pass / Freedom Pass has expired\n- RR015: The document does not show the dates of your award or is not dated within the last 12 months\n- RR016: The health declaration form is not fully complete\n- RR017: The health declaration form is not signed by relevant health or social care professional\n- RR018: The report or letter is not on official headed paper and / or signed / stamped / dated within the last 2 years\n- RR019: The report or letter does not clearly show that you experience significant disability-related barriers to rail travel",
          "enum": [
            "RR001",
            "RR002",
            "RR003",
            "RR004",
            "RR005",
            "RR006",
            "RR007",
            "RR008",
            "RR009",
            "RR010",
            "RR011",
            "RR012",
            "RR013",
            "RR014",
            "RR015",
            "RR016",
            "RR017",
            "RR018",
            "RR019"
          ],
          "type": "string"
        },
        "rejectionReason": {
          "example": {
            "strict": false,
            "value": "The document cannot be read clearly"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "furtherComments": {
          "example": {
            "strict": false,
            "value": "The content of the document cannot be read as it is too blurry"
          },
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      }
    }
  },
  "securityDefinitions": {
    "bearerAuth": {
      "type": "apiKey",
      "description": "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
      "x-amf-describedBy": {
        "headers": {
          "Authorization?": {
            "type": "any"
          }
        }
      }
    }
  }
}