---
title: "init(url:ownershipToken:)"
framework: homekit
role: symbol
role_heading: Initializer
path: "homekit/hmaccessorysetuppayload/init(url:ownershiptoken:)-32mrj"
---

# init(url:ownershipToken:)

Creates an accessory setup payload instance that includes an ownership token.

## Declaration

```swift
init?(url setupPayloadURL: URL, ownershipToken: HMAccessoryOwnershipToken?)
```

## Parameters

- `setupPayloadURL`: The payload used to securely authenticate the accessory. This is the same payload you would receive by scanning the accessory’s QR code.
- `ownershipToken`: A token that proves ownership of the accessory. You typically negotiate this token with the accessory outside of HomeKit.

## Discussion

Discussion For details about the payload’s content, join the MFi Program.

## See Also

### Creating a Payload

- [init(url:)](homekit/hmaccessorysetuppayload/init(url:)-7ytm5.md)
- [HMAccessoryOwnershipToken](homekit/hmaccessoryownershiptoken.md)
