<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PassKit",
  "identifier" : "/documentation/PassKit/PKPaymentAuthorizationResult",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "PassKit (Apple Pay and Wallet)"
    ],
    "preciseIdentifier" : "c:objc(cs)PKPaymentAuthorizationResult"
  },
  "title" : "PKPaymentAuthorizationResult"
}
-->

# PKPaymentAuthorizationResult

An object that reports the status code and errors for a payment authorization request.

```
class PKPaymentAuthorizationResult
```

## Overview

If the Apple Pay sheet contains errors, you provide a [`PKPaymentAuthorizationStatus.failure`](/documentation/PassKit/PKPaymentAuthorizationStatus/failure) status to [`PKPaymentAuthorizationResult`](/documentation/PassKit/PKPaymentAuthorizationResult), and include the errors in the errors array. If there are no errors, you provide a [`PKPaymentAuthorizationStatus.success`](/documentation/PassKit/PKPaymentAuthorizationStatus/success) status and leave the error array empty.

The following code example shows a failure result with two errors in the postal code and street fields.

A result that reports two errors:

```swift
// Error in postal code field.
let shippingInvalidZip =
PKPaymentRequest.paymentShippingAddressInvalidError(withKey:CNPostalAddressPostalCodeKey,
                                                    localizedDescription: "Invalid ZIP code")
// Error in street address field.
let shippingInvalidStreet = PKPaymentRequest.paymentShippingAddressInvalidError(withKey:CNPostalAddressStreetKey,
                                                    localizedDescription: "Missing street name")
// Result with failure status and errors.
let result = PKPaymentAuthorizationResult(status: .failure, 
                                          errors: [shippingInvalidZip, shippingInvalidStreet])
```

## Topics

### Initializing a payment authorization result

[`-  initWithStatus:errors:`](/documentation/PassKit/PKPaymentAuthorizationResult/init(status:errors:))

Initializes the result with the status code and list of errors.

### Setting order details

[`orderDetails`](/documentation/PassKit/PKPaymentAuthorizationResult/orderDetails)

Optional metadata with order details for the placed order.

[`PKPaymentOrderDetails`](/documentation/PassKit/PKPaymentOrderDetails)

Optional metadata with payment order details for the placed order.

### Setting payment authorization status and errors

[`errors`](/documentation/PassKit/PKPaymentAuthorizationResult/errors)

List of errors in the Apple Pay sheet.

[`status`](/documentation/PassKit/PKPaymentAuthorizationResult/status)

Payment authorization general status.

[`PKPaymentAuthorizationStatus`](/documentation/PassKit/PKPaymentAuthorizationStatus)

General success and failure status for payment authorization.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)