logo
Trustly Docs
BETA

Transportation layer for batch

Updated 1 month ago

Overview

Transportation for batch is sftp and this part describes how/where you upload and download files over SFTP and how you should work with the flow. On the server, the files must be placed in a specific folder.

/batch/


Note make sure to use the batch folder, there are also the reports folder where you will not be able to write.

For the batch files, retention period is 4 weeks.


SFTP interaction

When uploading the batch file and downloading reports, SFTP is used. The API is not solely built upon SFTP rather a combination of JSON-RPC and then SFTP for transferring the data. It’s important to understand the flow, and it’s driven by the JSON-api, which instructs Trustly to look for a specific file on the SFTP server. Reporting status for the payments happens the same way, eg Trustly will upload the report file and once there send the notification that the report is available.

Sending batch file

  1. Create the CSV-File according to the specification and name it to something unique, eg request-20230215.csv.

  2. Calculate the MD5 checksum of the file (eg on osx/linux, ‘md5sum file’)

  3. Upload the CSV-File to the SFTP server

  4. Create the DirectDebitBatchCharge request and set the value of BatchFile and Checksum to the values from above (1 & 2)

Batch notification

  1. When receiving the notification, respond back to Trustly that the notification has been received.

  2. Download the report from the SFTP server based on the information in the batch notification

  3. Process each row in the CSV and update your internal status for each payment.

Batch Process overview