Swish

Payment State

Different states in the payment process.

Edit "Payment State" on GitHub

Payment State

The state field on the sale does not indicate whether a given transaction was successful or not, it only tells whether the sale resource itself is operational or not. To figure out the state of i.e. sale transactions, you have two options:

You can perform a GET request on the sale. As long as the sale has been completed, successful or not, you will find the Paid or Failed operation among the operations in the response.

Please note that a sale where a Failed attempt has been made, but the payer still has attempts left to complete the sale, you won’t see the Failed operation. It will only appear when all attempts have been made.

Authorization Or Sale Transactions

Find the sale’s list of transactions either by expanding it when retrieving the sale, or by performing a GET request towards the transactions.id URL.

If you find a transaction with type equal to sale, with its state equal to Completed, you can be sure that the amount of the sale has been reserved or withdrawn and that the sale can be considered successful.