State machine statuses
Less than to read
The import state transitions are shown in the following diagram.
Import state diagram
State machine statuses
During the standard ‘happy path’ flow of calling the Transaction Import Connector API, the status of the Transaction Import will change depending on the progress throughout the flow.
When you call the POST Import Request endpoint, this is the initial status the transaction import will be set at. It will remain in this state, until a file has been uploaded via the pre-signed URL which was generated from the initial POST request.
The status of the transaction import will be set to ‘queued’ if there’s an earlier transaction import for the same organisation in one of the following statuses:
If no other transaction imports in one of those statuses can be found, then assuming there’s no other transaction import for the same organisation also in a ‘queued’ status, it will begin processing.
If they’re multiple ‘queued’ transaction imports for the same organisation, then the one with the oldest ‘created’ date, will be the first to start processing.
The transaction import is being validated, parsed and the transactions are being submitted to Provider API (PAPI) ready to be processed into Banking Service.
The transaction import has been validated by ProviderAPI, and is ready to be confirmed. This is the final chance for a user to cancel, and delete their transaction import request. The Transaction Import Connector will poll against PAPI every 10 seconds initially (then every 60 seconds once a poll attempt threshold has been hit). This is to check the status of the batch on PAPI. Depending on the review level selected at the start of the import, user input is required to verify whether to continue the import despite of warnings if any.
At this point, the transaction import has been confirmed by the user, and PAPI has started processing the transactions into their bank account in Banking Service. Similar to the ‘awaitingConfirmation’ stage, a poll against PAPI will occur until PAPI returns a completed or error status.
PAPI successfully processed the batch of transactions and the transaction import has been marked as complete.
At any stage during the flow of importing transactions, various errors can occur, if this happens, the errorDetails object which contains error, warning and info details will be updated if the error was handled and then the status of the transaction import will be set to ‘error’.
A user can call the DELETE endpoint before the transactions are submitted to Banking Service and the transaction import will be marked as ‘deleted’. You can still perform a GET request against the transaction import and see it in its ‘deleted’ state. Calling the DELETE endpoint will:
- Delete the file from S3
- Delete the batch from PAPI
- Update the Transaction Import status to ‘deleted’