---
title: "beginRefundRequest(in:)"
framework: StoreKit
role: symbol
role_heading: Instance Method
platforms: [iOS 15.0+, iPadOS 15.0+, Mac Catalyst 15.0+, visionOS 1.0+]
path: storekit/transaction/3803220-beginrefundrequest
---

# beginRefundRequest(in:)

Presents the refund request sheet for the transaction in a window scene.

## Declaration

```swift
func beginRefundRequest(in scene: UIWindowScene) async throws -> Transaction.RefundRequestStatus
```

## Parameters

- `scene`: The [doc://com.apple.documentation/documentation/UIKit/UIWindowScene](uikit/uiwindowscene.md) that the system displays the sheet on.

## Return Value

[Transaction.RefundRequestStatus](refundrequeststatus.md)

## 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`.

When a customer requests a refund for consumable in-app purchases through your app, the App Stores sends a `CONSUMPTION_REQUEST` [notificationType](../../appstoreservernotifications/notificationtype.md) to your server. If the customer provided consent, respond by sending consumption data to the App Store using the [Send Consumption Information](../../appstoreserverapi/send-consumption-information.md) 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](../enabling-app-store-server-notifications.md).

> **note:** If your app uses SwiftUI, use [refundRequestSheet(for:isPresented:onDismiss:)](../../swiftui/view/refundrequestsheet(for:ispresented:ondismiss:).md) instead. For example usage, see [Food Truck: Building a SwiftUI multiplatform app](../../swiftui/food-truck-building-a-swiftui-multiplatform-app.md).

### Test refund requests

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

## See Also

### Requesting refunds

- [Testing refund requests](../testing-refund-requests.md)
- [beginRefundRequest(in:)](beginrefundrequest(in:)-63bvd.md)
- [beginRefundRequest(for:in:)](beginrefundrequest(for:in:)-65tph.md)
- [beginRefundRequest(for:in:)](beginrefundrequest(for:in:)-9mscy.md)
- [Transaction.RefundRequestError](refundrequesterror.md)
- [Transaction.RefundRequestStatus](refundrequeststatus.md)
