{"info":{"title":"AutoInvoice Analysis API","version":"0.0.1"},"swagger":"2.0","produces":["application/json"],"securityDefinitions":{"company_auth":{"type":"oauth2","tokenUrl":"https://ax-stage.maventa.com/oauth2/token","flow":"application","scopes":{"analysis":"Grants access to analysis","invoice:receive":"Grants access to invoice receive operations","lookup":"Grants access to lookup operations"}},"operator_auth":{"type":"oauth2","tokenUrl":"https://ax-stage.maventa.com/oauth2/token","flow":"application","scopes":{"operator:analysis":"Grants access to analysis","operator:sending_parties:write":"Grants access to create sending parties","operator:supplier_bank_accounts:write":"Grants access to write supplier bank accounts data"}}},"host":"analysis-stage.maventa.com","tags":[{"name":"status","description":"Operations about statuses"},{"name":"data","description":"Operations about data"},{"name":"check","description":"Operations about checks"},{"name":"analysis","description":"Operations about analyses"},{"name":"analysis_definitions","description":"Operations about analysis_definitions"},{"name":"reports","description":"Operations about reports"},{"name":"reports_definitions","description":"Operations about reports_definitions"}],"paths":{"/status":{"get":{"description":"Public status checks","produces":["application/json"],"parameters":[{"in":"query","name":"auth","type":"string","required":false},{"in":"query","name":"long","type":"boolean","default":false,"required":false}],"responses":{"200":{"description":"Public status checks"}},"tags":["status"],"operationId":"getStatus"}},"/v1/data/sending_parties":{"post":{"description":"Create sending parties","produces":["application/json"],"consumes":["application/json"],"parameters":[{"name":"postV1DataSendingParties","in":"body","required":true,"schema":{"$ref":"#/definitions/postV1DataSendingParties"}}],"security":[{"operator_auth":["operator:sending_parties:write"]}],"responses":{"201":{"description":"Create sending parties"}},"tags":["data"],"operationId":"postV1DataSendingParties"},"get":{"description":"Fetch sending parties","produces":["application/json"],"parameters":[{"in":"query","name":"identifiers","description":"Identifiers. Maximum number: 10","type":"array","items":{"type":"string"},"required":true},{"in":"query","name":"country","description":"Country in ISO 3166-1 alpha-2 format (2 letters)","type":"string","required":false}],"security":[{"company_auth":["lookup"],"operator_auth":["operator:sending_parties:write"]}],"responses":{"200":{"description":"Fetch sending parties"}},"tags":["data"],"operationId":"getV1DataSendingParties"}},"/v1/data/supplier/bank_accounts":{"post":{"description":"Stores supplier bank account information","produces":["application/json"],"consumes":["application/json"],"parameters":[{"name":"postV1DataSupplierBankAccounts","in":"body","required":true,"schema":{"$ref":"#/definitions/postV1DataSupplierBankAccounts"}}],"security":[{"operator_auth":["operator:supplier_bank_accounts:write"]}],"responses":{"201":{"description":"Stores supplier bank account information"}},"tags":["data"],"operationId":"postV1DataSupplierBankAccounts"}},"/v1/check/vat":{"get":{"summary":"Check if an organisation is found from VAT registry","description":"","produces":["application/json"],"parameters":[{"in":"query","name":"bid","description":"BID (Business Identification) or VAT number","type":"string","required":true},{"in":"query","name":"country","description":"Country in ISO 3166-1 alpha-2 format (2 letters)","type":"string","required":true}],"security":[{"company_auth":["analysis"],"operator_auth":["operator:analysis"]}],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_IndividualChecks_VatCheckResult"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}}},"tags":["check"],"operationId":"getV1CheckVat"}},"/v1/check/auto_supplier":{"get":{"summary":"Check if a supplier is sending documents electronically","description":"","produces":["application/json"],"parameters":[{"in":"query","name":"bid","description":"BID (Business Identification) or VAT number","type":"string","required":true},{"in":"query","name":"country","description":"Country in ISO 3166-1 alpha-2 format (2 letters)","type":"string","required":true},{"in":"query","name":"document_type","description":"Document type to check","type":"string","enum":["INVOICE"],"required":true}],"security":[{"company_auth":["analysis"],"operator_auth":["operator:analysis"]}],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_IndividualChecks_AutoSupplierCheckResult"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}}},"tags":["check"],"operationId":"getV1CheckAutoSupplier"}},"/v1/check/bid_status":{"get":{"summary":"Check if an organisation is registered and active, going through insolvency or bankruptcy proceedings. For Finland additional checking that the company is found in the Prepayment register.","description":"","produces":["application/json"],"parameters":[{"in":"query","name":"bid","description":"BID (Business Identification)","type":"string","required":true},{"in":"query","name":"country","description":"Country in ISO 3166-1 alpha-2 format (2 letters)","type":"string","required":true}],"security":[{"company_auth":["analysis"],"operator_auth":["operator:analysis"]}],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_IndividualChecks_BidStatusCheckResult"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}}},"tags":["check"],"operationId":"getV1CheckBidStatus"}},"/v1/check/warning_list":{"get":{"summary":"Check if an organization has had suspicious activity in the past.","description":"","produces":["application/json"],"parameters":[{"in":"query","name":"bid","description":"BID (Business Identification)","type":"string","required":false},{"in":"query","name":"name","description":"Organization name","type":"string","required":false},{"in":"query","name":"country","description":"Country in ISO 3166-1 alpha-2 format (2 letters). If bid does not contain country as prefix, giving it as separate parameter could improve matching a result in search.","type":"string","required":false}],"security":[{"company_auth":["analysis"],"operator_auth":["operator:analysis"]}],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_IndividualChecks_WarningListCheckResult"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}}},"tags":["check"],"operationId":"getV1CheckWarningList"}},"/v1/analysis":{"post":{"summary":"Trigger analysis for given resource","description":"Following checks can be triggered:\n\n**SUPPLIER_ACTIVATION**\nCheck performed on: INVOICE\nFor invoices received through scan service, checks if the sender has sent electronic invoices in the past and could be contacted to change to electronic sending.\n\n\n**BANK_ACCOUNT_CHANGED**\nCheck performed on: INVOICE\n\n\n\n**SENDER_BID_STATUS**\nCheck performed on: INVOICE\nChecks the invoice sender against national company register to see that the company business ID is registered and active.\nThe check also returns information if the company is going through insolvency or bankruptcy proceedings.\nFor Finland additional checking that the company is found in the Prepayment register.\nThe registries used to get this information, depend on the country of the sender and are as follows:\n1. Finland - YTJ [ http://www.ytj.fi ]\n2. Norway - Brønnøysundregistrene [ https://brreg.no ]\n3. Other countries -\u003e not supported\n\n\n\n**SENDER_WARNING_LIST**\nCheck performed on: INVOICE\nChecks the invoice sender against a list of suspicious/fraud companies.\n\n\n**VAT**\nCheck performed on: INVOICE\nFor invoices containing value added tax, checks that the sender of the invoice is found in VAT register.\nNote that if the total amount of value added tax on the invoice is under 1 EUR/NOK/SEK etc., the invoice sender is not checked against the VAT register.\nThe registries used to get this information, depend on the country of the sender and are as follows:\n1. Norway - Brønnøysundregistrene [ https://brreg.no ]\n2. EU countries - Vies [ https://ec.europa.eu/taxation_customs/vies/ ]\n3. Other countries - not supported\n\n\n","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"query","name":"id","description":"Unique ID for the analysis. UUID (Universally Unique Identifier) recommended","type":"string","required":false},{"in":"query","name":"external_id","description":"External reference for the analysis. UUID (Universally Unique Identifier) recommended","type":"string","required":false},{"in":"query","name":"resource_type","type":"string","enum":["INVOICE"],"required":true},{"in":"query","name":"resource_format","description":"Resource data format","type":"string","enum":["INTERNAL"],"required":true},{"in":"query","name":"checks_to_run","description":"Which checks to run: e.g. [\"SUPPLIER_ACTIVATION\", \"BANK_ACCOUNT_CHANGED\", \"SENDER_BID_STATUS\", \"SENDER_WARNING_LIST\", \"VAT\"]","type":"array","items":{"type":"string","enum":["SUPPLIER_ACTIVATION","BANK_ACCOUNT_CHANGED","SENDER_BID_STATUS","SENDER_WARNING_LIST","VAT"]},"required":true},{"name":"postV1Analysis","in":"body","required":true,"schema":{"$ref":"#/definitions/postV1Analysis"}}],"security":[{"company_auth":["analysis"],"operator_auth":["operator:analysis"]}],"responses":{"201":{"description":"Analysis was triggered","schema":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Analysis"}}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}}},"tags":["analysis"],"operationId":"postV1Analysis"}},"/v1/analysis/{id}":{"get":{"summary":"Get status of results or results when ready","description":"","produces":["application/json"],"parameters":[{"in":"path","name":"id","description":"ID of the analysis","type":"string","required":true}],"security":[{"company_auth":["analysis","invoice:receive"],"operator_auth":["operator:analysis"]}],"responses":{"200":{"description":"\n**SUPPLIER_ACTIVATION**\n| \u003cdiv style=\"width:150px\"\u003eStatus\u003c/div\u003e | \u003cdiv style=\"width:150px\"\u003eResult\u003c/div\u003e | \u003cdiv style=\"width:390px\"\u003eReason\u003c/div\u003e | \u003cdiv style=\"width:200px\"\u003eReason code\u003c/div\u003e |\n|------------------|------------------|------------------|-----------------------|\n`                NOT_APPLICABLE`|`NOT_APPLICABLE`|`This is not an invoice. Supplier activation check was not performed.`|`SUPPLIER_ACTIVATION_NOT_AN_INVOICE`|\n`                    RUN_FAILED`|`FAILED`|`Something went wrong when executing the check. Detect could not automatically check if supplier can send electronic invoices.`|`SUPPLIER_ACTIVATION_FAILED`|\n`                       PENDING`||`Check is waiting to be executed.`|`SUPPLIER_ACTIVATION_PENDING`|\n`                NOT_APPLICABLE`|`NOT_APPLICABLE`|`Invoice is not from scan. Supplier activation check was not performed.`|`SUPPLIER_ACTIVATION_INVOICE_NOT_FROM_SCAN`|\n`                RUN_SUCCESSFUL`|`WARNING`|`Sender information is missing from the invoice. Detect could not check if the company can send electronic invoices.`|`SUPPLIER_ACTIVATION_INVALID_INPUT`|\n`                RUN_SUCCESSFUL`|`WARNING`|`According to our data it looks that the company '%{bid}' could also send electronic invoices.`|`SUPPLIER_ACTIVATION_COMPANY_CAN_SEND_ELECTRONIC`|\n`                RUN_SUCCESSFUL`|`OK`|`According to our data, the company '%{bid}' has no record of sending electronic invoices.`|`SUPPLIER_ACTIVATION_COMPANY_CAN_ONLY_SEND_SCAN`\n\n\n**BANK_ACCOUNT_CHANGED**\n| \u003cdiv style=\"width:150px\"\u003eStatus\u003c/div\u003e | \u003cdiv style=\"width:150px\"\u003eResult\u003c/div\u003e | \u003cdiv style=\"width:390px\"\u003eReason\u003c/div\u003e | \u003cdiv style=\"width:200px\"\u003eReason code\u003c/div\u003e |\n|------------------|------------------|------------------|-----------------------|\n`                NOT_APPLICABLE`|`NOT_APPLICABLE`|`This is not an invoice. Bank account changed check was not performed.`|`BANK_ACCOUNT_CHANGED_NOT_AN_INVOICE`|\n`                    RUN_FAILED`|`FAILED`|`Something went wrong when executing the check. Detect could not automatically check if supplier's bank account has changed.`|`BANK_ACCOUNT_CHANGED_FAILED`|\n`                       PENDING`||`Check is waiting to be executed.`|`BANK_ACCOUNT_CHANGED_PENDING`|\n`                RUN_SUCCESSFUL`|`WARNING`|`No valid bank accounts were found on the invoice. Detect could not check the sender bank account.`|`BANK_ACCOUNT_CHANGED_INVALID_INPUT`|\n`                NOT_APPLICABLE`|`NOT_APPLICABLE`|`No bank account information to check was found on the invoice.`|`BANK_ACCOUNT_CHANGED_NO_BANK_ACCOUNTS`|\n`                RUN_SUCCESSFUL`|`WARNING`|`There are no previously known bank accounts for the sender or use of the data is restricted. Detect could not check if the sender bank account has changed.`|`BANK_ACCOUNT_CHANGED_UNKNOWN`|\n`                RUN_SUCCESSFUL`|`WARNING`|`The bank account %{bank_account} on the invoice is different from what the sender %{bid} has used before.`|`BANK_ACCOUNT_CHANGED_CHANGED`|\n`                RUN_SUCCESSFUL`|`OK`|`The bank account %{bank_account} on the invoice is known to be used by the sender %{bid} before.`|`BANK_ACCOUNT_CHANGED_NOT_CHANGED`\n\n\n**SENDER_BID_STATUS**\n| \u003cdiv style=\"width:150px\"\u003eStatus\u003c/div\u003e | \u003cdiv style=\"width:150px\"\u003eResult\u003c/div\u003e | \u003cdiv style=\"width:390px\"\u003eReason\u003c/div\u003e | \u003cdiv style=\"width:200px\"\u003eReason code\u003c/div\u003e |\n|------------------|------------------|------------------|-----------------------|\n`                NOT_APPLICABLE`|`NOT_APPLICABLE`|`This is not an invoice. Sender BID check was not performed.`|`SENDER_BID_STATUS_NOT_AN_INVOICE`|\n`                    RUN_FAILED`|`FAILED`|`Something went wrong when executing the check.`|`SENDER_BID_STATUS_FAILED`|\n`                NOT_APPLICABLE`|`NOT_APPLICABLE`|`The sender BID status check is not supported for senders from '%{country}'.`|`SENDER_BID_STATUS_COUNTRY_NOT_SUPPORTED`|\n`                RUN_SUCCESSFUL`|`WARNING`|`The sender '%{bid}' was not found in %{registry_name}.`|`SENDER_BID_STATUS_NOT_FOUND`|\n`                RUN_SUCCESSFUL`|`WARNING`|`Invalid sender bid '%{bid}' for registry '%{registry_name}'.`|`SENDER_BID_STATUS_INVALID_BID`|\n`                RUN_SUCCESSFUL`|`WARNING`|`Sender BID is missing from the invoice. Detect could not check sender BusinessID status.`|`SENDER_BID_STATUS_NOT_FOUND_NO_BID`|\n`                RUN_SUCCESSFUL`|`WARNING`|`The sender '%{bid}' was found in %{registry_name}, but has been closed.`|`SENDER_BID_STATUS_INACTIVE`|\n`                RUN_SUCCESSFUL`|`WARNING`|`The sender '%{bid}' was found in %{registry_name}, but is under liquidation (%{liquidation_state}).`|`SENDER_BID_STATUS_UNDER_LIQUIDATION`|\n`                RUN_SUCCESSFUL`|`WARNING`|`The sender '%{bid}' was found in %{registry_name}, but is under reorganization (%{reorganization_state}).`|`SENDER_BID_STATUS_UNDER_REORGANIZATION`|\n`                RUN_SUCCESSFUL`|`WARNING`|`The sender '%{bid}' was found in %{registry_name}, but is bankrupt (%{bankruptcy_state}).`|`SENDER_BID_STATUS_BANKRUPT`|\n`                RUN_SUCCESSFUL`|`WARNING`|`The sender '%{bid}' was found in %{registry_name}, but is on hold (%{on_hold_state}).`|`SENDER_BID_STATUS_ON_HOLD`|\n`                RUN_SUCCESSFUL`|`WARNING`|`The sender '%{bid}' was found in %{registry_name} but is not in the Prepayment register.`|`SENDER_BID_STATUS_PREPAYMENT_REGISTER_NOT_FOUND`|\n`                RUN_SUCCESSFUL`|`OK`|`The sender '%{bid}' was found in %{registry_name} and is in the Prepayment register.`|`SENDER_BID_STATUS_PREPAYMENT_REGISTER_FOUND`|\n`                RUN_SUCCESSFUL`|`OK`|`The sender '%{bid}' was found in %{registry_name}.`|`SENDER_BID_STATUS_FOUND`|\n`                       PENDING`||`Check is waiting to be executed.`|`SENDER_BID_STATUS_PENDING`\n\n\n**SENDER_WARNING_LIST**\n| \u003cdiv style=\"width:150px\"\u003eStatus\u003c/div\u003e | \u003cdiv style=\"width:150px\"\u003eResult\u003c/div\u003e | \u003cdiv style=\"width:390px\"\u003eReason\u003c/div\u003e | \u003cdiv style=\"width:200px\"\u003eReason code\u003c/div\u003e |\n|------------------|------------------|------------------|-----------------------|\n`                NOT_APPLICABLE`|`NOT_APPLICABLE`|`This is not an invoice. Sender warning list check was not performed.`|`SENDER_WARNING_LIST_NOT_AN_INVOICE`|\n`                    RUN_FAILED`|`FAILED`|`Something went wrong when executing the check. Detect could not automatically check if sender is found in a warning list.`|`SENDER_WARNING_LIST_FAILED`|\n`                       PENDING`||`Check is waiting to be executed.`|`SENDER_WARNING_LIST_PENDING`|\n`                RUN_SUCCESSFUL`|`WARNING`|`Sender information is missing from the invoice. Detect could not check if the invoice sender is found on the warning list or has been reported suspicious.`|`SENDER_WARNING_LIST_INVALID_INPUT`|\n`                RUN_SUCCESSFUL`|`OK`|`The sender '%{bid} - %{name}' was not found in a warning list.`|`SENDER_WARNING_LIST_NOT_FOUND`|\n`                RUN_SUCCESSFUL`|`WARNING`|`The sender '%{found_search_term}' was found from warning list (sources: %{sources}%{links_to_source_warnings}).`|`SENDER_WARNING_LIST_FOUND`|\n`                RUN_SUCCESSFUL`|`WARNING`|`The sender '%{found_search_term}' was found in warning list (sources: %{sources}%{links_to_source_warnings}), this company has been reported by %{reporter_count} Visma customers.`|`SENDER_WARNING_LIST_USER_REPORTED_FOUND`\n\n\n**VAT**\n| \u003cdiv style=\"width:150px\"\u003eStatus\u003c/div\u003e | \u003cdiv style=\"width:150px\"\u003eResult\u003c/div\u003e | \u003cdiv style=\"width:390px\"\u003eReason\u003c/div\u003e | \u003cdiv style=\"width:200px\"\u003eReason code\u003c/div\u003e |\n|------------------|------------------|------------------|-----------------------|\n`                NOT_APPLICABLE`|`NOT_APPLICABLE`|`This is not an invoice. Sender VAT check was not performed.`|`VAT_NOT_AN_INVOICE`|\n`                    RUN_FAILED`|`FAILED`|`Something went wrong when executing the check. Detect could not automatically check if sender is found in the VAT register.`|`VAT_FAILED`|\n`                       PENDING`||`Check is waiting to be executed.`|`VAT_PENDING`|\n`                RUN_SUCCESSFUL`|`WARNING`|`Invoice is missing information of sender or VAT amount. Detect could not perform sender VAT check.`|`VAT_INVALID_INPUT`|\n`                RUN_SUCCESSFUL`|`WARNING`|`The sender '%{bid}' is not found in VAT registry.`|`VAT_COMPANY_NOT_REGISTERED`|\n`                NOT_APPLICABLE`|`NOT_APPLICABLE`|`No VAT charged in the invoice.`|`VAT_NO_VAT_CHARGED`|\n`                RUN_SUCCESSFUL`|`OK`|`The sender '%{bid}' is found in VAT registry.`|`VAT_COMPANY_REGISTERED`\n\n","schema":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Analysis"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"404":{"description":"Analysis result for id not found","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}}},"tags":["analysis"],"operationId":"getV1AnalysisId"}},"/v1/analysis_definitions":{"get":{"description":"Get definition of all supported analysis checks","produces":["application/json"],"parameters":[{"in":"query","name":"checks","description":"Filter definitions by checks. Possible values:  SUPPLIER_ACTIVATION, BANK_ACCOUNT_CHANGED, SENDER_BID_STATUS, SENDER_WARNING_LIST, VAT","type":"array","items":{"type":"string","enum":["SUPPLIER_ACTIVATION","BANK_ACCOUNT_CHANGED","SENDER_BID_STATUS","SENDER_WARNING_LIST","VAT"]},"required":false},{"in":"query","name":"check_attributes","description":"Filter only definitions of interest. Possible values:  name, friendly_name, friendly_names, title, titles, description, descriptions, doc_description, resource_type, scope, scopes, sources, metadata, possible_results","type":"array","items":{"type":"string","enum":["name","friendly_name","friendly_names","title","titles","description","descriptions","doc_description","resource_type","scope","scopes","sources","metadata","possible_results"]},"required":false}],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_AnalysisDefinitions"}}},"tags":["analysis_definitions"],"operationId":"getV1AnalysisDefinitions"}},"/v1/reports":{"post":{"description":"Report company","produces":["application/json"],"consumes":["application/json"],"parameters":[{"in":"query","name":"invoice_id","description":"Invoice ID","type":"string","required":false},{"in":"query","name":"company[bid]","description":"Company business id","type":"string","required":true},{"in":"query","name":"company[name]","description":"Company name","type":"string","required":true},{"in":"query","name":"company[country_code]","description":"Company country code in ISO 3166-1 alpha-2 format (2 letters)","type":"string","required":false},{"in":"query","name":"company[bank_account]","description":"Company bank account","type":"string","required":false},{"in":"query","name":"reason","description":"Reporting reason. Can be multiple.","type":"array","items":{"type":"string","enum":["NONEXISTENT_PRODUCT","OFFERS_AS_INVOICES","UNKNOWN_COMPANY","INVOICE_NOT_FOLLOWING_LAW","MISLEADING_NAME","IMPOSSIBLE_TO_CONTACT","MISLEADING_MARKETING","COMPANY_NOT_FOLLOWING_LAW","KNOWN_FOR_FRAUD_ATTEMPTS","KNOWN_FOR_SUSPICIOUS_ACTIVITIES"]},"required":true},{"in":"query","name":"contact_email","description":"Contact email for reporter in case of follow up questions","type":"string","required":true},{"in":"query","name":"description","description":"Description for reporting with certain reasons","type":"string","required":false}],"security":[{"company_auth":["analysis","invoice:receive"],"operator_auth":["operator:analysis"]}],"responses":{"204":{"description":"Company successfully reported"},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"409":{"description":"Conflict: company already reported","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}}},"tags":["reports"],"operationId":"postV1Reports"},"get":{"summary":"Fetch user reports","description":"","produces":["application/json"],"parameters":[{"in":"query","name":"bid","description":"Company bid to get user reports for","type":"string","required":false},{"in":"query","name":"invoice_id","description":"ID of the invoice to get user reports for","type":"string","required":false}],"security":[{"company_auth":["analysis","invoice:receive"],"operator_auth":["operator:analysis"]}],"responses":{"200":{"description":"","schema":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_UserReport"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"404":{"description":"No user report found","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}}},"tags":["reports"],"operationId":"getV1Reports"}},"/v1/reports/{id}":{"delete":{"summary":"Delete a user report","description":"","produces":["application/json"],"parameters":[{"in":"path","name":"id","description":"User report id to delete","type":"string","required":true}],"security":[{"company_auth":["analysis","invoice:receive"],"operator_auth":["operator:analysis"]}],"responses":{"204":{"description":"User report successfully deleted"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}},"404":{"description":"No report found with this id","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_Error"}}},"tags":["reports"],"operationId":"deleteV1ReportsId"}},"/v1/reports_definitions":{"get":{"description":"Get useful definitions for user reports ","produces":["application/json"],"responses":{"200":{"description":"","schema":{"$ref":"#/definitions/Analysis_API_Entities_V1_ReportsDefinitions"}}},"tags":["reports_definitions"],"operationId":"getV1ReportsDefinitions"}}},"definitions":{"postV1DataSendingParties":{"type":"object","properties":{"identifier":{"type":"string"},"country":{"type":"string","description":"Country in ISO 3166-1 alpha-2 format (2 letters)"}},"required":["identifier","country"],"description":"Create sending parties"},"postV1DataSupplierBankAccounts":{"type":"object","properties":{"bid":{"type":"string","description":"Supplier identifier"},"country":{"type":"string","description":"Supplier country in ISO 3166-1 alpha-2 format (2 letters)"},"bank_accounts":{"type":"array","description":"Supplier bank accounts","items":{"type":"string"}},"origin_id":{"type":"string","description":"Id of invoice supplier data comes from"}},"required":["bid","country","bank_accounts","origin_id"],"description":"Stores supplier bank account information"},"Analysis_API_Entities_V1_IndividualChecks_VatCheckResult":{"type":"object","properties":{"check_date":{"type":"string","format":"date-time","description":"Check timestamp"},"run_status":{"type":"string","enum":["PENDING","RUN_SUCCESSFUL","RUN_FAILED","NOT_APPLICABLE"],"description":"Check run status"},"status":{"type":"string","enum":["FAILED","WARNING","OK","NOT_APPLICABLE"],"description":"Check result status"},"text":{"type":"string","description":"Check result text"},"texts":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Check result text, translated in all supported languages"},"reason_code":{"type":"string","description":"Check result reason code"},"data":{"allOf":[{"$ref":"#/definitions/Analysis_API_Entities_V1_IndividualChecks_VatData"}],"description":"Check metadata"}},"required":["check_date","run_status","status","text","texts","reason_code","data"],"description":"Analysis_API_Entities_V1_IndividualChecks_VatCheckResult model"},"Analysis_API_Entities_V1_Translation":{"type":"object","properties":{"lang":{"type":"string","description":"Language ISO code the text is translated to"},"value":{"type":"string","description":"Translated text"}},"required":["lang","value"]},"Analysis_API_Entities_V1_IndividualChecks_VatData":{"type":"object","properties":{"bid":{"type":"string","description":"Company business id"},"country":{"type":"string","description":"Company country"},"company_name_in_registry":{"type":"string","description":"Company name in registry"}},"required":["bid","country","company_name_in_registry"]},"Analysis_API_Entities_V1_Error":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"],"description":"Analysis_API_Entities_V1_Error model"},"Analysis_API_Entities_V1_IndividualChecks_AutoSupplierCheckResult":{"type":"object","properties":{"check_date":{"type":"string","format":"date-time","description":"Check timestamp"},"run_status":{"type":"string","enum":["PENDING","RUN_SUCCESSFUL","RUN_FAILED","NOT_APPLICABLE"],"description":"Check run status"},"status":{"type":"string","enum":["FAILED","WARNING","OK","NOT_APPLICABLE"],"description":"Check result status"},"text":{"type":"string","description":"Check result text"},"texts":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Check result text, translated in all supported languages"},"reason_code":{"type":"string","description":"Check result reason code"},"data":{"allOf":[{"$ref":"#/definitions/Analysis_API_Entities_V1_IndividualChecks_AutoSupplierData"}],"description":"Check metadata"}},"required":["check_date","run_status","status","text","texts","reason_code","data"],"description":"Analysis_API_Entities_V1_IndividualChecks_AutoSupplierCheckResult model"},"Analysis_API_Entities_V1_IndividualChecks_AutoSupplierData":{"type":"object","properties":{"bid":{"type":"string","description":"Company business id"}},"required":["bid"]},"Analysis_API_Entities_V1_IndividualChecks_BidStatusCheckResult":{"type":"object","properties":{"check_date":{"type":"string","format":"date-time","description":"Check timestamp"},"run_status":{"type":"string","enum":["PENDING","RUN_SUCCESSFUL","RUN_FAILED","NOT_APPLICABLE"],"description":"Check run status"},"status":{"type":"string","enum":["FAILED","WARNING","OK","NOT_APPLICABLE"],"description":"Check result status"},"text":{"type":"string","description":"Check result text"},"texts":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Check result text, translated in all supported languages"},"reason_code":{"type":"string","description":"Check result reason code"},"data":{"allOf":[{"$ref":"#/definitions/Analysis_API_Entities_V1_IndividualChecks_BidStatusData"}],"description":"Check metadata"}},"required":["check_date","run_status","status","text","texts","reason_code","data"],"description":"Analysis_API_Entities_V1_IndividualChecks_BidStatusCheckResult model"},"Analysis_API_Entities_V1_IndividualChecks_BidStatusData":{"type":"object","properties":{"bid":{"type":"string","description":"Company business id"},"country":{"type":"string","description":"Company country"},"registry_name":{"type":"string","description":"The name of the registry where bid was checked"},"liquidation_state":{"type":"string","description":"Description and status for liquidation_state"},"reorganization_state":{"type":"string","description":"Description and status for reorganization_state"},"bankruptcy_state":{"type":"string","description":"Description and status for bankruptcy_state"},"on_hold_state":{"type":"string","description":"Description and status for on_hold_state"}},"required":["bid","country","registry_name","liquidation_state","reorganization_state","bankruptcy_state","on_hold_state"]},"Analysis_API_Entities_V1_IndividualChecks_WarningListCheckResult":{"type":"object","properties":{"check_date":{"type":"string","format":"date-time","description":"Check timestamp"},"run_status":{"type":"string","enum":["PENDING","RUN_SUCCESSFUL","RUN_FAILED","NOT_APPLICABLE"],"description":"Check run status"},"status":{"type":"string","enum":["FAILED","WARNING","OK","NOT_APPLICABLE"],"description":"Check result status"},"text":{"type":"string","description":"Check result text"},"texts":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Check result text, translated in all supported languages"},"reason_code":{"type":"string","description":"Check result reason code"},"data":{"allOf":[{"$ref":"#/definitions/Analysis_API_Entities_V1_IndividualChecks_WarningListData"}],"description":"Check metadata"}},"required":["check_date","run_status","status","text","texts","reason_code","data"],"description":"Analysis_API_Entities_V1_IndividualChecks_WarningListCheckResult model"},"Analysis_API_Entities_V1_IndividualChecks_WarningListData":{"type":"object","properties":{"bid":{"type":"string","description":"Company business id"},"name":{"type":"string","description":"Company name"},"found_search_term":{"type":"string","description":"Term used that was found in the warning list"},"sources":{"type":"string","description":"Warning list sources where the company was found in"},"links_to_source_warnings":{"type":"string","description":"Warning list links to the source warnings, where the company was found in"},"reporter_count":{"type":"string","description":"How many Visma customers have reported the found company"}},"required":["bid","name","found_search_term","sources","links_to_source_warnings","reporter_count"]},"postV1Analysis":{"type":"object","properties":{"resource_data":{"type":"file","description":"Resource data in chosen format\n\n**INTERNAL**\n```javascript\n{\n  \"company_bid\": \"876820102\",\n  \"company_country\": \"NO\",\n  \"company_name\": \"Oslo Kommune Brann- og Redningsetaten\",\n  \"sum\": \"10\",\n  \"sum_tax\": \"11\",\n  \"origin\": \"SCAN_NO\",\n  \"source\": \"SCAN\"\n}\n```\n\n"}},"required":["resource_data"],"description":"Trigger analysis for given resource"},"Analysis_API_Entities_V1_Analysis":{"type":"object","properties":{"analysis_id":{"type":"string","enum":["PENDING","RUN_SUCCESSFUL","RUN_FAILED","NOT_APPLICABLE"],"description":"Analysis status"},"analysis_type":{"type":"string","description":"Analysis type"},"friendly_name":{"type":"string","description":"Analysis check friendly name"},"friendly_names":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Analysis check friendly name, translated in all supported languages"},"analysis_status":{"type":"string","enum":["PENDING","RUN_SUCCESSFUL","RUN_FAILED","NOT_APPLICABLE"],"description":"Analysis status"},"analysis_title":{"type":"string","description":"Analysis title"},"analysis_titles":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Analysis title, translated in all supported languages"},"analysis_trigger_date":{"type":"string","format":"date-time","description":"Timestamp when check was triggered"},"analysis_origin":{"type":"string","description":"Analysis resource origin"},"analysis_result":{"allOf":[{"$ref":"#/definitions/Analysis_API_Entities_V1_AnalysisResult"}],"description":"Main result of the analysis"},"analysis_results":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_AnalysisResult"},"description":"All results of the analysis"}},"required":["analysis_id","analysis_type","friendly_name","friendly_names","analysis_status","analysis_title","analysis_titles","analysis_trigger_date","analysis_origin","analysis_result","analysis_results"],"description":"Analysis_API_Entities_V1_Analysis model"},"Analysis_API_Entities_V1_AnalysisResult":{"type":"object","properties":{"status":{"type":"string","enum":["FAILED","WARNING","OK","NOT_APPLICABLE"],"description":"Analysis result status"},"text":{"type":"string","description":"Analysis result text"},"texts":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Analysis result text, translated in all supported languages"},"reason_code":{"type":"string","description":"Analysis result reason code"},"check_date":{"type":"string","format":"date-time","description":"Timestamp when check was performed"},"data":{"type":"object","description":"Analysis metadata"}},"required":["status","text","texts","reason_code","check_date","data"]},"Analysis_API_Entities_V1_AnalysisDefinitions":{"type":"object","properties":{"app_version":{"type":"string","description":"Version of the application the definitions correspond to"},"checks":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_CheckDefinition"},"description":"All supported checks with their definitions"}},"required":["app_version","checks"],"description":"Analysis_API_Entities_V1_AnalysisDefinitions model"},"Analysis_API_Entities_V1_CheckDefinition":{"type":"object","properties":{"name":{"type":"string","description":"Check name"},"friendly_name":{"type":"string","description":"Check friendly name"},"friendly_names":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Check friendly name, translated in all supported languages"},"title":{"type":"string","description":"Check title"},"titles":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Check title, translated in all supported languages"},"description":{"type":"string","description":"Check description"},"descriptions":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Check description, translated in all supported languages"},"doc_description":{"type":"string","description":"Check documentation description"},"resource_type":{"type":"string","description":"Resource type the check is run for"},"scope":{"type":"string","description":"Resource scope the check is run for"},"scopes":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Resource scope the check is run for, translated in all supported languages"},"sources":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Source"},"description":"Sources used when running the check"},"metadata":{"allOf":[{"$ref":"#/definitions/Analysis_API_Entities_V1_WarningListMetadata"}],"description":"Additional data about the check"},"possible_results":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_ResultDefinition"},"description":"List of possible results of the check"}}},"Analysis_API_Entities_V1_Source":{"type":"object","properties":{"name":{"type":"string","description":"Source name"},"names":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Source name, translated in all supported languages"}},"required":["name","names"]},"Analysis_API_Entities_V1_WarningListMetadata":{"type":"object","properties":{"criteria":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Criteria"},"description":"Warning List criteria"}},"required":["criteria"]},"Analysis_API_Entities_V1_Criteria":{"type":"object","properties":{"name":{"type":"string","description":"Criteria name"},"friendly_name":{"type":"string","description":"Criteria friendly name"},"friendly_names":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Criteria friendly name, translated in all supported languages"},"text":{"type":"string","description":"Criteria text"},"texts":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Criteria text, translated in all supported languages"}},"required":["name","friendly_name","friendly_names","text","texts"]},"Analysis_API_Entities_V1_ResultDefinition":{"type":"object","properties":{"status":{"type":"string","description":"Status of the check run"},"result":{"type":"string","description":"Status of the returned result of the check "},"reason":{"type":"string","description":"Check result reason text"},"reason_code":{"type":"string","description":"Check result reason code"}},"required":["status","result","reason","reason_code"]},"Analysis_API_Entities_V1_UserReport":{"type":"object","properties":{"id":{"type":"string","description":"User report id"},"company_bid":{"type":"string","description":"Bid of reported company"},"company_name":{"type":"string","description":"Name of reported company"},"company_country_code":{"type":"string","description":"Country code of reported company"},"company_bank_account":{"type":"string","description":"Bank account of reported company"},"reporter_user_id":{"type":"string","description":"Id of reporter user"},"reporter_contact_email":{"type":"string","description":"Contact email of reporter"},"invoice_id":{"type":"string","description":"Reported invoice id"},"reasons":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Criteria"},"description":"Selected reasons at report time"},"additional_explanation":{"type":"string","description":"Additional explanation given by the user at report time"},"report_date":{"type":"string","format":"date-time","description":"Timestamp when report was done"}},"required":["id","company_bid","company_name","company_country_code","company_bank_account","reporter_user_id","reporter_contact_email","invoice_id","reasons","additional_explanation","report_date"],"description":"Analysis_API_Entities_V1_UserReport model"},"Analysis_API_Entities_V1_ReportsDefinitions":{"type":"object","properties":{"criteria":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Criteria"},"description":"User reporting criteria"},"disclaimer_text":{"type":"string","description":"Purpose of user reporting disclaimer text"},"disclaimer_texts":{"type":"array","items":{"$ref":"#/definitions/Analysis_API_Entities_V1_Translation"},"description":"Purpose of user reporting disclaimer text, translated in all supported languages"}},"required":["criteria","disclaimer_text","disclaimer_texts"],"description":"Analysis_API_Entities_V1_ReportsDefinitions model"}}}