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

# declineAskToBuyTransaction(identifier:)

Resolves an Ask to Buy test scenario by declining the transaction.

## Declaration

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

## Parameters

- `identifier`: The transaction doc://com.apple.storekittest/documentation/StoreKitTest/SKTestTransaction/identifier of an Ask to Buy transaction.

## See Also

### Testing Ask To Buy transactions

- [askToBuyEnabled](storekittest/sktestsession/asktobuyenabled.md)
- [approveAskToBuyTransaction(identifier:)](storekittest/sktestsession/approveasktobuytransaction(identifier:).md)
