openapi: 3.0.2 info: title: Basware OAUTH2 authentication APIs AccountingDocuments Data extract API description: "**Using OAUTH2.0 authentication:**\n\nGet API access token from api.basware.com/tokens\n1. Using client id and client secret, which you can obtain from Basware. \n2. Specify which APIs can be accessed by using the token e.g. Read only access to vendors API only (these are called scopes). Available scopes are listed at . \n3. Each token has an expiration time, until which it can be used to call APIs.\n\nWhen using OAUTH2 authentication, you need to pass the OAUTH2 authentication token when calling Basware API endpoints. Available Basware API operations are documented at . \n\nSee the Basware API developer site at for more details on API authentication." version: 1.0.0 x-logo: url: https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png tags: - name: Data extract paths: /v1/dataExtracts: get: tags: - Data extract summary: Returns information about available data extracts operationId: get_available_data_extracts_info_v1_dataExtracts_get parameters: - description: 'Extract processing status filter. Returns extracts by processing status. Available values: ''WaitingForExport'', ''Exported''' required: false schema: type: string title: Processingstatus description: 'Extract processing status filter. Returns extracts by processing status. Available values: ''WaitingForExport'', ''Exported''' name: processingStatus in: query responses: '200': description: Successful Response content: application/json: schema: items: $ref: '#/components/schemas/AvailableDataExtractInfo' type: array title: Response Get Available Data Extracts Info V1 Dataextracts Get '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/InternalServerErrorResponse' '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ValidationErrorResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/UnauthorizeErrorResponse' '422': description: Unprocessable Entity content: application/json: schema: $ref: '#/components/schemas/UnprocessableEntityErrorResponse' /v1/dataExtracts/{extract_id}: get: tags: - Data extract summary: Returns information about files for one data extract. Download url in file information can be used to download file. Download url does not expire but it requires following redirects. operationId: get_data_extract_by_id_v1_dataExtracts__extract_id__get parameters: - description: Id of the data extract for which file information should be returned required: true schema: type: string title: Extract Id description: Id of the data extract for which file information should be returned name: extract_id in: path responses: '200': description: Successful Response content: application/json: schema: items: $ref: '#/components/schemas/DataExtractFileInfo' type: array title: Response Get Data Extract By Id V1 Dataextracts Extract Id Get '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/InternalServerErrorResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/UnauthorizeErrorResponse' '404': description: Not Found content: application/json: schema: $ref: '#/components/schemas/RecordNotFoundResponse' '422': description: Unprocessable Entity content: application/json: schema: $ref: '#/components/schemas/UnprocessableEntityErrorResponse' /v1/dataExtracts/{extract_id}/acknowledge: post: tags: - Data extract summary: Acknowledged extracts are marked as exported operationId: mark_extract_as_downloaded_v1_dataExtracts__extract_id__acknowledge_post parameters: - description: Id of the data extract which is going to be acknowledged required: true schema: type: string title: Extract Id description: Id of the data extract which is going to be acknowledged name: extract_id in: path responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/SuccessResponse' '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/InternalServerErrorResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/UnauthorizeErrorResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /v1/dataExtracts/specification/tableDefinition: get: tags: - Data extract summary: Returns definition of supported tables operationId: get_table_definition_v1_dataExtracts_specification_tableDefinition_get responses: '200': description: Successful Response content: application/json: schema: items: $ref: '#/components/schemas/TableDefinition' type: array title: Response Get Table Definition V1 Dataextracts Specification Tabledefinition Get '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/InternalServerErrorResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/UnauthorizeErrorResponse' /v1/dataExtracts/specification/tableDefinition/changeLog: get: tags: - Data extract summary: Returns change log for definition of supported tables operationId: get_table_definition_change_log_v1_dataExtracts_specification_tableDefinition_changeLog_get responses: '200': description: Successful Response content: application/json: schema: items: $ref: '#/components/schemas/TableDefinitionChangeLog' type: array title: Response Get Table Definition Change Log V1 Dataextracts Specification Tabledefinition Changelog Get '500': description: Internal Server Error content: application/json: schema: $ref: '#/components/schemas/InternalServerErrorResponse' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/UnauthorizeErrorResponse' components: schemas: RecordNotFoundResponse: properties: detail: type: string title: Detail description: Detail of error default: Not Found example: Not Found type: object title: RecordNotFoundResponse TableDefinition: properties: Table name: type: string title: Table Name example: TABLE_1 Columns: items: $ref: '#/components/schemas/TableColumnDefinition' type: array title: Columns type: object required: - Table name - Columns title: TableDefinition SuccessResponse: properties: succeeded: type: boolean title: Succeeded description: Success status example: true message: type: string title: Message description: Success message default: Action done successfully example: Action done successfully type: object title: SuccessResponse TableColumnDefinition: properties: Column name: type: string title: Column Name example: NAME Data Type: type: string title: Data Type example: NVARCHAR2 Field definition: type: string title: Field Definition example: Name of the person Example value: type: string title: Example Value example: John Doe type: object required: - Column name - Data Type - Field definition - Example value title: TableColumnDefinition TableDefinitionColumnChangeLog: properties: Added columns: items: type: string type: array title: Added Columns Removed columns: items: type: string type: array title: Removed Columns type: object required: - Added columns - Removed columns title: TableDefinitionColumnChangeLog ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError DataExtractFileInfo: properties: extractId: type: string title: Extractid description: Extract id for which file belongs example: 14ad2cbc3445443fb042fbd1f653ec0e tableName: type: string title: Tablename description: Table name of data the file contains example: IA_INVOICE fileName: type: string title: Filename description: File name example: IA_INVOICE_0001.json.gz startDate: type: string title: Startdate description: Extract file data start time example: 31/01/1970, 21:00:00 endDate: type: string title: Enddate description: Extract file data end time example: 28/03/2024, 10:17:02 downloadUrl: type: string title: Downloadurl description: Url to download file example: https://api.basware.com/v1/dataExtracts/14ad2cbc3445443fb042fbd1f653ec0e/getFile?file=IA_INVOICE_0001.json.gz type: object required: - extractId - tableName - fileName - startDate - endDate - downloadUrl title: DataExtractFileInfo UnauthorizeErrorResponse: properties: message: type: string title: Message description: Detail of error default: Unauthorized example: Unauthorized type: object title: UnauthorizeErrorResponse InternalServerErrorResponse: properties: message: type: string title: Message description: Detail of error default: Internal server error example: Internal server error type: object title: InternalServerErrorResponse ValidationErrorResponse: properties: requestId: type: string title: Requestid description: RequestId of request example: KLF5BiZ9DoEEMlQ= transactionId: type: string title: Transactionid description: TransactionId of request example: JKL5BiZ9DoEEMkV= hasError: type: boolean title: Haserror description: Tells that request has error example: true errorMessages: items: $ref: '#/components/schemas/SchemaValidationError' type: array title: Errormessages type: object title: ValidationErrorResponse TableDefinitionChangeLog: properties: Version: type: string title: Version Added tables: items: type: string type: array title: Added Tables Removed tables: items: type: string type: array title: Removed Tables Column changes: additionalProperties: $ref: '#/components/schemas/TableDefinitionColumnChangeLog' type: object title: Column Changes type: object required: - Version - Added tables - Removed tables - Column changes title: TableDefinitionChangeLog HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError SchemaValidationError: properties: type: type: string title: Type description: Type of error example: VALIDATION code: type: string title: Code description: Code of error example: SCHEMA_VALIDATION_ERROR message: type: string title: Message description: Detail of error example: taskType field required type: object title: SchemaValidationError UnprocessableEntityErrorResponse: properties: message: type: string title: Message description: Detail of error default: UnprocessableEntity example: UnprocessableEntity type: object title: UnprocessableEntityErrorResponse AvailableDataExtractInfo: properties: id: type: string title: Id description: Extract id example: 14ad2cbc3445443fb042fbd1f653ec0e type: type: string enum: - Initial - Delta - DateRange title: Type description: Extract type, can be Initial, Delta or DateRange example: Initial startDate: type: string title: Startdate description: Extract data start time example: 31/01/1970, 21:00:00 endDate: type: string title: Enddate description: Extract data end time example: 28/03/2024, 10:17:02 fileCount: type: integer title: Filecount description: How many files extract contains example: 20 processingStatus: type: string enum: - WaitingForExport - Exported title: Processingstatus description: Processing status of extract, can be WaitingForExport or Exported example: WaitingForExport extractDate: type: string title: Extractdate description: Time when extract is done example: 28/03/2024, 10:21:14 extractName: type: string title: Extractname description: Extract name example: Standard_data_extract type: object required: - id - type - startDate - endDate - fileCount - processingStatus - extractDate - extractName title: AvailableDataExtractInfo securitySchemes: HTTPBasic: type: http scheme: basic