---
title: "deleteTransaction(identifier:)"
framework: storekittest
role: symbol
role_heading: Instance Method
path: "storekittest/sktestsession/deletetransaction(identifier:)"
---

# deleteTransaction(identifier:)

Deletes a specific transaction from the test environment.

## Declaration

```swift
func deleteTransaction(identifier: Int) throws
```

## Parameters

- `identifier`: The transaction identifier.

## Discussion

Discussion When you delete a transaction, the test environment also removes the existing transaction from the receipt. Some transactions don’t appear in the receipt, including finished consumable purchases, failed purchases, Ask To Buy transactions pending approval, and restored purchases. Deleting a transaction deletes its child transactions, for example: Deleting an original subscription transaction deletes all related renewal transactions. Deleting a transaction deletes any associated restored transactions.

## See Also

### Managing transactions in the test environment

- [allTransactions()](storekittest/sktestsession/alltransactions().md)
- [clearTransactions()](storekittest/sktestsession/cleartransactions().md)
