{"openapi":"3.0.3","info":{"title":"AirCargoBooking BFF API","description":"Air Cargo Booking Back For Frontend API","termsOfService":"http://swagger.io/terms/","contact":{"email":"apiteam@swagger.io"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"version":"1.0.0"},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/devperrebser/aaa/1.0.0"},{"url":"http://localhost:8092/aircargobooking"}],"tags":[{"name":"Airports","description":"Airports API"},{"name":"Products","description":"Products API"},{"name":"Shipments","description":"Shipments API"},{"name":"Airlines","description":"Airlines API"}],"paths":{"/api/airports":{"get":{"tags":["Airports"],"summary":"Get airports by Name or Airport Code","description":"Get airports with name or code that contains the given parameter (ignore case)","operationId":"getAirportsByNameOrCode","parameters":[{"$ref":"#/components/parameters/stringQParam"},{"$ref":"#/components/parameters/includeAirportCodeQParam"},{"$ref":"#/components/parameters/langParam"}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AirportList"}}}},"400":{"$ref":"#/components/responses/400BadRequestError"},"401":{"$ref":"#/components/responses/401UnauthorizedError"},"403":{"$ref":"#/components/responses/403ForbiddenError"},"404":{"$ref":"#/components/responses/404NotFoundError"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailableError"},"504":{"$ref":"#/components/responses/504GatewayTimeOut"}}}},"/api/airports/{code}":{"get":{"tags":["Airports"],"summary":"Get airport by code","description":"Get airport by code (ignore case)","operationId":"getAirportByCode","parameters":[{"$ref":"#/components/parameters/codePathParam"},{"$ref":"#/components/parameters/langParam"}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Airport"}}}},"400":{"$ref":"#/components/responses/400BadRequestError"},"401":{"$ref":"#/components/responses/401UnauthorizedError"},"403":{"$ref":"#/components/responses/403ForbiddenError"},"404":{"$ref":"#/components/responses/404NotFoundError"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailableError"},"504":{"$ref":"#/components/responses/504GatewayTimeOut"}}},"put":{"tags":["Airports"],"summary":"Add new airport","description":"Add new airport","operationId":"addNewAirport","parameters":[{"$ref":"#/components/parameters/codePathParam"},{"$ref":"#/components/parameters/langParam"}],"requestBody":{"description":"Airport to be added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Airport"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Airport"}}}},"400":{"$ref":"#/components/responses/400BadRequestError"},"401":{"$ref":"#/components/responses/401UnauthorizedError"},"403":{"$ref":"#/components/responses/403ForbiddenError"},"404":{"$ref":"#/components/responses/404NotFoundError"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailableError"},"504":{"$ref":"#/components/responses/504GatewayTimeOut"}}},"delete":{"tags":["Airports"],"summary":"Delete airport","description":"Delete airport by code (ignore case)","operationId":"deleteAirport","parameters":[{"$ref":"#/components/parameters/codePathParam"}],"responses":{"200":{"description":"Successful operation"},"400":{"$ref":"#/components/responses/400BadRequestError"},"401":{"$ref":"#/components/responses/401UnauthorizedError"},"403":{"$ref":"#/components/responses/403ForbiddenError"},"404":{"$ref":"#/components/responses/404NotFoundError"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailableError"},"504":{"$ref":"#/components/responses/504GatewayTimeOut"}}}},"/api/products":{"get":{"tags":["Products"],"summary":"Get avaliable products","description":"Get all the products that are avaliable. \"-\" will be set as name if the product has no name in the given language.","operationId":"getAvaliableProducts","parameters":[{"$ref":"#/components/parameters/langParam"}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductList"}}}},"400":{"$ref":"#/components/responses/400BadRequestError"},"401":{"$ref":"#/components/responses/401UnauthorizedError"},"403":{"$ref":"#/components/responses/403ForbiddenError"},"404":{"$ref":"#/components/responses/404NotFoundError"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailableError"},"504":{"$ref":"#/components/responses/504GatewayTimeOut"}}},"put":{"tags":["Products"],"summary":"Add new products","description":"Add new products and update if they already exists","operationId":"upsertProducts","parameters":[{"$ref":"#/components/parameters/langParam"}],"requestBody":{"description":"Product to be added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductList"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductList"}}}},"400":{"$ref":"#/components/responses/400BadRequestError"},"401":{"$ref":"#/components/responses/401UnauthorizedError"},"403":{"$ref":"#/components/responses/403ForbiddenError"},"404":{"$ref":"#/components/responses/404NotFoundError"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailableError"},"504":{"$ref":"#/components/responses/504GatewayTimeOut"}}}},"/api/products/{code}":{"delete":{"tags":["Products"],"summary":"Delete product by code","description":"Delete product by code (ignore case)","operationId":"deleteProduct","parameters":[{"$ref":"#/components/parameters/codePathParam"}],"responses":{"200":{"description":"Successful operation"},"400":{"$ref":"#/components/responses/400BadRequestError"},"401":{"$ref":"#/components/responses/401UnauthorizedError"},"403":{"$ref":"#/components/responses/403ForbiddenError"},"404":{"$ref":"#/components/responses/404NotFoundError"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailableError"},"504":{"$ref":"#/components/responses/504GatewayTimeOut"}}}},"/api/product-types":{"get":{"tags":["Products"],"summary":"Get products types","description":"Get avaliable products types and their categories","operationId":"getProductTypes","parameters":[{"$ref":"#/components/parameters/langParam"}],"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductTypeList"}}}},"400":{"$ref":"#/components/responses/400BadRequestError"},"401":{"$ref":"#/components/responses/401UnauthorizedError"},"403":{"$ref":"#/components/responses/403ForbiddenError"},"404":{"$ref":"#/components/responses/404NotFoundError"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailableError"},"504":{"$ref":"#/components/responses/504GatewayTimeOut"}}},"put":{"tags":["Products"],"summary":"Add/Update merchandise types","description":"Add/Update merchandise types for the given language","operationId":"upsertProductTypes","parameters":[{"$ref":"#/components/parameters/langParam"}],"requestBody":{"description":"Merchandise types to be added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductTypeList"}}}},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductTypeList"}}}},"400":{"$ref":"#/components/responses/400BadRequestError"},"401":{"$ref":"#/components/responses/401UnauthorizedError"},"403":{"$ref":"#/components/responses/403ForbiddenError"},"404":{"$ref":"#/components/responses/404NotFoundError"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailableError"},"504":{"$ref":"#/components/responses/504GatewayTimeOut"}}}},"/api/product-types/{code}":{"delete":{"tags":["Products"],"summary":"Delete product type","description":"Delete product type by code (ignore case)","operationId":"deleteProductType","parameters":[{"$ref":"#/components/parameters/codePathParam"}],"responses":{"200":{"description":"Successful operation"},"400":{"$ref":"#/components/responses/400BadRequestError"},"401":{"$ref":"#/components/responses/401UnauthorizedError"},"403":{"$ref":"#/components/responses/403ForbiddenError"},"404":{"$ref":"#/components/responses/404NotFoundError"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailableError"},"504":{"$ref":"#/components/responses/504GatewayTimeOut"}}}},"/api/shipments/airlines":{"post":{"tags":["Shipments"],"summary":"Get avaliable shipments for the provided data.","description":"Get avaliable shipments for the provided data.","operationId":"getAvaliableShipmentAirlines","parameters":[{"$ref":"#/components/parameters/fromAirportParam"},{"$ref":"#/components/parameters/toAirportParam"},{"$ref":"#/components/parameters/departureDateParam"},{"$ref":"#/components/parameters/flightTypeParam"},{"$ref":"#/components/parameters/langParam"}],"requestBody":{"description":"Shipment detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShipmentData"}}},"required":true},"responses":{"200":{"description":"Successful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvaliableShipmentAirlines"}}}},"400":{"$ref":"#/components/responses/400BadRequestError"},"401":{"$ref":"#/components/responses/401UnauthorizedError"},"403":{"$ref":"#/components/responses/403ForbiddenError"},"404":{"$ref":"#/components/responses/404NotFoundError"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailableError"},"504":{"$ref":"#/components/responses/504GatewayTimeOut"}}}},"/api/airlines":{"put":{"tags":["Airlines"],"summary":"Add new airlines","description":"Add new airline and update if they already exists","operationId":"upsertAirlines","requestBody":{"description":"Airline to be added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AirlineList"}}},"required":true},"responses":{"200":{"description":"Succesful operation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AirlineList"}}}},"400":{"$ref":"#/components/responses/400BadRequestError","401":{"$ref":"#/components/responses/401UnauthorizedError"},"403":{"$ref":"#/components/responses/403ForbiddenError"},"404":{"$ref":"#/components/responses/404NotFoundError"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailableError"},"504":{"$ref":"#/components/responses/504GatewayTimeOut"}}}}}},"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"}},"parameters":{"includeAirportCodeQParam":{"name":"includeAirportCodeParam","in":"query","description":"Specifies whether airport codes should be considered or not","example":false,"required":false,"schema":{"type":"boolean","example":false,"default":false}},"codePathParam":{"name":"code","in":"path","description":"code param","example":"MAD","required":true,"schema":{"type":"string","maxLength":40,"minLength":3,"pattern":"^[A-Za-z0-9]+$"}},"stringQParam":{"name":"name","in":"query","description":"string param","required":true,"example":"MAD","schema":{"type":"string","maxLength":255,"minLength":3,"pattern":"^[A-Za-z0-9 ]+$"}},"fromAirportParam":{"name":"fromAirport","in":"query","description":"Airport code","required":true,"example":"MAD","schema":{"type":"string","maxLength":40,"minLength":3}},"toAirportParam":{"name":"toAirport","in":"query","description":"Airport code","required":true,"example":"MAD","schema":{"type":"string","maxLength":40,"minLength":3}},"departureDateParam":{"name":"departureDate","in":"query","description":"Departure date","required":true,"schema":{"type":"string","format":"date-time","example":"2008-01-01T00:00:00Z"}},"flightTypeParam":{"name":"flightType","in":"query","description":"Shipment type","required":true,"schema":{"$ref":"#/components/schemas/ShipmentType"}},"langParam":{"name":"lang","in":"query","description":"language","required":true,"schema":{"$ref":"#/components/schemas/Lang"}}},"schemas":{"Lang":{"type":"string","maxLength":2,"minLength":2,"pattern":"^[A-Za-z0-9]+$"},"ShipmentType":{"type":"string","enum":["direct","1-stop","charter"]},"ShipmentDetail":{"additionalProperties":false,"type":"object","required":["type","category"],"properties":{"type":{"maxLength":255,"type":"string","example":"Dangerous Goods"},"category":{"maxLength":255,"type":"string","example":"Automobiles"},"containsLitio":{"type":"boolean","description":"Indicates if the package contains litio battery or not","example":false,"default":false}}},"ShippingPackage":{"additionalProperties":false,"type":"object","required":["height","width","lenght","weight"],"properties":{"height":{"type":"number","format":"double","description":"Package size in meters","example":1,"maximum":999,"minimum":0},"width":{"type":"number","format":"double","description":"Package size in meters","example":1,"maximum":999,"minimum":0},"lenght":{"type":"number","format":"double","description":"Package size in meters","example":1,"maximum":999,"minimum":0},"weight":{"type":"number","format":"double","description":"Package size in meters","example":1,"maximum":999,"minimum":0},"stackable":{"type":"boolean","description":"Indicates if the package is stackable or not","example":true,"default":true},"rotary":{"type":"boolean","description":"Indicates if the package can be rotated or not","example":true,"default":true}}},"MerchandiseCategory":{"additionalProperties":false,"type":"object","required":["code","name"],"properties":{"code":{"maxLength":40,"type":"string","pattern":"^[A-Za-z0-9]+$","example":"Automobiles","description":"Code that identifies the merchandise category"},"name":{"maxLength":255,"type":"string","example":"Automobiles"}}},"MerchandiseCategoryList":{"type":"array","items":{"$ref":"#/components/schemas/MerchandiseCategory"}},"ProductType":{"additionalProperties":false,"type":"object","required":["code","name","categories"],"properties":{"code":{"maxLength":40,"type":"string","pattern":"^[A-Za-z0-9]+$","example":"DangerousGoods","description":"Code that identifies the merchandise type"},"name":{"maxLength":255,"type":"string","example":"Dangerous Goods"},"categories":{"$ref":"#/components/schemas/MerchandiseCategoryList"}}},"ProductTypeList":{"type":"array","items":{"$ref":"#/components/schemas/ProductType"}},"Product":{"additionalProperties":false,"type":"object","required":["code","name","type","category"],"properties":{"code":{"maxLength":40,"type":"string","pattern":"^[A-Za-z0-9]+$","example":"AppleCar","description":"Code that identifies the merchandise"},"name":{"maxLength":255,"type":"string","example":"Apple Car"},"typeCode":{"maxLength":40,"pattern":"^[A-Za-z0-9]+$","type":"string","example":"DangerousGoods"},"categoryCode":{"maxLength":40,"pattern":"^[A-Za-z0-9]+$","type":"string","example":"Automobiles"}}},"ProductList":{"type":"array","maxItems":1000,"items":{"$ref":"#/components/schemas/Product"}},"Airport":{"additionalProperties":false,"type":"object","required":["name","code"],"properties":{"code":{"maxLength":40,"type":"string","example":"MAD","pattern":"^[A-Za-z0-9]+$"},"name":{"maxLength":255,"type":"string","example":"Madrid"}}},"AirportList":{"type":"array","maxItems":1000,"items":{"$ref":"#/components/schemas/Airport"}},"ShipmentData":{"additionalProperties":false,"type":"object","required":["shipmentDetail","ShippingPackages"],"properties":{"shipmentDetail":{"$ref":"#/components/schemas/ShipmentDetail"},"shipmentResume":{"$ref":"#/components/schemas/ShipmentResume"},"shippingPackages":{"type":"array","maxItems":1000,"items":{"$ref":"#/components/schemas/ShippingPackage"}}}},"AvaliableShipmentAirlines":{"additionalProperties":false,"type":"object","required":["airlineShipmentOptions"],"properties":{"airlineShipmentOptions":{"type":"array","maxItems":1000,"items":{"$ref":"#/components/schemas/AirlineShipmentOption"}}}},"AirlineShipmentOption":{"additionalProperties":false,"type":"object","required":["airlineName","airlineCode","shipmentOptions"],"properties":{"airlineName":{"maxLength":40,"pattern":"^[A-Za-z0-9]+$","type":"string","example":"Emirates"},"airlineCode":{"maxLength":40,"pattern":"^[A-Za-z0-9]+$","type":"string","example":"EMX"},"shipmentOptions":{"$ref":"#/components/schemas/ShipmentOptions"}}},"ShipmentOptions":{"type":"array","maxItems":1000,"items":{"$ref":"#/components/schemas/ShipmentOption"}},"ShipmentOption":{"additionalProperties":false,"type":"object","required":["type","price","departureDate","arrivalDate"],"properties":{"type":{"$ref":"#/components/schemas/ShipmentType"},"price":{"type":"number","format":"double","description":"Price of the shipment","example":1,"maximum":999,"minimum":0},"departureDate":{"type":"string","format":"date-time","description":"Departure date of the shipment","example":"2020-01-01T00:00:00Z"},"arrivalDate":{"type":"string","format":"date-time","description":"Arrival date of the shipment","example":"2020-01-01T00:00:00Z"}}},"ShipmentResume":{"additionalProperties":false,"type":"object","description":"(Optional) Resume of the shipment, if provided, the data will be validated against the provided data (shipmentDetail + shipmentPackages)","required":["packages","wight","volume","loadableWeight"],"properties":{"packages":{"type":"integer","description":"Number of packages","example":1,"maximum":999,"minimum":0},"weight":{"type":"number","format":"double","description":"Total weight of the shipment","example":1,"maximum":999,"minimum":0},"volume":{"type":"number","format":"double","description":"Total volume of the shipment","example":1,"maximum":999,"minimum":0},"loadableWeight":{"type":"number","format":"double","description":"Total loadable weight of the shipment","example":1,"maximum":999,"minimum":0}}},"errorObject":{"title":"errorObject","type":"object","additionalProperties":false,"properties":{"status":{"type":"integer","description":"Status code of response","example":400,"format":"int32","maximum":599,"minimum":100},"message":{"type":"string","maxLength":100,"pattern":"^[A-Za-z0-9 .]","description":"Error message","example":"Bad Request"},"description":{"type":"string","maxLength":100,"pattern":"^[A-Za-z0-9 .]","description":"Error description","example":"Bad Request"}},"description":"Error details"},"Airline":{"additionalProperties":false,"type":"object","required":["code","name"],"properties":{"code":{"maxLength":40,"type":"string","pattern":"^[A-Za-z0-9]+$","example":"IBE"},"name":{"maxLength":255,"type":"string","example":"Iberia Airlines"}}},"AirlineList":{"type":"array","maxItems":1000,"items":{"$ref":"#/components/schemas/Airline"}}},"responses":{"400BadRequestError":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorObject"},"example":{"status":400,"description":"Bad Request","message":"Invalid Request."}}}},"401UnauthorizedError":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorObject"},"example":{"status":401,"description":"Unauthorized","message":"Unauthorized Error."}}}},"403ForbiddenError":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorObject"},"example":{"status":403,"description":"Forbidden","message":"Forbidden Error."}}}},"404NotFoundError":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorObject"},"example":{"status":404,"description":"NotFound","message":"Resouce not found."}}}},"500InternalServerError":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorObject"},"example":{"status":500,"description":"InternalServer","message":"Internal Server Error."}}}},"503ServiceUnavailableError":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorObject"},"example":{"status":503,"description":"ServiceUnavailable","message":"Service Unavailable."}}}},"504GatewayTimeOut":{"description":"Gateway Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorObject"},"example":{"status":504,"description":"GatewayTimeOut","message":"Gateway Time Out."}}}}}},"security":[{"basicAuth":[]}]}