Get started with Basware SmartPDF API

Get Started

The Basware SmartPDF API is a REST API integration method that allows users to upload PDF documents to the SmartPDF document flow. With this API, SmartPDF customers can upload all their PDF documents, including those not received via email. 

Prerequisites

To access Basware SmartPDF API you need credentials. These will be provided by your Basware SmartPDF delivery project consultant or your technical partner manager. 

Try it out

This example posts a new PDF document to Basware SmartPDF. To interact with the API you can use any tool capable of posting HTTP messages, such as Postman or curl. This example uses Postman. 

Endpoint: POST https://api.basware.com/v2/smartpdf/invoiceUpload

Request body:

Content-Type: application/json  

  "receivingEmailAddress": "receiver@abc.com", 
  "notificationEmailAddress": "sender@abc.com" 
}

You can authenticate this request using either Basic Authentication or OAuth2, depending on what your integration supports.

Option 1: Basic Authentication

Send your username and password directly with the request for authorization.

  1. Set the request method to POST and the URL to https://api.basware.com/v2/smartpdf/invoiceUpload
  2. Add your Basic Auth credentials (username/password) to the request headers
  3. Attach the JSON payload above as the request body
  4. Send the request

Option 2: OAuth2 Authentication

Use a username and password (provided to you by your Basware consultant) to first obtain a JWT token, then use that token to call the SmartPDF endpoint.

  1. Request a JWT token from the authentication endpoint. Full documentation is available here. Important: When requesting the token, you must include the following permission scope:
    • importDocuments.write  
  1. Copy the JWT token returned by the authentication endpoint.
  2. Call the SmartPDF endpoint, including the JWT token in the Authorization header (typically as a Bearer token):
    • POST https://api.basware.com/v2/smartpdf/invoiceUpload
    • Attach the same JSON payload as above

The above settings use Basware API environment in European region, which is the only available region for SmartPDF APIs. End part of the URL 'v2/smartpdf/invoiceUpload' determines the API being executed. Use Content-type: application/json. You need to change the values of the fields in message payload to match your document to be uploaded to Basware SmartPDF. 

In response you should get a '200 OK' and in response body a pre-signed URL, where the actual PDF file can be uploaded with PUT request.

Where to next?

If you are considering using Basware SmartPDF API in your projects, you might want to find out how well you can program the web service calls required for using the API from your ERP system or integration platform.  

If you want to dive deeper into the API functionality itself, please check out the SmartPDF API reference for supported methods or the SmartPDF API manual for most common usage scenarios and common considerations.