---
title: "token(for:)"
framework: StoreKit
role: symbol
role_heading: Type Method
platforms: [iOS 18.1+, iPadOS 18.1+, Mac Catalyst 18.1+, macOS 15.1+, tvOS 18.1+, visionOS 2.1+, watchOS 11.1+]
path: "storekit/externalpurchasecustomlink/token(for:)-1fyo"
---

# token(for:)

Returns an external purchase token of the specified type.

## Declaration

```swift
static func token(for tokenType: String) async throws -> ExternalPurchaseCustomLink.Token?
```

## Parameters

- `tokenType`: The type of token to request.

## Discussion

Discussion If isEligible is false, this method will always fail. note: A StoreKitError.

## See Also

### Deprecated methods and values

- [showNotice(type:)](storekit/externalpurchasecustomlink/shownotice(type:).md)
- [ExternalPurchaseCustomLink.NoticeType](storekit/externalpurchasecustomlink/noticetype.md)
