{
  "openapi": "3.0.0",
  "info": {
    "title": "OpenAPI definition",
    "version": "v0"
  },
  "servers": [{ "url": "HOST" }],
  "paths": {
    "/direct-issuance-portal/api/v1/enrollment/qrCode": {
      "post": {
        "tags": [
          "direct-issuance-controller"
        ],
        "summary": "Create enrollment QR code",
        "description": "Endpoint used to create enrollment QR code.",
        "operationId": "createEnrollmentQrCode",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEnrollmentQrCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedQrCode"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request (x-tenant-id was not provided)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedQrCode"
                }
              }
            }
          },
          "404": {
            "description": "Not found requested iso mapping",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedQrCode"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedQrCode"
                }
              }
            }
          }
        }
      }
    },
    "/direct-issuance-portal/api/v1/enrollment/qrCode/{transactionId}": {
      "get": {
        "tags": [
          "direct-issuance-controller"
        ],
        "summary": "Retrieve enrollment QR code",
        "description": "Endpoint used to create enrollment QR code.",
        "operationId": "retrieveQrCode",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedQrCode"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request (x-tenant-id was not provided)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedQrCode"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneratedQrCode"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AttributeValue": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Attribute name as defined in the applicable ISO Mapping definition."
          },
          "value": {
            "type": "string",
            "description": "Attribute value as string. This string will be converted to the proper ISO type as defined in the applicable ISO Mapping definition."
          }
        }
      },
      "CreateEnrollmentQrCodeRequest": {
        "type": "object",
        "properties": {
          "businessProcess": {
            "type": "string",
            "description": "Business process to execute when the end-user claims the identity transaction."
          },
          "isoMappingName": {
            "type": "string",
            "description": "ISO mapping name to apply to validate required attributes"
          },
          "namespaces": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/AttributeValue"
              }
            }
          }
        }
      },
      "GeneratedQrCode": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string",
            "description": "Transaction Identifier for troubleshooting purpose."
          },
          "status": {
            "type": "string",
            "description": "Transaction Status"
          },
          "base64QrCode": {
            "type": "string",
            "description": "Pre-computed QRCode which includes the deeplink to execute by the client SDK/Application"
          },
          "enrollmentUrl": {
            "type": "Deeplink to execute by the client SDK/Application"
          }
        }
      }
    }
  }
}
