---
title: "custom(key:value:)"
framework: storekit
role: symbol
role_heading: Type Method
path: "storekit/product/purchaseoption/custom(key:value:)-80cvh"
---

# custom(key:value:)

Adds data for a custom key to a purchase.

## Declaration

```swift
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.

## Mentioned in

Sending Advanced Commerce API requests from your app

## Discussion

Discussion Use this custom option with the Advanced Commerce API.

## See Also

### Setting custom purchase options

- [custom(key:value:)](storekit/product/purchaseoption/custom(key:value:)-3g3nc.md)
- [custom(key:value:)](storekit/product/purchaseoption/custom(key:value:)-8tjim.md)
- [custom(key:value:)](storekit/product/purchaseoption/custom(key:value:)-7rju9.md)
