<!--
{
  "availability" : [
    "App Store Receipts: 1.0.0 - 1.7.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppStoreReceipts",
  "identifier" : "/documentation/AppStoreReceipts/transaction_id",
  "metadataVersion" : "0.1.0",
  "role" : "Type",
  "symbol" : {
    "kind" : "Type",
    "modules" : [
      "App Store Receipts"
    ],
    "preciseIdentifier" : "data:store_receipts:transaction_id"
  },
  "title" : "transaction_id"
}
-->

# transaction_id

A unique identifier for a transaction, such as a purchase, restore, or renewal.

```
string transaction_id
```

## Discussion

This field is returned in the JSON response, in the [`responseBody.Latest_receipt_info`](/documentation/AppStoreReceipts/responseBody/Latest_receipt_info-data.dictionary) and [`responseBody.Receipt.In_app`](/documentation/AppStoreReceipts/responseBody/Receipt-data.dictionary/In_app-data.dictionary) arrays.

This value has the same format as the transaction’s <doc://com.apple.documentation/documentation/StoreKit/SKPaymentTransaction/transactionIdentifier> property; however, the values may not be the same.

You can use this value to:

- Manage subscribers in your account database. Store the `transaction_id`, `original_transaction_id`, and `product_id` for each transaction, as a best practice to store transaction records for each customer. App Store generates a new value for `transaction_id` every time the subscription automatically renews or is restored on a new device.
- Differentiate a purchase transaction from a restore or a renewal transaction. In a purchase transaction, the `transaction_id` always matches the `original_transaction_id`. For subscriptions, it indicates the first subscription purchase. For a restore or renewal, the `transaction_id` does not match the `original_transaction_id`. If a user restores or renews the same purchase multiple times, each restore or renewal has a different `transaction_id`.

---

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)