<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "marketplacekit",
  "identifier" : "/documentation/MarketplaceKit/TransactionReporting/token(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "MarketplaceKit"
    ],
    "preciseIdentifier" : "s:14MarketplaceKit20TransactionReportingO5token3forSSAC9TokenTypeV_tYaKFZ"
  },
  "title" : "token(for:)"
}
-->

# token(for:)

Returns a token of the specified type.

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

## Parameters

`tokenType`

The type of token to generate.

## Return Value

JSON data in a Base64URL-encoded string.

## Discussion

When you pass a token type, this method returns a token.

For example, passing the [`coreTechnology`](/documentation/MarketplaceKit/TransactionReporting/TokenType/coreTechnology) token type, returns a token for reporting a potential purchase related to your app.

> Throws: A ``doc://com.apple.MarketplaceKit/documentation/MarketplaceKit/MarketplaceKitError``, if the app doesn’t meet qualifications for transaction reporting. For example, if the ``doc://com.apple.MarketplaceKit/documentation/MarketplaceKit/AppDistributor/current`` distributor isn’t ``doc://com.apple.MarketplaceKit/documentation/MarketplaceKit/AppDistributor/marketplace(_:)`` or ``doc://com.apple.MarketplaceKit/documentation/MarketplaceKit/AppDistributor/web``.

---

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)