<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/Transaction/beginRefundRequest(for:in:)-9mscy",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "StoreKit"
    ],
    "preciseIdentifier" : "s:8StoreKit11TransactionV18beginRefundRequest3for2inAC0eF6StatusOs6UInt64V_So16NSViewControllerCtYaKFZ"
  },
  "title" : "beginRefundRequest(for:in:)"
}
-->

# beginRefundRequest(for:in:)

Presents the refund request sheet for the specified transaction in a view controller.

```
static func beginRefundRequest(for transactionID: UInt64, in controller: NSViewController) async throws -> Transaction.RefundRequestStatus
```

## Parameters

`transactionID`

The identifier of the transaction the user is requesting a refund for.

`controller`

The <doc://com.apple.documentation/documentation/AppKit/NSViewController> that the system displays the sheet on.

## Return Value

[`Transaction.RefundRequestStatus`](/documentation/StoreKit/Transaction/RefundRequestStatus)

## Discussion

Call this function from account settings or a help menu to enable customers to request a refund for an in-app purchase within your app. When you call this function, the system displays a refund sheet with the customer’s purchase details and a list of reason codes for the customer to choose from. For design guidance, see [Human Interface Guidelines > In-app purchase > Providing help with in-app purchases](https://developer.apple.com/design/human-interface-guidelines/in-app-purchase/overview/introduction/#providing-help-with-in-app-purchases).

When a customer requests a refund for consumable in-app purchases through your app, the App Stores sends a `CONSUMPTION_REQUEST` <doc://com.apple.documentation/documentation/AppStoreServerNotifications/notificationType> to your server. If the customer provided consent, respond by sending consumption data to the App Store using the <doc://com.apple.documentation/documentation/AppStoreServerAPI/Send-Consumption-Information> endpoint. If not, don’t respond to the `CONSUMPTION_REQUEST` notification.

The App Store takes up to 48 hours to either approve or deny a refund.

For information about setting up your server to receive notifications, see [Enabling App Store Server Notifications](/documentation/StoreKit/enabling-app-store-server-notifications).

> Note:
> If your app uses SwiftUI, use <doc://com.apple.documentation/documentation/SwiftUI/View/refundRequestSheet(for:isPresented:onDismiss:)> instead. For example usage, see <doc://com.apple.documentation/documentation/SwiftUI/food-truck-building-a-swiftui-multiplatform-app>.

### Test refund requests

The sandbox environment and StoreKit Testing in Xcode both support testing refund requests. For more information, see [Testing refund requests](/documentation/StoreKit/testing-refund-requests).

---

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)