<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "AppStoreServerAPI",
  "identifier" : "/documentation/AppStoreServerAPI/originalTransactionId",
  "metadataVersion" : "0.1.0",
  "role" : "Type",
  "symbol" : {
    "kind" : "Type",
    "modules" : [
      "App Store Server API"
    ],
    "preciseIdentifier" : "data:app_store_server_api:originalTransactionId"
  },
  "title" : "originalTransactionId"
}
-->

# originalTransactionId

The original transaction identifier of a purchase.

```
string originalTransactionId
```

## Discussion

The App Store generates an original transaction identifier when a customer makes a successful in-app purchase. Most App Store Server API endpoints accept an `originalTransactionId`.

There are several ways to obtain this value: from your app after a user makes a successful in-app purchase, from transaction information provided in <doc://com.apple.documentation/documentation/AppStoreServerNotifications>, or from <doc://com.apple.documentation/documentation/AppStoreReceipts> for apps that use the <doc://com.apple.documentation/documentation/StoreKit/original-api-for-in-app-purchase>.

To get the original transaction identifier from your app, use the <doc://com.apple.documentation/documentation/StoreKit/Transaction/originalID> property of the <doc://com.apple.documentation/documentation/StoreKit/Transaction> object that represents the in-app purchase.

If you’ve enabled <doc://com.apple.documentation/documentation/AppStoreServerNotifications>, your server receives notifications for in-app purchase events that include the transaction information with the original transaction identifier. For more information, see <doc://com.apple.documentation/documentation/AppStoreServerNotifications/responseBodyV2DecodedPayload>.

If your app uses the <doc://com.apple.documentation/documentation/StoreKit/original-api-for-in-app-purchase>, the original transaction identifier is the <doc://com.apple.documentation/documentation/StoreKit/SKPaymentTransaction/transactionIdentifier> property in the <doc://com.apple.documentation/documentation/StoreKit/SKPaymentTransaction> object. For restored purchases, the original transaction identifier is found in the <doc://com.apple.documentation/documentation/StoreKit/SKPaymentTransaction/transactionIdentifier> of the <doc://com.apple.documentation/documentation/StoreKit/SKPaymentTransaction/original> property. If you verify receipts using <doc://com.apple.documentation/documentation/AppStoreReceipts/Verify-Receipt>, the original transaction identifier is the <doc://com.apple.documentation/documentation/AppStoreReceipts/original_transaction_id> value.

Use the value of the original transaction identifier that you get from your app, a notification, or a receipt as the value for [`originalTransactionId`](/documentation/AppStoreServerAPI/originalTransactionId) when you send requests to the App Store Server API.

> Tip:
> If you maintain a database to manage your subscribers, save the original transaction identifier to uniquely identify auto-renewable subscriptions.

---

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)