<!--
{
  "availability" : [
    "App Store Server API: 1.16.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppStoreServerAPI",
  "identifier" : "/documentation/AppStoreServerAPI/Set-App-Account-Token",
  "metadataVersion" : "0.1.0",
  "role" : "Web Service Endpoint",
  "symbol" : {
    "kind" : "Web Service Endpoint",
    "modules" : [
      "App Store Server API"
    ],
    "preciseIdentifier" : "rest:app_store_server_api:put:v1-transactions-{}-appAccountToken"
  },
  "title" : "Set App Account Token"
}
-->

# Set App Account Token

Sets the app account token value for a purchase the customer makes outside of your app, or updates its value in an existing transaction.

## Discussion

An [`appAccountToken`](/documentation/AppStoreServerAPI/appAccountToken) is a UUID you create to associate a transaction with a customer account in your system. Use the [`Set App Account Token`](/documentation/AppStoreServerAPI/Set-App-Account-Token) endpoint to set or reset the `appAccountToken` associated with the transaction you specify in the `originalTransactionId` parameter.

Typically, your app sets the <doc://com.apple.documentation/documentation/StoreKit/Product/PurchaseOption/appAccountToken(_:)> when a customer makes a purchase in your app. However, customers can also purchase in-app products outside of your app, for example, by redeeming an offer code in the App Store. In that case, the original transaction doesn’t include an app account token. Use the `Set App Account Token` endpoint to associate an app account token with such transactions.

This endpoint supports setting the `appAccountToken` for all product types, including one-time purchases (consumables, non-consumables, and non-renewing subscriptions) and auto-renewable subscriptions. If you call this endpoint for a transaction that already has an `appAccountToken`, the endpoint replaces the existing value with the new value you supply.

For auto-renewable subscriptions, the endpoint applies the `appAccountToken` to the current renewal transaction and subsequent renewals, but it doesn’t affect past transactions. The same `appAccountToken` continues to apply to renewal transactions if the customer upgrades, downgrades, or cross-grades the subscription.

This endpoint doesn’t support transactions for products shared through Family Sharing, where the transaction has an [`inAppOwnershipType`](/documentation/AppStoreServerAPI/inAppOwnershipType) value of `FAMILY_SHARED`.

You can assign the same `appAccountToken` value to more than one transaction, according to your needs. For example, you may choose to reuse the same `appAccountToken` value for every transaction that belongs to the same customer.

---

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)