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

# paymentCouponCodeExpiredError(localizedDescription:)

Returns an error object that indicates an expired coupon.

## Declaration

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

## Parameters

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

## Return Value

Return Value A new expired 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 has expired. 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)
- [paymentCouponCodeInvalidError(localizedDescription:)](passkit/pkpaymentrequest/paymentcouponcodeinvaliderror(localizeddescription:).md)
