{"openapi":"3.0.2","info":{"title":"Basware SmartPDF invoice upload API","description":"\nThe Basware SmartPDF invoice upload API allows customers to upload PDF documents to the SmartPDF service for data extraction.\n\nThis API is intended for use exclusively by Basware SmartPDF customers, not by suppliers directly. Customers can use this API to upload PDF documents they have received internally and wish to process through the SmartPDF service.\n\nThe API can be activated by Basware consultants from the APIs available at the portfolio tenant level. The customer will receive a username and password from the consultant, which will then be used as described below, depending on the chosen authorization method.\n\nThe document processing occurs in two steps:\n\n- A **POST** request is made to obtain a pre-signed URL for uploading the PDF document.\n- The document is then uploaded to the provided pre-signed URL using a **PUT** request.\n\nThese steps are repeated for each document that is uploaded.\n\n## Authorization\n\nAuthorization within the API can be performed in two ways:\n\n### Basic Authentication\nThe user provides a username and password to the API for authorization.\n\n### OAuth2 Authentication\nUsing a username and password previously provided by the consultant, the user must make a request to the authentication endpoint that returns a JWT token.\n\nAuthentication Endpoint documentation can be found [here](https://api.basware.com/swagger/?urls.primaryName=Authentication#/Tokens/get_token_v1_tokens_post).\n\nThe JWT token must be included in the API request used to obtain the pre-signed URL for uploading the PDF document.\n\n**Important:** When requesting the JWT token, the following permission must be requested:\n\n`importDocuments.write`\n","version":"0.1.0"},"paths":{"/v2/smartpdf/invoiceUpload":{"post":{"tags":["Document Import API"],"summary":"Upload Document Basic Auth","description":"Post upload document metadata and receive a presigned URL for uploading the document","operationId":"upload_document_basic_auth_v2_smartpdf_invoiceUpload_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"examples":{"CONFIGURATION_NOT_FOUND":{"value":{"detail":"Configuration not found"}},"UNAUTHORIZED_OAUTH":{"value":{"detail":"OAuth authorization failed."}},"BASWARE_CUSTOMER_ID_MISMATCH":{"value":{"detail":"Basware Customer ID does not match."}},"INVALID_JWT_TOKEN":{"value":{"detail":"Invalid JWT token."}},"NO_AUTH_METHOD_PROVIDED":{"value":{"detail":"No authentication method provided."}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"examples":{"FORBIDDEN":{"value":{"detail":"Forbidden"}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"examples":{"BOTH_AUTH_METHODS_PROVIDED":{"value":{"detail":"Both JWT token and Basic Auth credentials provided."}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"UploadRequest":{"properties":{"receivingEmailAddress":{"type":"string","format":"email","title":"Receivingemailaddress","description":"Receiving email address","examples":["receiver@abc.com"]},"notificationEmailAddress":{"type":"string","format":"email","title":"Notificationemailaddress","description":"Notification email address","examples":["sender@abc.com"]}},"type":"object","required":["receivingEmailAddress","notificationEmailAddress"],"title":"UploadRequest"},"UploadResponse":{"properties":{"uploadUrl":{"type":"string","title":"Uploadurl","description":"The AWS presigned URL that grants temporary write permission to an S3 object","examples":["https://ued-dub-qa-uem-upload-api-staging.s3.amazonaws.com/apiDocuments/stenantret2022/7b22726563656976696e67456d61696c41646472657373223a2264656d6f756e69746164647265737373733334407369657064662e626173776172652e636f6d222c226e6f74696669636174696f6e456d61696c41646472657373223a2263616c696e2e666c6f72656140626173776172652e636f6d222c226964223a2230353761646635322d643365332d346363362d386466362d313531633031666661656431227d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAV3J4ESG27ZFAJGZS%2F20241003%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20241003T073343Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEHAaCWV1LXdlc3QtMSJFMEMCHwCLR3RhSQcQFha4r8UMivM14WKy7UJYIuPl%2BSWvjgsCIETpJgz5i6WpeaIvTCtN70b0FJPtBfn8YrDu8cL6h5TlKrgDCLn%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEQBRoMNDAyMjQyNDQxNjUzIgwmW%2Bk7DMI0nc0fs20qjAPr3aw8cBeiCu3hIUnv2wDdl8JzcBsVNOXrply9bFWYBkezCJt4g8S2oKmho%2BeIh1E4sBrRgsdT02VcfmrL1YlpAmS1qC4xsrQ7dGXvaYHIL1ft0JMdIK3hjWRFQalIUknS0o9hvyieN98CzGkw2TdefPYzBPrbEDmZiCCUpQXqVdk20ZIChOtreVivte5RvBEsg1POkd0LpiuQmJr%2Fsv4qGvBQMqecOQo6aigmLYLrRI3t1SnnqcI5Kk%2BuS6wTrP4hOvXbK3k6Ky1VKnzOzQnBlD7%2BTgxjHbgum2ywwU2FbPxtc%2BYZ31TY5hHW7EN3G55cxsUZHtjURX1CjiUaEuao1V1pfoQl1jqvN6gb%2BVa1BUKHjhWjsaiTd9JGOpYvqVUH9jXm2JGe%2F3vEeALP1tk6O6W1HWOWqLzyytqB2t6%2B6ArfJVjLIVU%2F4o5nq9udfogOp2DnOXklISoTzfSHsEyxFI7VU41y9qv4B3bajgCS%2FemvjTJzmwM9ULT0zVDNjbMm%2Bk4rml5f%2F3%2F8Socw0pH5twY6nwG%2FW61Z8y%2FcuAJAg9vsZCuQu3jAPqJGkKhzne691%2BomqOjq%2FTc3F6pSIQD0qDutUxdlfkXbomQR4oYcDa65dRueVByRvkCBMGtMpr714SRKiGDKSz7ugjNOdFMRLA9HC4do1XKjYLo75Tb5bYyY9xD9SUOKODm9c2nol0vKqbLmVBUtqiPWbM0TjcNhvQB5EGbZQVgc1fnWMwqYqCTnUQA%3D&X-Amz-Signature=a0765cbc01b82653ffe6b01d327e85487b5c0016788092a3c7d78fa99ca16c1a"]},"bumId":{"type":"string","title":"Bumid","description":"BumId of the document","examples":["a7c80578-6586-472c-ade8-e941443f0ef0"]}},"type":"object","required":["uploadUrl","bumId"],"title":"UploadResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}