---
title: "paymentCouponCodeInvalidError(localizedDescription:)"
framework: passkit
role: symbol
role_heading: Type Method
path: "passkit/pkpaymentrequest/paymentcouponcodeinvaliderror(localizeddescription:)"
---

# paymentCouponCodeInvalidError(localizedDescription:)

Returns an error object that indicates an invalid coupon.

## Declaration

```swift
static func paymentCouponCodeInvalidError(localizedDescription: String? = nil) -> any Error
```

## Parameters

- `localizedDescription`: A user-readable error as a localized string.

## Return Value

Return Value A new invalid coupon error.

## Discussion

Discussion Use this convenience method to create a payment error object instead of creating an NSError object yourself. This method indicates that the coupon code received from the Apple Pay sheet is invalid. The error you provide and its optional message appear on the Apple Pay sheet. There’s limited available space to display messages, so keep your messages concise.

## See Also

### Providing error information

- [paymentBillingAddressInvalidError(withKey:localizedDescription:)](passkit/pkpaymentrequest/paymentbillingaddressinvaliderror(withkey:localizeddescription:).md)
- [paymentContactInvalidError(withContactField:localizedDescription:)](passkit/pkpaymentrequest/paymentcontactinvaliderror(withcontactfield:localizeddescription:).md)
- [paymentShippingAddressInvalidError(withKey:localizedDescription:)](passkit/pkpaymentrequest/paymentshippingaddressinvaliderror(withkey:localizeddescription:).md)
- [paymentShippingAddressUnserviceableError(withLocalizedDescription:)](passkit/pkpaymentrequest/paymentshippingaddressunserviceableerror(withlocalizeddescription:).md)
- [paymentCouponCodeExpiredError(localizedDescription:)](passkit/pkpaymentrequest/paymentcouponcodeexpirederror(localizeddescription:).md)
