<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HomeKit",
  "identifier" : "/documentation/HomeKit/HMAddAccessoryRequest/makePayload(ownershipToken:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMAddAccessoryRequest(im)payloadWithOwnershipToken:"
  },
  "title" : "makePayload(ownershipToken:)"
}
-->

# makePayload(ownershipToken:)

Builds an accessory setup payload with the given ownership token.

```
func makePayload(ownershipToken: HMAccessoryOwnershipToken) -> HMAccessorySetupPayload?
```

## Parameters

`ownershipToken`

A token proving ownership of the accessory.

## Return Value

An accessory setup payload that you use to add the accessory. The method fails and returns `nil` if the request’s [`requiresSetupPayloadURL`](/documentation/HomeKit/HMAddAccessoryRequest/requiresSetupPayloadURL) property is `true`. In that case, use [`makePayload(url:ownershipToken:)`](/documentation/HomeKit/HMAddAccessoryRequest/makePayload(url:ownershipToken:)) instead.

---

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)