<!--
{
  "availability" : [
    "iOS: 3.0.0 - 18.0.0",
    "iPadOS: 3.0.0 - 18.0.0",
    "macCatalyst: 13.1.0 - 18.0.0",
    "macOS: 10.7.0 - 15.0.0",
    "tvOS: 9.0.0 - 18.0.0",
    "visionOS: 1.0.0 - 2.0.0",
    "watchOS: 6.2.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/SKPaymentQueue/finishTransaction(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "StoreKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKPaymentQueue(im)finishTransaction:"
  },
  "title" : "finishTransaction(_:)"
}
-->

# finishTransaction(_:)

Notifies the App Store that the app finished processing the transaction.

```
func finishTransaction(_ transaction: SKPaymentTransaction)
```

## Parameters

`transaction`

The transaction to finish.

## Discussion

Transactions on the payment queue are persistent until they are completed. StoreKit calls your observer’s [`paymentQueue(_:updatedTransactions:)`](/documentation/StoreKit/SKPaymentTransactionObserver/paymentQueue(_:updatedTransactions:)) method every time your app launches or resumes from background to tell you about transactions in the queue. After you’ve finished processing a transaction in your app, always call the [`finishTransaction(_:)`](/documentation/StoreKit/SKPaymentQueue/finishTransaction(_:)) method to finish the transaction and remove it from the queue.

Call [`finishTransaction(_:)`](/documentation/StoreKit/SKPaymentQueue/finishTransaction(_:)) only after the app has finished all work it performs to complete the transaction. The transaction’s state determines which steps you might take:

- For a failed transaction ([`SKPaymentTransactionState.failed`](/documentation/StoreKit/SKPaymentTransactionState/failed)), update your user interface, track information in analytics, and perform other similar tasks.
- For a successful transaction ([`SKPaymentTransactionState.purchased`](/documentation/StoreKit/SKPaymentTransactionState/purchased) or [`SKPaymentTransactionState.restored`](/documentation/StoreKit/SKPaymentTransactionState/restored)), perform all necessary actions to unlock the functionality the user has purchased before finishing the transaction. For example, if you are downloading content, finish the transaction only after the downloads are complete.

If you validate receipts, validate them before completing the transaction, and take one of the paths described above.

In rare circumstances, this call might fail, and you’ll receive updates for that transaction again. For this reason, you should record information in your app about the transactions it has processed and which steps the app has already completed. That way, you don’t repeat steps that shouldn’t be performed multiple times. For example, if you are processing a consumable transaction, you only want to add the consumable benefit once.

If you call [`finishTransaction(_:)`](/documentation/StoreKit/SKPaymentQueue/finishTransaction(_:)) on a transaction that is in the [`SKPaymentTransactionState.purchasing`](/documentation/StoreKit/SKPaymentTransactionState/purchasing) state, StoreKit raises an exception.

## See Also

[`paymentQueue(_:updatedTransactions:)`](/documentation/StoreKit/SKPaymentTransactionObserver/paymentQueue(_:updatedTransactions:))

Tells an observer that one or more transactions have been updated.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)