---
title: "makePayload(ownershipToken:)"
framework: homekit
role: symbol
role_heading: Instance Method
path: "homekit/hmaddaccessoryrequest/makepayload(ownershiptoken:)"
---

# makePayload(ownershipToken:)

Builds an accessory setup payload with the given ownership token.

## Declaration

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

## Parameters

- `ownershipToken`: A token proving ownership of the accessory.

## Return Value

Return Value An accessory setup payload that you use to add the accessory. The method fails and returns nil if the request’s requiresSetupPayloadURL property is true. In that case, use makePayload(url:ownershipToken:) instead.

## See Also

### Creating a Payload

- [makePayload(url:ownershipToken:)](homekit/hmaddaccessoryrequest/makepayload(url:ownershiptoken:).md)
