storekit-python is a Python package for accessing and validating App Store in-app purchases.
Install via pip:
pip install storekit-python
Get SignedTokenEncoder parameters reference: Generating tokens for API requests
from storekit.app_store_server_api import BaseUrl, SignedTokenEncoder, ServerAPIClient
client = ServerAPIClient(
base_url=BaseUrl.Production,
signed_token_encoder=SignedTokenEncoder(
key_id="key_id",
private_key="private_key",
issuer_id="issuer_id",
bundle_id="bundle_id",
)
)
response = client.get_all_subscription_statuses("original_transaction_id")
print(response)
Enabling App Store Server Notifications
from storekit.app_store_server_notifications import ResponseBodyV2
response = ResponseBodyV2.parse_obj(request_data)
print(response)
How to generate a password reference: Generating a Shared Secret
from storekit.app_store_receipts import ReceiptsClient, BaseUrl
client = ReceiptsClient(
base_url=BaseUrl.Production,
password="password",
sandbox_client=ReceiptsClient(
base_url=BaseUrl.Sandbox,
password="password",
)
)
response = client.verify_receipt("receipt_data")
print(response)
We welcome contributions of all forms! You can participate in this project by reporting issues, submitting PRs, or improving documentation.
storekit-python is open-source under the MIT License.