{
  "openapi": "3.0.1",
  "info": {
    "title": "API ProductQualification",
    "description": "",
    "version": "01.32.00"
  },
  "servers": [
    {
      "url": "https://api.orange.com/eligibilite-api",
      "description": ""
    }
  ],
  "paths": {
    "/productRIPQualification": {
      "post": {
        "tags": [
          "productRIPQualification"
        ],
        "description": "Create a product offering qualification",
        "operationId": "productOfferingQualification",
        "parameters": [
          {
            "name": "X-OAPI-Application-Id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductQualificationRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error\n\nList of supported error codes:\n- 1: Internal error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request\n\nList of supported error codes:\n- 21: Missing body\n- 22: Invalid body\n- 23: Missing body field\n- 24: Invalid body field\n- 29: Address not found\n- 30: ND not found\n- 31: Prestation not found\n- 32: Precable not found\n- 33: Building not found\n- 35: The rip specified does not exist\n- 36: Search address doesn't belong to RIP.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden\n\nList of supported error codes:\n- 50: Access denied",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not Found\n\nList of supported error codes:\n- 60: Resource not found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable\n\nList of supported error codes:\n- 5: The service is temporarily unavailable\n- 6: Orange API is over capacity, retry later !",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "405": {
            "description": "Method Not Allowed\n\nList of supported error codes:\n- 61: Method not allowed",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductQualificationResponseDto"
                }
              }
            }
          },
          "406": {
            "description": "Not Acceptable\n\nList of supported error codes:\n- 62: Not acceptable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductQualificationResponseDto"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiError": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32"
          },
          "message": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        },
        "description": "API error object containing the code, description and the message of the error."
      },
      "BuildingCharacteristicDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "description": "This object will contain the name of a building characteristic and its value"
      },
      "CategoryDto": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "pattern": "(ftte|ftth)(\\s*\\|\\s*(ftte|ftth))*",
            "type": "string",
            "description": "Categories names of product offerings (ftte or ftth)"
          }
        },
        "description": "Category of product offering for which the eligibility is calculated (ftte or ftth)"
      },
      "GeographicAddressDto": {
        "type": "object",
        "properties": {
          "streetNr": {
            "pattern": "^[0-9]{0,5}$",
            "type": "string",
            "description": "Street number"
          },
          "streetNrSuffix": {
            "pattern": "^[a-z]{0,5}$",
            "type": "string",
            "description": "Street number suffix"
          },
          "rivoliCode": {
            "pattern": "^[a-zA-Z0-9]{4}$",
            "type": "string",
            "description": "Rivoli code"
          },
          "cityCode": {
            "pattern": "^[a-zA-Z0-9]{5}$",
            "type": "string"
          },
          "hexacleVoie": {
            "pattern": "^[a-zA-Z0-9]{1,20}$",
            "type": "string",
            "description": "Hexacle Street (Voie)"
          },
          "hexacleId": {
            "pattern": "^[a-zA-Z0-9]{1,20}$",
            "type": "string",
            "description": "Hexacle Id"
          },
          "geographicSubAddress": {
            "$ref": "#/components/schemas/GeographicSubAddressDto"
          }
        },
        "description": "Geographic address elements : required if contextType has the value address"
      },
      "GeographicLocation": {
        "type": "object",
        "properties": {
          "longitude": {
            "type": "number",
            "description": "Longitude",
            "format": "double"
          },
          "latitude": {
            "type": "number",
            "description": "Latitude",
            "format": "double"
          },
          "accuracy": {
            "type": "string",
            "description": "Accuracy",
            "enum": [
              "street",
              "number",
              "building"
            ]
          }
        },
        "description": "Geographic location elements"
      },
      "GeographicLocationDto": {
        "required": [
          "x",
          "y"
        ],
        "type": "object",
        "properties": {
          "x": {
            "type": "string",
            "description": "Longitude"
          },
          "y": {
            "type": "string",
            "description": "Latitude"
          }
        },
        "description": "Geographic location elements : required if contextType has the value geographiclocation"
      },
      "GeographicSubAddressDto": {
        "type": "object",
        "properties": {
          "buildingName": {
            "type": "string",
            "description": "Building Name"
          },
          "buildingCode": {
            "type": "string",
            "description": "Building Code"
          },
          "buildingCodeOC": {
            "type": "string",
            "description": "Building Code OC"
          },
          "buildingCodeOI": {
            "type": "string",
            "description": "Building Code OI"
          },
          "geographicLocation": {
            "$ref": "#/components/schemas/GeographicLocation"
          },
          "buildingCharacteristics": {
            "uniqueItems": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BuildingCharacteristicDto"
            }
          },
          "publicKey": {
            "$ref": "#/components/schemas/GeographicSubAddressPublicKeyDto"
          }
        },
        "description": "The geographicSubAddress field is returned if multiple buildings or precable numbers or multiple Nds are located at the same address (see qualificationResult=notComputed). It contains a table of buildings, precable numbers, Nd (active, inactive) found at this address."
      },
      "GeographicSubAddressPublicKeyDto": {
        "type": "object",
        "properties": {
          "name": {
            "pattern": "nd|ndetoile|precable|prestation",
            "type": "string",
            "description": "Name used for a PublicKey",
            "enum": [
              "nd, ndetoile, precable, prestation"
            ]
          },
          "value": {
            "pattern": "^(0[1-5][0-9]{8})|([a-zA-Z0-9]{8})|(42C[A-Z]{2}[0-9]{15})$",
            "type": "string",
            "description": "must start by 01, 02, 03, 04 or 05 and contains 10 numbers OR must contains only 8 alphanumeric characters OR must contains '42C' followed by two letters and fifteen numbers"
          }
        },
        "description": "Public key used for the GeographicSubAddress"
      },
      "NonFormattedAddressDto": {
        "required": [
          "Free text with address elements"
        ],
        "type": "object",
        "properties": {
          "Free text with address elements": {
            "type": "string"
          }
        },
        "description": "Non formatted address elements : required if contextType has the value fulltext"
      },
      "PlaceRequestDto": {
        "type": "object",
        "properties": {
          "geographicAddress": {
            "$ref": "#/components/schemas/GeographicAddressDto"
          },
          "geographicLocation": {
            "$ref": "#/components/schemas/GeographicLocationDto"
          },
          "nonFormattedAddress": {
            "$ref": "#/components/schemas/NonFormattedAddressDto"
          }
        },
        "description": "A place could be provided with a geographic address with structured elements, a geographic location or a full text"
      },
      "ProductQualificationRequestDto": {
        "required": [
          "category",
          "contextType"
        ],
        "type": "object",
        "properties": {
          "contextType": {
            "pattern": "nd|ndetoile|address|fulltext|geographiclocation|prestation|precable|buildingCode",
            "type": "string",
            "description": "Eligibility context",
            "enum": [
              "nd, ndetoile, address, fulltext, geographiclocation, prestation, precable, buildingCode"
            ]
          },
          "category": {
            "$ref": "#/components/schemas/CategoryDto"
          },
          "publicKey": {
            "$ref": "#/components/schemas/PublicKeyDto"
          },
          "place": {
            "$ref": "#/components/schemas/PlaceRequestDto"
          }
        },
        "description": "A ProductOfferingQualification is used to perform a commercial eligibility. It allows to retrieve a list of\nproductOffering of a category and specify if they are available or not in the context of the interaction defined by a place."
      },
      "PublicKeyDto": {
        "type": "object",
        "properties": {
          "name": {
            "pattern": "nd|prestation|precable|buildingCode",
            "type": "string",
            "description": "Name used for a PublicKey",
            "enum": [
              "nd, prestation, precable, buildingCode"
            ]
          },
          "value": {
            "pattern": "^(0[1-5][0-9]{8})|([a-zA-Z0-9]{8})|(42C[A-Z]{2}[0-9]{15})|([a-zA-Z0-9-/]{0,30})$",
            "type": "string",
            "description": "must start by 01, 02, 03, 04 or 05 and contains 10 numbers OR must contains only 8 alphanumeric characters OR must contains '42C' followed by two letters and fifteen numbers OR must contains only 30 alphanumeric characters"
          }
        },
        "description": "Public key used for the context of eligibility"
      },
      "CharacteristicDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "description": "This object will contain the name of a characteristic and its value"
      },
      "GeographicSiteDto": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string",
            "description": "The full address"
          },
          "normalizedAddress": {
            "$ref": "#/components/schemas/NormalizedAddressDto"
          }
        },
        "description": "The geographicSiteDto objet contains the address on which the availability test has been done. It can be different than the input address and it contains the address, buildingCode and the normalizedAddress fields."
      },
      "NormalizedAddressDto": {
        "type": "object",
        "properties": {
          "inseeCode": {
            "type": "string",
            "description": "INSEE Code"
          },
          "rivoliCode": {
            "type": "string",
            "description": "Rivoli Code"
          },
          "streetNr": {
            "type": "string",
            "description": "Street number"
          },
          "streetNrSuffix": {
            "type": "string",
            "description": "Street number suffix"
          },
          "streetType": {
            "type": "string",
            "description": "Street type"
          },
          "streetName": {
            "type": "string",
            "description": "Street name"
          },
          "postcode": {
            "type": "string",
            "description": "Postal code"
          },
          "locality": {
            "type": "string",
            "description": "Locality"
          },
          "city": {
            "type": "string",
            "description": "City"
          },
          "geographicSubAddress": {
            "uniqueItems": true,
            "type": "array",
            "description": "Set of GeographicSubAddress",
            "items": {
              "$ref": "#/components/schemas/GeographicSubAddressDto"
            }
          }
        },
        "description": "The normalizedAddress object contains the standardized address (inseeCode, rivoliCode, streetNr, streetNrSuffix), the textual address cut out and geographicSubAddress."
      },
      "PlaceResponseDtoGeographicSiteDto": {
        "type": "object",
        "properties": {
          "geographicSite": {
            "$ref": "#/components/schemas/GeographicSiteDto"
          }
        },
        "description": "Place where the eligibility is calculated"
      },
      "ProductDto": {
        "type": "object",
        "properties": {
          "characteristics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CharacteristicDto"
            }
          }
        },
        "description": "Characteristic to be provided for the customer order dependings on the offer type:\n**FTTE Offers**: nroCode for an Optimum Access offer, pmCode for an Optimum PM offer or blom for an Optimum ethernet offer.\n**FTTO Offers**: disponibilite, RS, RSstate, zone, nextZone, nextZoneDate, zoneArcep, nextZoneArcep, nextZoneArcepDate, 100M, 200M, 300M_1G, 2G_4G and disponibilite for the FTTO offer.\n**Copper Offers (public or entreprise)**: cause, message, lineCharacteristics, siteCode, targetSiteCode, context, availableCopperPair, maxAvailableCopperPairOnPC, ethernetRegion, networkReworkNra, directLineDistribution, lineType, accessType, dslam, maxBitrate, zoneArcep, nextZoneArcep and nextZoneArcepDate)"
      },
      "ProductOfferingDto": {
        "type": "object",
        "properties": {
          "Name of the product offering eligible or not (Optimum Access for example": {
            "type": "string"
          },
          "productSpecification": {
            "$ref": "#/components/schemas/ProductSpecificationDto"
          }
        },
        "description": "Product offering for which the eligibility is provided"
      },
      "ProductOfferingQualificationItemDto": {
        "type": "object",
        "properties": {
          "qualificationItemResult": {
            "type": "string",
            "description": "Result of the qualificationItem set to eligible or notEligible"
          },
          "qualificationItemReason": {
            "type": "string",
            "description": "Result of the qualificationItem set to eligible or notEligible"
          },
          "productOffering": {
            "$ref": "#/components/schemas/ProductOfferingDto"
          },
          "product": {
            "$ref": "#/components/schemas/ProductDto"
          },
          "qualificationItemStatus": {
            "type": "string",
            "writeOnly": true
          }
        },
        "description": "The productOfferingQualificationItem field contain an array of values with the fields qualificationItemResult, qualificationItemReason, productOffering and product."
      },
      "ProductQualificationResponseDto": {
        "type": "object",
        "properties": {
          "place": {
            "$ref": "#/components/schemas/PlaceResponseDtoGeographicSiteDto"
          },
          "qualificationResult": {
            "type": "string",
            "description": "The qualificationResult field is set to notComputed when there is more than one building at the same address. The productOfferingQualificationItem field will be then empty and the geographicSubAddress field will contain the notComputed value.",
            "enum": [
              "full",
              "partial",
              "notComputed"
            ]
          },
          "productOfferingQualificationItem": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductOfferingQualificationItemDto"
            }
          }
        },
        "description": "A ProductQualificationResponse provides a response to the productOfferingQualification call."
      },
      "ProductSpecificationDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the specific offer (CEL05M for example)"
          }
        },
        "description": "Specific offer of the product offering (for CUE or CUGP)"
      }
    }
  }
}
