Get Transaction History V1
Get a customer’s in-app purchase transaction history for your app, except finished consumable in-app purchases.
URL
GET https://api.storekit.apple.com/inApps/v1/history/{anyTransactionId}Sandbox URL
GET https://api.storekit-sandbox.apple.com/inApps/v1/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 |
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 |
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 |
inAppOwnershipType Optional | inAppOwnershipType | An optional filter that limits the transaction history by the in-app ownership type. |
revoked Optional | boolean | An optional Boolean value that indicates whether the response includes only revoked transactions when the value is |
excludeRevoked Optional | boolean | Set |
Response Codes
Mentioned in
Discussion
The Get Transaction History V1 endpoint returns results for the following product types:
Auto-renewable subscriptions
Non-renewing subscriptions
Non-consumable in-app purchases
Consumable in-app purchases if the transaction is refunded or revoked, or if the app hasn’t finished processing the transaction. The results don’t include consumable in-app purchases that the app marks as finished. For more information about finishing transactions, see finish() and finishTransaction(_:).
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/v1/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/v1/history/{anyTransactionId}For subsequent requests, include the revision token from the previous HistoryResponse.
GET https://api.storekit.apple.com/inApps/v1/history/{anyTransactionId}?revision={revision}