{
  "openapi": "3.0.4",
  "info": {
    "version": "1.0.0",
    "title": "CustomerAccountManagement",
    "description": "This is OpenAPI Spec for Omni Customer Account lookup.",
    "contact": {
      "name": "Omni API Support",
      "email": "DL-OmniAdapter@att.com"
    }
  },
  "servers": [
    {
      "url": "https://eidp-test.att.com/msapi"
    }
  ],
  "tags": [
    {
      "name": "customer-account-management",
      "description": "Customer profile retreival"
    },
    {
      "name": "customers-graphQL",
      "description": "Customer view"
    }
  ],
  "paths": {
    "/v1/customer": {
      "get": {
        "tags": [
          "customer-account-management"
        ],
        "summary": "Inquire Account Profile",
        "description": "Retreive Account Profile by subscriber number or billingaccountnumber. \n",
        "operationId": "RetrieveAccountProfile",
        "parameters": [
          {
            "in": "header",
            "name": "serviceType",
            "schema": {
              "type": "string",
              "enum": [
                "wireless",
                "wirelessbroadband",
                "fiber"
              ]
            },
            "description": "account type",
            "required": true
          },
          {
            "in": "header",
            "name": "idp-trace-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "accountNumber",
            "schema": {
              "type": "string"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "subscriberNumber",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "topics",
            "schema": {
              "type": "string",
              "enum": [
                "accounts",
                "individuals",
                "products",
                "contracts",
                "subscribers",
                "equipment"
              ]
            },
            "description": "default to accounts",
            "required": true
          },
          {
            "in": "header",
            "name": "idpctx-session-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with individual data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Individual"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "errorCode": "400",
                      "errorDescription": "invalid request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized_request": {
                    "value": {
                      "errorCode": "401",
                      "errorDescription": "Access Token invalid or Missing."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/customers/query": {
      "post": {
        "tags": [
          "customers-graphQL"
        ],
        "summary": "GraphQL Query Inquire Account Profile",
        "description": "Retreive Account Profile by subscriber number or billingaccountnumber. \n",
        "operationId": "QueryAccountProfile",
        "parameters": [
          {
            "in": "header",
            "name": "serviceType",
            "schema": {
              "type": "string",
              "enum": [
                "wireless",
                "wirelessbroadband",
                "fiber"
              ]
            },
            "description": "account type",
            "required": true
          },
          {
            "in": "header",
            "name": "idp-trace-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false
          },
          {
            "in": "header",
            "name": "topics",
            "schema": {
              "type": "string",
              "enum": [
                "accounts",
                "individuals",
                "products",
                "contracts",
                "subscribers",
                "equipment"
              ]
            },
            "description": "default to accounts",
            "required": true
          },
          {
            "in": "header",
            "name": "idpctx-session-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": false
          }
        ],
        "requestBody": {
          "description": "description",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string"
                  }
                }
              },
              "examples": {
                "getCustomer_account_information_query": {
                  "value": {
                    "query": "{ getCustomer( accountNumber:534102104648, subscriberNumber:1234567890  ) { id firstName lastName status contactMedium { mediumType isPreferred characteristic { contactType phoneNumber emailAddress place { id } } } accounts { id accountType accountSubType liabilityType businessType ratingType serviceType firstNetIndicator subscribersCount accountState { state } accountLocked extraSecurityCode fanDetails { fanId fanDescription } contact { contactMedium { mediumType isPreferred characteristic { contactType phoneNumber emailAddress place { id } } } } bill { billStructure { presentationMedia { id name } } } subscribers { status { status } phoneNumber isFirstNetSubscriber contactMedium { mediumType isPreferred characteristic { contactType phoneNumber emailAddress place { id } } } profile { individualId firstName lastName } serviceCharacteristic { devices { type imei imeiType sim { iccid imsi } } } products { productOfferingTypeGroup id rootProductId productOfferingId name description status { status } productCharacteristic { name value valueType } } } } } }"
                  }
                },
                "getCustomer_status_query": {
                  "value": {
                    "query": "{ getCustomer( accountNumber:534102104648, subscriberNumber:1234567890  ) { status } }"
                  }
                },
                "getCustomer_subscriberinfo_query": {
                  "value": {
                    "query": "{ getCustomer( accountNumber:534102104648, subscriberNumber:1234567890  ) { id accounts { subscribers { status { status } phoneNumber serviceCharacteristic { devices { type imei imeiType sim { iccid imsi } } } } } } }"
                  }
                },
                "getCustomer_productfields_fragment_query": {
                  "value": {
                    "query": "{ getCustomer( accountNumber:534102104648, subscriberNumber:1234567890 ) { accounts {id, subscribers { status { status } phoneNumber ProductFields } } } } fragment ProductFields on Individual { productOfferingTypeGroup id rootProductId productOfferingId name description status { status } productCharacteristic { name value valueType } } }"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response with individual data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Individual"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "bad_request": {
                    "value": {
                      "errorCode": "400",
                      "errorDescription": "invalid request"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unauthorized_request": {
                    "value": {
                      "errorCode": "401",
                      "errorDescription": "Access Token invalid or Missing."
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GraphqlQuery": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          }
        }
      },
      "Individual": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "languageAbility": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LanguageAbility"
            }
          },
          "status": {
            "type": "string"
          },
          "contactMedium": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactMedium"
            }
          },
          "accounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Account"
            }
          }
        }
      },
      "LanguageAbility": {
        "type": "object",
        "properties": {
          "languageCode": {
            "type": "string"
          },
          "languageName": {
            "type": "string"
          }
        }
      },
      "ContactMedium": {
        "type": "object",
        "properties": {
          "mediumType": {
            "type": "string"
          },
          "isPreferred": {
            "type": "boolean"
          },
          "characteristic": {
            "$ref": "#/components/schemas/Characteristic"
          }
        }
      },
      "Characteristic": {
        "type": "object",
        "properties": {
          "contactType": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "emailAddress": {
            "type": "string"
          },
          "place": {
            "$ref": "#/components/schemas/Place"
          }
        }
      },
      "Place": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "accountType": {
            "type": "string"
          },
          "accountSubType": {
            "type": "string"
          },
          "liabilityType": {
            "type": "string"
          },
          "businessType": {
            "type": "string"
          },
          "ratingType": {
            "type": "string"
          },
          "serviceType": {
            "type": "string"
          },
          "firstNetIndicator": {
            "type": "string"
          },
          "subscribersCount": {
            "type": "integer"
          },
          "accountState": {
            "$ref": "#/components/schemas/AccountState"
          },
          "accountLocked": {
            "type": "boolean"
          },
          "extraSecurityCode": {
            "type": "string"
          },
          "fanDetails": {
            "$ref": "#/components/schemas/FanDetails"
          },
          "contact": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            }
          },
          "bill": {
            "$ref": "#/components/schemas/Bill"
          },
          "subscribers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Subscriber"
            }
          }
        }
      },
      "AccountState": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string"
          }
        }
      },
      "FanDetails": {
        "type": "object",
        "properties": {
          "fanId": {
            "type": "string"
          },
          "fanDescription": {
            "type": "string"
          }
        }
      },
      "Contact": {
        "type": "object",
        "properties": {
          "contactMedium": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactMedium"
            }
          }
        }
      },
      "Bill": {
        "type": "object",
        "properties": {
          "billStructure": {
            "$ref": "#/components/schemas/BillStructure"
          }
        }
      },
      "BillStructure": {
        "type": "object",
        "properties": {
          "presentationMedia": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PresentationMedia"
            }
          },
          "cycleSpecification": {
            "$ref": "#/components/schemas/CycleSpecification"
          }
        }
      },
      "PresentationMedia": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "CycleSpecification": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "frequency": {
            "type": "string"
          }
        }
      },
      "Subscriber": {
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "subscriberType": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "isPreferredCTN": {
            "type": "boolean"
          },
          "isFirstNetSubscriber": {
            "type": "boolean"
          },
          "contactMedium": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactMedium"
            }
          },
          "profile": {
            "$ref": "#/components/schemas/Profile"
          },
          "serviceCharacteristic": {
            "$ref": "#/components/schemas/ServiceCharacteristic"
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          }
        }
      },
      "Status": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "Profile": {
        "type": "object",
        "properties": {
          "individualId": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          }
        }
      },
      "ServiceCharacteristic": {
        "type": "object",
        "properties": {
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Device"
            }
          }
        }
      },
      "Device": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "imei": {
            "type": "string"
          },
          "imeiType": {
            "type": "string"
          },
          "sim": {
            "$ref": "#/components/schemas/Sim"
          }
        }
      },
      "Sim": {
        "type": "object",
        "properties": {
          "iccid": {
            "type": "string"
          },
          "imsi": {
            "type": "string"
          }
        }
      },
      "Product": {
        "type": "object",
        "properties": {
          "productOfferingTypeGroup": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "rootProductId": {
            "type": "string"
          },
          "productOfferingId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "productCharacteristic": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductCharacteristic"
            }
          }
        }
      },
      "ProductCharacteristic": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "valueType": {
            "type": "string"
          }
        }
      },
      "HealthCheck": {
        "title": "HealthCheck",
        "example": {
          "application_name": "customer-account-management",
          "message": "Application up and running",
          "time": "2025-05-025T20:10:26.843-05:00"
        },
        "type": "object",
        "required": [
          "application_name",
          "message",
          "time"
        ],
        "properties": {
          "application_name": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "description": "The time when the error occurred."
          },
          "errorCode": {
            "type": "string",
            "description": "A short description of the error.",
            "example": "Bad Request"
          },
          "errorDescription": {
            "type": "string",
            "description": "A detailed error message for debugging purposes.",
            "example": "Invalid input provided for the 'id' field."
          },
          "path": {
            "type": "string",
            "description": "The API endpoint where the error occurred.",
            "example": "/api/v1/resource"
          },
          "traceId": {
            "type": "string",
            "description": "A unique identifier for tracking the error across systems.",
            "example": "abc123xyz"
          }
        }
      }
    }
  }
}