---
title: "token(for:)"
framework: marketplacekit
role: symbol
role_heading: Type Method
path: "marketplacekit/transactionreporting/token(for:)"
---

# token(for:)

Returns a token of the specified type.

## Declaration

```swift
static func token(for tokenType: TransactionReporting.TokenType) async throws -> String
```

## Parameters

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

## Mentioned in

Reporting transactions for the Core Technology Commission

## Return Value

Return Value JSON data in a Base64URL-encoded string.

## Discussion

Discussion When you pass a token type, this method returns a token. For example, passing the coreTechnology token type, returns a token for reporting a potential purchase related to your app. note: A MarketplaceKitError, if the app doesn’t meet qualifications for transaction reporting. For example, if the current distributor isn’t AppDistributor.marketplace(_:) or AppDistributor.web.
