Skip to content

Auto renewable subscriptions

Pablo Rivera edited this page Jun 23, 2016 · 1 revision

When working with auto-renewable subscriptions you will need to access the new receipt provided by iTunes. Here is more information about the issue. I've included the important information below:

My experience. Let's assume, we always send initial receipt to Apple's server.

In any case, you'll get JSON with at least two fields: status (no comments) and receipt (information about >receipt that you've send).

Additionally to that:

  1. If the subscription is still active, you'll additionally get latest_receipt (base64-encoded string) and latest_receipt_info (information about that receipt).

  2. If the subscription is already expired, you'll additionally get latest_expired_receipt_info (information >about last renewing receipt). Yes, you get only information about it, no base64-encoded string.

This library allows you to access the field latest_receipt_info as a property. However, it returns a Receipt object for the value of the field.. If you want the raw base64 receipt you would access it using the _ property. Example:

        with itunesiap.env.review:
            request = itunesiap.Request(receipt, password)
            response = request.verify()
            
        # <Receipt> object.
        latest_receipt = response.latest_receipt

        # Raw base64 receipt
        latest_receipt = response.latest_receipt._

Apple's documentation is lacking. I hope this makes saves you some time and effort. :)