{
  "openapi": "3.0.1",
  "info": {
    "title": "Product Relationship Manager API",
    "description": "API providing offer qualifications.",
    "version": "0.9.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://capabilities.it.att.com/product-relation",
      "description": "Generated server url"
    }
  ],
  "tags": [
    {
      "name": "Offer qualification API",
      "description": "Computes offers the customer is eligible for."
    },
    {
      "name": "Utilities API",
      "description": "Use these endpoints for proper maintenance implementation."
    }
  ],
  "paths": {
    "/offer-qualifications": {
      "post": {
        "tags": [
          "Offer qualification API"
        ],
        "summary": "Offer Qualifications",
        "description": "For a SAART L3 customer identifier, we evaluate the promotions for which the customer currently qualifies. The list of qualifying promotion IDs is returned in the responseData.offerQualifications field within the JSON response body. Each promotion ID can then be used to retrieve the corresponding Promotion (TMF671) from the Common Catalog.",
        "operationId": "computeProductOfferingsQualifications",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaartL3Id"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Product offerings successfully computed and returned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                },
                "example": {
                  "responseData": {
                    "offerQualifications": [
                      "PO_ID_001",
                      "PO_ID_002",
                      "PO_ID_003"
                    ]
                  },
                  "status": 201,
                  "timestamp": "2024-02-19T14:30:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - The request syntax is malformed and cannot be parsed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "errorDetail": {
                    "code": "BAD_REQUEST",
                    "message": "The request body contains invalid JSON syntax",
                    "description": "Unexpected character '}' at position 15"
                  },
                  "status": 400,
                  "timestamp": "2024-02-19T14:30:00.000Z"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed - Invalid or missing authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "errorDetail": {
                    "code": "AUTHENTICATION_FAILED",
                    "message": "Authentication failed",
                    "description": "Invalid or expired authentication token"
                  },
                  "status": 401,
                  "timestamp": "2024-02-19T14:30:00.000Z"
                }
              }
            }
          },
          "404": {
            "description": "Customer identifier not found in the system",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "errorDetail": {
                    "code": "CUSTOMER_NOT_FOUND",
                    "message": "The provided customer identifier does not exist in the system",
                    "description": "L3 Id: 12345 not found"
                  },
                  "status": 404,
                  "timestamp": "2024-02-19T14:30:00.000Z"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity - The request is well-formed but contains invalid or missing data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "errorDetail": {
                    "code": "VALIDATION_ERROR",
                    "message": "Request validation failed",
                    "description": "The request contains invalid or missing data",
                    "detail": {
                      "coId": [
                        "Field is required and cannot be empty",
                        "Must match pattern: ^[0-9]{7}$"
                      ]
                    }
                  },
                  "status": 422,
                  "timestamp": "2024-02-19T14:30:00.000Z"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - Request rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "errorDetail": {
                    "code": "RATE_LIMIT_EXCEEDED",
                    "message": "Too many requests",
                    "description": "Maximum request rate: 100 requests per minute. Please try again in 30 seconds"
                  },
                  "status": 429,
                  "timestamp": "2024-02-19T14:30:00.000Z"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected server error occurred - Please contact support if the issue persists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "errorDetail": {
                    "code": "INTERNAL_SERVER_ERROR",
                    "message": "An unexpected error occurred while processing the request",
                    "description": "Reference ID: ERR-2024-02-19-001"
                  },
                  "status": 500,
                  "timestamp": "2024-02-19T14:30:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/ping": {
      "get": {
        "tags": [
          "Utilities API"
        ],
        "summary": "Performs a health check on the system.",
        "description": "This endpoint checks the status of various system components, including the database connection.",
        "operationId": "health",
        "responses": {
          "200": {
            "description": "System is healthy and all components are operational",
            "content": {
              "application/json": {
                "example": {
                  "status": 200,
                  "timestamp": "2024-02-19T14:30:00.000Z"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed - Invalid or missing authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorDetail"
                },
                "example": {
                  "status": 401,
                  "errorDetail": {
                    "code": "AUTHENTICATION_FAILED",
                    "message": "Authentication failed",
                    "description": "Invalid or expired authentication token",
                    "detail": "JWT token is missing or malformed"
                  },
                  "timestamp": "2024-02-19T14:30:00.000Z"
                }
              }
            }
          },
          "500": {
            "description": "Authentication failed - Invalid or missing authentication token",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorDetail"
                },
                "example": {
                  "status": 500,
                  "errorDetail": {
                    "code": "PRMAN_ERROR-GENERIC_ERROR",
                    "message": "Authentication failed",
                    "description": "Invalid or expired authentication token",
                    "detail": "JWT token is missing or malformed"
                  },
                  "timestamp": "2024-02-19T14:30:00.000Z"
                }
              }
            }
          },
          "503": {
            "description": "Service unavailable - One or more system components are not operational",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorDetail"
                },
                "example": {
                  "status": 503,
                  "errorDetail": {
                    "code": "HEALTH_CHECK_FAILED",
                    "message": "Health check failed",
                    "description": "One or more system components are not operational",
                    "detail": "Database connection timeout after 5 seconds"
                  },
                  "timestamp": "2024-02-19T14:30:00.000Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "SaartL3Id": {
        "required": [
          "saartL3Id"
        ],
        "type": "object",
        "properties": {
          "saartL3Id": {
            "type": "string"
          }
        }
      },
      "ErrorDetail": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code identifier"
          },
          "message": {
            "type": "string",
            "description": "Human-readable error message"
          },
          "description": {
            "type": "string",
            "description": "Detailed technical description"
          },
          "detail": {
            "type": "object",
            "description": "Additional error context or technical details"
          }
        },
        "description": "Error detail structure"
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "errorDetail": {
            "$ref": "#/components/schemas/ErrorDetail"
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code",
            "format": "int32",
            "example": 400
          },
          "timestamp": {
            "type": "string",
            "description": "Timestamp of the response",
            "format": "date-time",
            "example": "2023-10-25T10:30:45.123Z"
          }
        },
        "description": "Error API response"
      },
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "responseData": {
            "type": "object",
            "description": "Response data payload",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code",
            "format": "int32",
            "example": 200
          },
          "timestamp": {
            "type": "string",
            "description": "Timestamp of the response",
            "format": "date-time",
            "example": "2023-10-25T10:30:45.123Z"
          }
        },
        "description": "Successful API response"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}