{
	"swagger": "2.0",
	"info": {
		"title": "passenger-assist",
		"version": "v1"
	},
	"paths": {
		"/passengerAssist": {},
		"/passengerAssist/profiles": {
			"x-amf-description": "Verify if an account exists in PA for a given customer email. If it does it will additionally include information about wheelchair/scooter usage.",
			"get": {
				"description": "Retrieves passenger profiles",
				"produces": [
					"application/json"
				],
				"parameters": [
					{
						"name": "email",
						"description": "Email address for the profile",
						"required": true,
						"in": "query",
						"type": "string"
					},
					{
						"name": "Authorization",
						"description": "Bearer",
						"required": true,
						"in": "header",
						"type": "string"
					},
					{
						"name": "client_id",
						"description": "Security token to access API on Anypoint Platform\n",
						"required": true,
						"in": "header",
						"type": "string"
					},
					{
						"name": "X-Correlation-Cust-Id",
						"description": "Unique client reference id that can be traced if supplied",
						"required": false,
						"in": "header",
						"type": "string"
					},
					{
						"name": "Accept-Encoding",
						"description": "The Accept-Encoding request HTTP header indicates the content encoding that the client can understand",
						"required": false,
						"in": "header",
						"type": "string"
					}
				],
				"responses": {
					"200": {
						"description": "",
						"headers": {
							"X-Correlation-Cust-Id": {
								"x-amf-required": false,
								"description": "Unique client reference id that can be traced through integration layer and is returned in the response (if supplied)",
								"type": "string"
							},
							"X-Correlation-Id": {
								"x-amf-required": false,
								"description": "Unique client reference, generated by the integration layer, sent through to the back-end and returned in the response",
								"type": "string"
							}
						},
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/profiles"
						}
					},
					"400": {
						"description": "Token was not provided.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error400"
						}
					},
					"401": {
						"description": "Bad or expired token. To fix, you should re-authenticate the user.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error401"
						}
					},
					"404": {
						"description": "The client id validation failed.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error404"
						}
					},
					"422": {
						"description": "The client id validation failed.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error422"
						}
					},
					"500": {
						"description": "Error communicating with JWKS server.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error500"
						}
					}
				},
				"x-amf-security": [
					{
						"jwt_pass_through": []
					}
				]
			}
		},
		"/passengerAssist/journeyAssistances": {
			"get": {
				"description": "Retrieves all the journey assistances",
				"produces": [
					"application/json"
				],
				"parameters": [
					{
						"name": "Authorization",
						"description": "Bearer",
						"required": true,
						"in": "header",
						"type": "string"
					},
					{
						"name": "client_id",
						"description": "Security token to access API on Anypoint Platform\n",
						"required": true,
						"in": "header",
						"type": "string"
					},
					{
						"name": "X-Correlation-Cust-Id",
						"description": "Unique client reference id that can be traced if supplied",
						"required": false,
						"in": "header",
						"type": "string"
					},
					{
						"name": "Accept-Encoding",
						"description": "The Accept-Encoding request HTTP header indicates the content encoding that the client can understand",
						"required": false,
						"in": "header",
						"type": "string"
					}
				],
				"responses": {
					"200": {
						"description": "",
						"headers": {
							"X-Correlation-Cust-Id": {
								"x-amf-required": false,
								"description": "Unique client reference id that can be traced through integration layer and is returned in the response (if supplied)",
								"type": "string"
							},
							"X-Correlation-Id": {
								"x-amf-required": false,
								"description": "Unique client reference, generated by the integration layer, sent through to the back-end and returned in the response",
								"type": "string"
							}
						},
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/journeyAssistances"
						}
					},
					"400": {
						"description": "Token was not provided.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error400"
						}
					},
					"401": {
						"description": "Bad or expired token. To fix, you should re-authenticate the user.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error401"
						}
					},
					"404": {
						"description": "The client id validation failed.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error404"
						}
					},
					"422": {
						"description": "The client id validation failed.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error422"
						}
					},
					"500": {
						"description": "Error communicating with JWKS server.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error500"
						}
					}
				},
				"x-amf-security": [
					{
						"jwt_pass_through": []
					}
				]
			}
		},
		"/passengerAssist/bookings": {
			"post": {
				"description": "Creates a booking in Passenger Assist system. Looks up the reservation booking and inserts reservation details, if found. Returns Passenger Assist booking reference and first operator on the journey.",
				"consumes": [
					"application/json"
				],
				"produces": [
					"application/json"
				],
				"parameters": [
					{
						"name": "Authorization",
						"description": "Bearer",
						"required": true,
						"in": "header",
						"type": "string"
					},
					{
						"name": "client_id",
						"description": "Security token to access API on Anypoint Platform\n",
						"required": true,
						"in": "header",
						"type": "string"
					},
					{
						"name": "X-Correlation-Cust-Id",
						"description": "Unique client reference id that can be traced if supplied",
						"required": false,
						"in": "header",
						"type": "string"
					},
					{
						"name": "Accept-Encoding",
						"description": "The Accept-Encoding request HTTP header indicates the content encoding that the client can understand",
						"required": false,
						"in": "header",
						"type": "string"
					},
					{
						"x-amf-mediaType": "application/json",
						"in": "body",
						"name": "generated",
						"schema": {
							"$ref": "#/definitions/bookings"
						}
					}
				],
				"responses": {
					"201": {
						"description": "",
						"headers": {
							"X-Correlation-Cust-Id": {
								"x-amf-required": false,
								"description": "Unique client reference id that can be traced through integration layer and is returned in the response (if supplied)",
								"type": "string"
							},
							"X-Correlation-Id": {
								"x-amf-required": false,
								"description": "Unique client reference, generated by the integration layer, sent through to the back-end and returned in the response",
								"type": "string"
							}
						},
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/bookingsResponse"
						}
					},
					"400": {
						"description": "Token was not provided.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error400"
						}
					},
					"401": {
						"description": "Bad or expired token. To fix, you should re-authenticate the user.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error401"
						}
					},
					"404": {
						"description": "The client id validation failed.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error404"
						}
					},
					"422": {
						"description": "The client id validation failed.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error422"
						}
					},
					"500": {
						"description": "Error communicating with JWKS server.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error500"
						}
					}
				},
				"x-amf-security": [
					{
						"jwt_pass_through": []
					}
				]
			}
		},
		"/passengerAssist/bookings/{bookingReference}": {
			"parameters": [
				{
					"name": "bookingReference",
					"required": true,
					"in": "path",
					"type": "string"
				}
			]
		},
		"/passengerAssist/bookings/{bookingReference}/status": {
			"put": {
				"description": "The system will attempt to cancel the booking",
				"consumes": [
					"application/json"
				],
				"produces": [
					"application/json"
				],
				"parameters": [
					{
						"name": "bookingReference",
						"required": true,
						"in": "path",
						"type": "string"
					},
					{
						"name": "Authorization",
						"description": "Bearer",
						"required": true,
						"in": "header",
						"type": "string"
					},
					{
						"name": "client_id",
						"description": "Security token to access API on Anypoint Platform\n",
						"required": true,
						"in": "header",
						"type": "string"
					},
					{
						"name": "X-Correlation-Cust-Id",
						"description": "Unique client reference id that can be traced if supplied",
						"required": false,
						"in": "header",
						"type": "string"
					},
					{
						"name": "Accept-Encoding",
						"description": "The Accept-Encoding request HTTP header indicates the content encoding that the client can understand",
						"required": false,
						"in": "header",
						"type": "string"
					},
					{
						"x-amf-mediaType": "application/json",
						"in": "body",
						"name": "generated",
						"schema": {
							"$ref": "#/definitions/bookingsStatus"
						}
					}
				],
				"responses": {
					"204": {
						"description": "",
						"headers": {
							"X-Correlation-Cust-Id": {
								"x-amf-required": false,
								"description": "Unique client reference id that can be traced through integration layer and is returned in the response (if supplied)",
								"type": "string"
							},
							"X-Correlation-Id": {
								"x-amf-required": false,
								"description": "Unique client reference, generated by the integration layer, sent through to the back-end and returned in the response",
								"type": "string"
							}
						}
					},
					"400": {
						"description": "Token was not provided.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error400"
						}
					},
					"401": {
						"description": "Bad or expired token. To fix, you should re-authenticate the user.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error401"
						}
					},
					"404": {
						"description": "The client id validation failed.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error404"
						}
					},
					"422": {
						"description": "The client id validation failed.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error422"
						}
					},
					"500": {
						"description": "Error communicating with JWKS server.",
						"x-amf-mediaType": "application/json",
						"schema": {
							"$ref": "#/definitions/Error500"
						}
					}
				},
				"x-amf-security": [
					{
						"jwt_pass_through": []
					}
				]
			}
		}
	},
	"definitions": {
		"profiles": {
			"title": "profiles",
			"description": "profiles Canonical Data Model",
			"x-amf-examples": {
				"profilesExample": {
					"email": "somebody@example.com",
					"accessConsiderations": {
						"wheelchairUser": true
					}
				}
			},
			"type": "object",
			"required": [
				"email",
				"accessConsiderations"
			],
			"properties": {
				"email": {
					"type": "string",
					"maxLength": 256
				},
				"accessConsiderations": {
					"type": "object",
					"required": [
						"wheelchairUser"
					],
					"properties": {
						"wheelchairUser": {
							"type": "boolean"
						}
					}
				}
			}
		},
		"Error400": {
			"title": "RDG Error Object for 400 error code",
			"type": "object",
			"properties": {
				"errors": {
					"example": [
						{
							"code": "GBR_EXCEPTION_3000",
							"message": "Invalid schema/ Invalid payload",
							"timestamp": "2024-07-22T17:21:28.141Z"
						}
					],
					"type": "array"
				}
			}
		},
		"Error401": {
			"title": "RDG Error Object for 401 error code",
			"type": "object",
			"properties": {
				"errors": {
					"example": [
						{
							"code": "GBR-AUTH-2001",
							"message": "Unauthorised User",
							"timestamp": "2024-07-24T11:19:43.537Z"
						}
					],
					"type": "array"
				}
			}
		},
		"Error404": {
			"title": "RDG Error Object for 404 error code",
			"type": "object",
			"properties": {
				"errors": {
					"example": [
						{
							"code": "GBR_PA_6300",
							"message": "Booking Not Found",
							"timestamp": "2024-07-24T11:19:43.537Z"
						}
					],
					"type": "array"
				}
			}
		},
		"Error422": {
			"title": "RDG Error Object for 422 error code",
			"type": "object",
			"properties": {
				"errors": {
					"example": [
						{
							"code": "GBR_PA_6302",
							"message": "Unable to cancel Booking, journey is in progress",
							"timestamp": "2024-07-24T11:19:43.537Z"
						}
					],
					"type": "array"
				}
			}
		},
		"Error500": {
			"title": "RDG Error Object for 500 error code",
			"type": "object",
			"properties": {
				"errors": {
					"example": [
						{
							"code": "GBR_EXCEPTION_3068",
							"message": "Internal server error",
							"timestamp": "2024-07-22T17:21:28.141Z"
						}
					],
					"type": "array"
				}
			}
		},
		"journeyAssistances": {
			"type": "object",
			"required": [
				"journeyAssistances"
			],
			"properties": {
				"journeyAssistances": {
					"type": "array",
					"items": {
						"type": "object",
						"required": [
							"code",
							"description"
						],
						"properties": {
							"code": {
								"example": "use_of_ramp",
								"type": "string",
								"maxLength": 256
							},
							"description": {
								"example": "Use of ramp",
								"type": "string",
								"maxLength": 256
							}
						}
					}
				}
			}
		},
		"bookings": {
			"title": "bookings",
			"description": "bookings Canonical Data Model",
			"type": "object",
			"required": [
				"email"
			],
			"properties": {
				"email": {
					"example": "user@example.com",
					"type": "string",
					"minLength": 3,
					"maxLength": 256
				},
				"outboundJourney": {
					"type": "object",
					"required": [
						"journeyLeg"
					],
					"properties": {
						"journeyLeg": {
							"type": "array",
							"maxItems": 20,
							"minItems": 1,
							"items": {
								"$ref": "#/definitions/type"
							}
						}
					}
				},
				"inboundJourney": {
					"type": "object",
					"required": [
						"journeyLeg"
					],
					"properties": {
						"journeyLeg": {
							"type": "array",
							"maxItems": 20,
							"minItems": 1,
							"items": {
								"$ref": "#/definitions/type"
							}
						}
					}
				}
			}
		},
		"bookingsResponse": {
			"title": "bookingsResponse",
			"description": "bookingsResponse Canonical Data Model",
			"x-amf-examples": {
				"bookingsExample": {
					"bookingRef": "PA1234567",
					"firstOperator": {
						"name": "First Operator",
						"email": "help@first_op.com",
						"phone": "0208 123 4567"
					}
				}
			},
			"type": "object",
			"required": [
				"bookingRef",
				"firstOperator"
			],
			"properties": {
				"bookingRef": {
					"type": "string",
					"minLength": 8,
					"maxLength": 20
				},
				"firstOperator": {
					"type": "object",
					"required": [
						"name",
						"email",
						"phone"
					],
					"properties": {
						"name": {
							"type": "string",
							"minLength": 1,
							"maxLength": 256
						},
						"email": {
							"type": "string",
							"minLength": 3,
							"maxLength": 256
						},
						"phone": {
							"type": "string",
							"minLength": 1,
							"maxLength": 256
						}
					}
				}
			}
		},
		"bookingsStatus": {
			"title": "bookingsStatus",
			"description": "bookingsStatus Canonical Data Model",
			"type": "object",
			"required": [
				"status"
			],
			"properties": {
				"status": {
					"enum": [
						"CANCEL"
					],
					"example": "CANCEL",
					"type": "string"
				}
			}
		},
		"type": {
			"title": "journeyLeg",
			"description": "journeyLeg Canonical Data Model",
			"type": "object",
			"required": [
				"boardLocation",
				"departureDateTime",
				"alightLocation",
				"arrivalDateTime",
				"travelMode",
				"journeyAssistances"
			],
			"properties": {
				"boardLocation": {
					"example": "YRK",
					"type": "string",
					"pattern": "^[0-9A-Z]{3}$",
					"minLength": 3,
					"maxLength": 3
				},
				"departureDateTime": {
					"example": "2024-07-22T17:21:28.141Z",
					"type": "string"
				},
				"alightLocation": {
					"example": "PAD",
					"type": "string",
					"pattern": "^[0-9A-Z]{3}$",
					"minLength": 3,
					"maxLength": 3
				},
				"arrivalDateTime": {
					"example": "2024-07-22T21:36:28.141Z",
					"type": "string"
				},
				"rsid": {
					"example": "AB123400",
					"type": "string",
					"pattern": "^[A-Z]{2}[0-9]{6}$",
					"minLength": 8,
					"maxLength": 8
				},
				"travelMode": {
					"enum": [
						"SCHEDULED_BUS",
						"REPLACEMENT_BUS",
						"TRAIN",
						"FERRY",
						"WALK",
						"UNDERGROUND",
						"TAXI",
						"METRO",
						"TRAMLINK",
						"PLATFORM_CHANGE",
						"CHECK_IN_TIME",
						"HOVERCRAFT",
						"TRANSFER",
						"TRAM",
						"DLR",
						"LU",
						"DLR_LU",
						"WALK_TUBE",
						"WALK_DLR",
						"WALK_TUBE_DLR"
					],
					"example": "TRAIN",
					"type": "string"
				},
				"journeyAssistances": {
					"example": [
						"use_of_ramp"
					],
					"type": "array",
					"maxItems": 100,
					"minItems": 1
				},
				"otherAssistanceDetails": {
					"example": "string",
					"type": "string",
					"minLength": 1,
					"maxLength": 100
				},
				"luggages": {
					"enum": [
						[
							"SMALL"
						],
						[
							"MEDIUM"
						],
						[
							"LARGE"
						]
					],
					"example": [
						"SMALL"
					],
					"type": "array",
					"maxItems": 3,
					"minItems": 1
				},
				"reservationBookingRef": {
					"example": "TF288067",
					"type": "string",
					"maxLength": 16
				}
			}
		}
	},
	"x-amf-securitySchemes": {
		"jwt_pass_through": {
			"type": "Pass Through",
			"description": "JWT pass-through",
			"x-amf-describedBy": {
				"headers": {
					"Authorization": {
						"required": true,
						"type": "string"
					}
				}
			}
		}
	}
}