Skip to main content

Apple iTunes In-app purchase verification api.

Project description

itunes-iap v2

Python 2 & 3 compatible! Even with :mod:`asyncio` support!

.. image::
.. image::

- Source code: `<>`_
- Documentation: `<>`_
- Distribution: `<>`_


Create request to create a request to itunes verifying api.

.. sourcecode:: python

>>> import itunesiap
>>> try:
>>> response = itunesiap.verify(raw_data) # base64-encoded data
>>> except itunesiap.exc.InvalidReceipt as e:
>>> print('invalid receipt')
>>> print response.receipt.last_in_app.product_id # other values are also available as property!

The common attributes are:
`product_id`, `original_transaction_id` and `quantity`.

See the full document in:
- :func:`itunesiap.verify`: The verifying function.
- :class:`itunesiap.receipt.Receipt`: The receipt object.


.. sourcecode:: python

>>> import itunesiap
>>> response = await itunesiap.aioverify(raw_data) # verify -> aioverify

The other parts are the same.

See the full document in:
- :func:`itunesiap.aioverify`: The verifying function.


PyPI is the recommended way.

.. sourcecode:: shell

$ pip install itunes-iap

To browse versions and tarballs, visit:

Apple in-review mode

In review mode, your actual users who use older versions want to verify in
production server but the reviewers in Apple office want to verify in sandbox

Note: The default env is `production` mode which doesn't allow any sandbox

You can change the verifying mode by specifying `env`.

.. sourcecode:: python

>>> # review mode
>>> itunesiap.verify(raw_data,

Note for v1 users

There was breaking changes between v1 and v2 APIs.

- Specify version `0.6.6` for latest v1 API when you don't need new APIs.
- Or use `import itunesiap.legacy as itunesiap` instead of `import itunesiap`. (`from itunesiap import xxx` to `from itunesiap.legacy import xxx`)



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

itunes-iap-2.6.0.tar.gz (13.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page