Get Transaction History
Get a customer’s in-app purchase transaction history for your app.
URL
GET https://api.storekit.apple.com/inApps/v2/history/{anyTransactionId}Sandbox URL
GET https://api.storekit-sandbox.apple.com/inApps/v2/history/{anyTransactionId}Path Parameters
| Name | Type | Description |
|---|---|---|
anyTransactionId Required | anyTransactionId | Any originalTransactionId, transactionId or appTransactionId that belongs to the customer for your app. |
Query Parameters
| Name | Type | Description |
|---|---|---|
revision Optional | revision | A token you provide to get the next set of up to 20 transactions. All responses include a Note: The |
startDate Optional | startDate | An optional start date of the timespan for the transaction history records you’re requesting. The |
endDate Optional | endDate | An optional end date of the timespan for the transaction history records you’re requesting. Choose an |
productId Optional | [productId] | An optional filter that indicates the product identifier to include in the transaction history. Your query may specify more than one |
productType Optional | [string] | An optional filter that indicates the product type to include in the transaction history. Your query may specify more than one |
inAppOwnershipType Optional | inAppOwnershipType | An optional filter that limits the transaction history by the in-app ownership type. |
sort Optional | string | An optional sort order for the transaction history records. The response sorts the transaction records by their recently modified date. The default value is |
revoked Optional | boolean | An optional Boolean value that indicates whether the response includes only revoked transactions when the value is |
subscriptionGroupIdentifier Optional | [subscriptionGroupIdentifier] | An optional filter that indicates the subscription group identifier to include in the transaction history. Your query may specify more than one |
excludeRevoked Optional | boolean | Set |
Response Codes
Mentioned in
Discussion
The Get Transaction History endpoint returns results for all in-app purchase product types: auto-renewable subscriptions, non-renewing subscriptions, non-consumable, and consumable. The result returns transactions in any state, including transactions that are refunded or revoked, and transactions that the app has or hasn’t marked as finished.
You can customize your request by including query parameters that filter the transaction history. The query parameters limit the scope of the request by dates, product IDs, product types, and subscription group identifiers. You can also exclude revoked or nonrevoked transactions, and limit the transactions by in-app ownership type. If you provide multiple filters in the query, the transactions that return match all the filters.
You can also specify a sort order. The App Store sorts the transactions based on their recently modified dates. Use a DESCENDING order to get the most recent transactions first. The App Store updates the recently modified date if the customer upgrades a subscription or the App Store revokes an in-app purchase. If a transaction updates while you’re receiving transaction history and the response is sorted in ASCENDING order, you may receive the transaction again with updated data.
The productId, productType, and subscriptionGroupIdentifier query parameters allow you to specify multiple values. To specify more than one value for a query parameter, include it in the request multiple times. For example, to filter the transaction history by non-consumable and auto-renewable product types, include the following within your request:
GET https://api.storekit.apple.com/inApps/v2/history/{anyTransactionId}?productType=NON_CONSUMABLE&productType=AUTO_RENEWABLEWhen you specify multiple values for a single query parameter, the response contains transactions that match any of the values.
To request a full transaction history in ascending order for your app, start by calling the endpoint without any query parameters, as follows:
GET https://api.storekit.apple.com/inApps/v2/history/{anyTransactionId}} For subsequent requests, include the revision token from the previous HistoryResponse.
GET https://api.storekit.apple.com/inApps/v2/history/{anyTransactionId}?revision={revision}