<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "StoreKit",
  "identifier" : "/documentation/StoreKit/Product/PurchaseOption/custom(key:value:)-80cvh",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "StoreKit"
    ],
    "preciseIdentifier" : "s:8StoreKit7ProductV14PurchaseOptionV6custom3key5valueAESS_10Foundation4DataVtFZ"
  },
  "title" : "custom(key:value:)"
}
-->

# custom(key:value:)

Adds data for a custom key to a purchase.

```
static func custom(key: String, value: Data) -> Product.PurchaseOption
```

## Parameters

`key`

The key for this custom option.

`value`

The data value you assign to this custom option.

## Discussion

Use this custom option with the <doc://com.apple.documentation/documentation/AdvancedCommerceAPI>.

---

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)