---
title: "promotionalOffer(id:)"
framework: storekit
role: symbol
role_heading: Type Method
path: "storekit/product/purchaseoption/promotionaloffer(id:)"
---

# promotionalOffer(id:)

Sets a promotional offer for the transaction in the testing environment.

## Declaration

```swift
static func promotionalOffer(id identifier: String) -> Product.PurchaseOption
```

## Parameters

- `identifier`: The identifier of the promotional offer to apply to the transaction. You need to set up identifiers in your StoreKit configuration file.

## Discussion

Discussion Use this purchase option when you test your app in Xcode using StoreKit Test and call buyProduct(identifier:options:). This method makes it possible to test promotional offers without supplying a signature. Set up the promotional offer identifiers that you use in this call in your StoreKit configuration file. For more information, see Setting up StoreKit Testing in Xcode. When you apply this option, the purchase transaction simulates a customer redeeming a promotional offer, and includes the promotional offer you specify.

## See Also

### Setting options for StoreKit Testing in Xcode

- [purchaseDate(_:renewalBehavior:)](storekit/product/purchaseoption/purchasedate(_:renewalbehavior:).md)
- [Product.PurchaseOption.SubscriptionRenewalBehavior](storekit/product/purchaseoption/subscriptionrenewalbehavior.md)
- [codeOffer(referenceName:)](storekit/product/purchaseoption/codeoffer(referencename:).md)
