---
title: clearTransactions()
framework: StoreKit Test
role: symbol
role_heading: Instance Method
platforms: [iOS 14.0+, iPadOS 14.0+, Mac Catalyst 14.0+, macOS 11.0+, tvOS 14.0+, visionOS 1.0+, watchOS 7.0+]
path: storekittest/sktestsession/3579476-cleartransactions
---

# clearTransactions()

Removes all transactions from the test environment.

## Declaration

```swift
func clearTransactions()
```

## Discussion

After you clear the transactions from the test environment, the test environment produces an empty receipt. Use this method to enable repeating tests for one-time purchases.

To revert all the settings in the test environment to those in the StoreKit configuration file, see [resetToDefaultState()](resettodefaultstate().md).

## See Also

### Managing transactions in the test environment

- [allTransactions()](alltransactions().md)
- [deleteTransaction(identifier:)](deletetransaction(identifier:).md)
