<!--
{
  "availability" : [
    "iOS: 15.5.0 -",
    "iPadOS: 15.5.0 -",
    "macOS: 12.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/onApplePayCouponCodeChange(perform:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewP09_PassKit_aB0E26onApplePayCouponCodeChange7performQrSo016PKPaymentRequestiJ6UpdateCSSYac_tF"
  },
  "title" : "onApplePayCouponCodeChange(perform:)"
}
-->

# onApplePayCouponCodeChange(perform:)

Called when a user has entered or updated a coupon code.
This is required if the user is being asked to provide a coupon code.

```
nonisolated func onApplePayCouponCodeChange(perform action: @escaping (String) async -> PKPaymentRequestCouponCodeUpdate) -> some View
```

## Return Value

An update to the payment request with the coupon code.

---

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)