---
title: "paymentBillingAddressInvalidError(withKey:localizedDescription:)"
framework: passkit
role: symbol
role_heading: Type Method
path: "passkit/pkpaymentrequest/paymentbillingaddressinvaliderror(withkey:localizeddescription:)"
---

# paymentBillingAddressInvalidError(withKey:localizedDescription:)

Creates a billing address error with the supplied key and user-facing error message.

## Declaration

```swift
class func paymentBillingAddressInvalidError(withKey postalAddressKey: String, localizedDescription: String?) -> any Error
```

## Parameters

- `postalAddressKey`: A key value from doc://com.apple.documentation/documentation/Contacts/CNPostalAddress that indicates which part of the address has an error.
- `localizedDescription`: Optional. Provide a localized, user-facing error message string to help the user resolve the error.

## Discussion

Discussion You can use this convenience method to create a payment error object instead of creating an NSError object yourself.  This method indicates an error in the billing address that is received from an Apple Pay sheet. The error you provide and its optional message appear on the Apple Pay sheet. The available space to display messages is limited, so you should keep your messages concise.

## See Also

### Providing error information

- [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)
- [paymentCouponCodeExpiredError(localizedDescription:)](passkit/pkpaymentrequest/paymentcouponcodeexpirederror(localizeddescription:).md)
