Skip to content
Developerhome

Using Bruno

  Less than to read

To see the Transaction Import Connector API in action you can use Bruno, a modern API client with an intuitive GUI for configuring HTTP requests, designing JSON payloads, and viewing HTTP responses.

A Bruno collection is available to illustrate the Transaction Import Connector API methods and workflow.

Setting up Bruno

Step 1: Get Bruno

Visit the Bruno website to Download and install Bruno.

Bruno is available for Windows, macOS, and Linux. You can also install it via package managers:

macOS:

brew install bruno

Windows:

winget install Bruno.Bruno

Linux:

snap install bruno

Step 2: Get the Bruno collection

Bruno supports collections which are a pre-packaged bundle of API requests. To assist in the development and testing of your integration, we have provided our Bruno collection.

Download the Banking Service Bruno Collection from GitHub.

Step 3: Import the Bruno Collection

  1. Unzip the collection file from the downloaded archive
  2. Open Bruno
  3. Click Open Collection or use Ctrl/Cmd + O
  4. Navigate to the unzipped folder and select it
  5. The collection will appear in your workspace

Step 4: Import Postman environment files

Bruno can import Postman environment files, making it easy to migrate from Postman. The environment JSON provided by Sage during registration contains the details of the sandbox test environment including your client ID and secret.

  1. Unzip the JSON format file from the downloaded ZIP archive
  2. Open Bruno
  3. Go to Environments in the left sidebar
  4. Click Import and select the environment JSON file
  5. Ensure the new environment is selected once imported

Using the Bruno Collection

Setup an organisation, company and bank account

The first element which is required for the transaction import is to have a valid organisation, company and bank account. In order to set this up the following calls need to be executed in this order:

POST / Organisations

This first call will setup the organisation and company in banking Service, the next call to run is GET /accessToken:

POST / Organisations

A JWT is returned when using this call and will now allow you to successfully run the POST bankAccounts:

POST / Organisations

The above image shows the new bank account which has been created for this run, the first step of the setup is now complete.

POST / Organisations

Setting up the transactions file

Before we can create a transaction import on the system a file needs to be generated using the provided scripts. For a CAMT053 file there is only one element of the script which needs to be updated, and this is the ID section, this value must be unique when submitting a file. The script and associated element are highlighted below:

POST / Organisations

For a JSON transaction file there are a couple of items that need to be updated prior to running the script. First you need to take the organisationId from the POST / Organisations call and replace the principalId in the script, secondly take the bankAccountId from the POST bankAccounts call and replace both instances of the bankAccountId in the script with this value. All of the values that need to be updated are highlighted below:

POST / Organisations

Once the relevant script is up to date then it can be run from the terminal, both scripts as it stands will create a file containing 100 transactions in the requested format.

Submitting a transaction import

With the file created, you can then post a transaction import. There are two specific calls for this, one for JSON and one for CAMT053. These are both as follows:

JSON

POST / Organisations

CAMT053

POST / Organisations

Once you have created an import using either of the above calls, you can then submit the matching transaction file, there are two separate calls for these and these are shown below. For each call you need to update the file in the body section of the call to the one which you have just created.

JSON

POST / Organisations

CAMT053

POST / Organisations

After submitting the files, you can monitor the status of the import using either the Get all imports for company, or Get single import calls. These will return the transaction import record included within this will be the status, once the status has updated to awaitingConfirmation then the Confirm import call can be ran:

POST / Organisations

Once the Confirm import call has been ran, continue to monitor the status of the import using the calls above until the import reaches a status of either complete or error.