# Get transaction report

Retrieve an audit report of a completed transaction.

Can specify the type of report using the `type` query parameter.

Simple reports are always available to be retrieved.

Extended audit reports contain all documents and will be sealed, only retrievable within transaction validity.

# OpenAPI definition

````json
{
  "openapi": "3.1.1",
  "servers": [
    {
      "url": "https://api.cm.com/id-scan/v1"
    }
  ],
  "security": [
    {
      "JWT": []
    }
  ],
  "info": {
    "version": "1",
    "title": "ID Scan API",
    "description": "With ID Scan, you can verify your customer's identity by letting them scan their identity document using a mobile device, like a passport or a driver's license. An advanced OCR engine abstracts data from their document and detects the customer as a living human being via their device's camera.\n"
  },
  "tags": [
    {
      "name": "Transactions",
      "description": "Create or get transactions with identification tasks."
    }
  ],
  "paths": {
    "/transactions/{transactionId}/report/{resultId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/TransactionId"
        },
        {
          "$ref": "#/components/parameters/ResultId"
        },
        {
          "$ref": "#/components/parameters/AuditReportType"
        }
      ],
      "get": {
        "operationId": "get_transaction_report",
        "description": "Retrieve an audit report of a completed transaction.\n\nCan specify the type of report using the `type` query parameter.\n\nSimple reports are always available to be retrieved.\n\nExtended audit reports contain all documents and will be sealed, only retrievable within transaction validity.\n",
        "summary": "Get transaction report",
        "tags": [
          "Transactions"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "title": "Error Response",
        "type": "object",
        "properties": {
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "Response status code, should match HTTP error code.",
            "example": 400
          },
          "message": {
            "type": "string",
            "description": "High level description of the error that occurred.",
            "example": "The request is invalid"
          }
        }
      },
      "AuditReportType": {
        "type": "string",
        "enum": [
          "simple",
          "extended"
        ],
        "default": "simple",
        "description": "The type of audit report to be retrieved of a completed ID Scan transaction."
      }
    },
    "securitySchemes": {
      "JWT": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "In order to authenticate you need to use your credentials to generate a JWT Bearer token. The [JWT token](https://jwt.io/introduction/) has to be generated using the `HS256` algorithm and your credentials. This JWT has to contain the following attributes: `iat`, `nbf`, `exp`  in the payload, as well as the attribute `kid` in the header of the JWT. This `kid` attribute needs to contain the Key Id of your credentials.\n\nThe generated token needs to be passed via the HTTP Authorization header like:\n\n```\nAuthorization: Bearer GENERATED_TOKEN_HERE\n```\n\nThere are many libraries available for different programming languages that can help you to generate a JWT. See the Libraries tab on [https://jwt.io](https://jwt.io)\n"
      }
    },
    "responses": {
      "NotFound": {
        "description": "The specified resource was not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "status": 404,
              "message": "Not found"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "status": 401,
              "message": "Unauthorized"
            }
          }
        }
      }
    },
    "parameters": {
      "TransactionId": {
        "name": "transactionId",
        "in": "path",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "required": true,
        "description": "A unique identifier for the transaction."
      },
      "ResultId": {
        "name": "resultId",
        "in": "path",
        "schema": {
          "type": "string",
          "format": "uuid"
        },
        "required": true,
        "description": "This result ID can be obtained from the `resultId` parameter in the iframe event or query parameter `resultid` in the return url after the user completes the transaction."
      },
      "AuditReportType": {
        "name": "type",
        "in": "query",
        "schema": {
          "$ref": "#/components/schemas/AuditReportType"
        },
        "required": false,
        "description": "Specify the type of audit report. Defaults to `simple`.\n\nSimple audit report already exists and can always be retrieved.\n\nExtended audit report can be requested within the ID Scan transaction validity.\n"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 106,
      "1": 132,
      "2": 111,
      "3": 81,
      "4": 57,
      "5": 37,
      "6": 216,
      "7": 106,
      "8": 242,
      "9": 54,
      "10": 178,
      "11": 160
    }
  }
}
````