Receipt Fields

Receipts are made up of a number of fields. Some fields are only available locally, in the ASN.1 form of the receipt, or only when validating with the App Store, in the JSON form of the receipt. Keys not documented below are reserved for use by Apple and must be ignored by your app.

App Receipt Fields

Bundle Identifier

The app’s bundle identifier.

ASN.1 Field Type 2

ASN.1 Field Value UTF8STRING

JSON Field Name bundle_id

JSON Field Value string

This corresponds to the value of CFBundleIdentifier in the Info.plist file.

App Version

The app’s version number.

ASN.1 Field Type 3

ASN.1 Field Value UTF8STRING

JSON Field Name application_version

JSON Field Value string

This corresponds to the value of CFBundleVersion (in iOS) or CFBundleShortVersionString (in OS X) in the Info.plist.

Opaque Value

An opaque value used, with other data, to compute the SHA-1 hash during validation.

ASN.1 Field Type 4

ASN.1 Field Value A series of bytes

JSON Field Name (none)

JSON Field Value (none)

SHA-1 Hash

A SHA-1 hash, used to validate the receipt.

ASN.1 Field Type 5

ASN.1 Field Value 20-byte SHA-1 digest

JSON Field Name (none)

JSON Field Value (none)

In-App Purchase Receipt

The receipt for an in-app purchase.

ASN.1 Field Type 17

ASN.1 Field Value SET of in-app purchase receipt attributes

JSON Field Name in_app

JSON Field Value array of in-app purchase receipts

In the JSON file, the value of this key is an array containing all in-app purchase receipts. In the ASN.1 file, there are multiple fields that all have type 17, each of which contains a single in-app purchase receipt.

Original Application Version

The version of the app that was originally purchased.

ASN.1 Field Type 19

ASN.1 Field Value UTF8STRING

JSON Field Name original_application_version

JSON Field Value string

This corresponds to the value of CFBundleVersion (in iOS) or CFBundleShortVersionString (in OS X) in the Info.plist file when the purchase was originally made.

In the sandbox environment, the value of this field is always “1.0”.

Receipts prior to June 20, 2013 omit this field. It is populated on all new receipts, regardless of OS version. If you need the field but it is missing, manually refresh the receipt using the SKReceiptRefreshRequest class.

Receipt Expiration Date

The date that the app receipt expires.

ASN.1 Field Type 21

ASN.1 Field Value IA5STRING, interpreted as an RFC 3339 date

JSON Field Name expiration_date

JSON Field Value IA5STRING, interpreted as an RFC 3339 date

This key is present only for apps purchased through the Volume Purchase Program. If this key is not present, the receipt does not expire.

When validating a receipt, compare this date to the current date to determine whether the receipt is expired. Do not try to use this date to calculate any other information, such as the time remaining before expiration.

In-App Purchase Receipt Fields

Quantity

The number of items purchased.

ASN.1 Field Type 1701

ASN.1 Field Value INTEGER

JSON Field Name quantity

JSON Field Value string, interpreted as an integer

This value corresponds to the quantity property of the SKPayment object stored in the transaction’s payment property.

Product Identifier

The product identifier of the item that was purchased.

ASN.1 Field Type 1702

ASN.1 Field Value UTF8STRING

JSON Field Name product_id

JSON Field Value string

This value corresponds to the productIdentifier property of the SKPayment object stored in the transaction’s payment property.

Transaction Identifier

The transaction identifier of the item that was purchased.

ASN.1 Field Type 1703

ASN.1 Field Value UTF8STRING

JSON Field Name transaction_id

JSON Field Value string

This value corresponds to the transaction’s transactionIdentifier property.

Original Transaction Identifier

For a transaction that restores a previous transaction, the transaction identifier of the original transaction. Otherwise, identical to the transaction identifier.

ASN.1 Field Type 1705

ASN.1 Field Value UTF8STRING

JSON Field Name original_transaction_id

JSON Field Value string

This value corresponds to the original transaction’s transactionIdentifier property.

All receipts in a chain of renewals for an auto-renewable subscription have the same value for this field.

Purchase Date

The date and time that the item was purchased.

ASN.1 Field Type 1704

ASN.1 Field Value IA5STRING, interpreted as an RFC 3339 date

JSON Field Name purchase_date

JSON Field Value string, interpreted as an RFC 3339 date

This value corresponds to the transaction’s transactionDate property.

For a transaction that restores a previous transaction, the purchase date is the date of the restoration. Use “Original Purchase Date” to get the date of the original transaction.

In an auto-renewable subscription receipt, this is always the date when the subscription was purchased or renewed, regardless of whether the transaction has been restored.

Original Purchase Date

For a transaction that restores a previous transaction, the date of the original transaction.

ASN.1 Field Type 1706

ASN.1 Field Value IA5STRING, interpreted as an RFC 3339 date

JSON Field Name original_purchase_date

JSON Field Value string, interpreted as an RFC 3339 date

This value corresponds to the original transaction’s transactionDate property.

In an auto-renewable subscription receipt, this indicates the beginning of the subscription period, even if the subscription has been renewed.

Subscription Expiration Date

The expiration date for the subscription, expressed as the number of milliseconds since January 1, 1970, 00:00:00 GMT.

ASN.1 Field Type 1708

ASN.1 Field Value IA5STRING, interpreted as an RFC 3339 date

JSON Field Name expires_date

JSON Field Value number

This key is only present for auto-renewable subscription receipts.

Cancellation Date

For a transaction that was canceled by Apple customer support, the time and date of the cancellation.

ASN.1 Field Type 1712

ASN.1 Field Value IA5STRING, interpreted as an RFC 3339 date

JSON Field Name cancellation_date

JSON Field Value string, interpreted as an RFC 3339 date

Treat a canceled receipt the same as if no purchase had ever been made.

App Item ID

A string that the App Store uses to uniquely identify the application that created the transaction.

ASN.1 Field Type (none)

ASN.1 Field Value (none)

JSON Field Name app_item_id

JSON Field Value string

If your server supports multiple applications, you can use this value to differentiate between them.

Apps are assigned an identifier only in the production environment, so this key is not present for receipts created in the test environment.

This field is not present for Mac apps.

See also “Bundle Identifier.”

External Version Identifier

An arbitrary number that uniquely identifies a revision of your application.

ASN.1 Field Type (none)

ASN.1 Field Value (none)

JSON Field Name version_external_identifier

JSON Field Value string

This key is not present for receipts created in the test environment.

Web Order Line Item ID

The primary key for identifying subscription purchases.

ASN.1 Field Type 1711

ASN.1 Field Value INTEGER

JSON Field Name web_order_line_item_id

JSON Field Value string