app-store-server-library-java
A Java library that helps backend servers verify Apple App Store purchases and subscriptions, call Apple's APIs, and create signed promotional discount offers. It handles the cryptographic verification needed to trust in-app purchase data.
The Apple App Store Server Java Library helps developers who sell digital goods or subscriptions through iOS apps handle the server-side work that comes after a purchase. When a customer buys a subscription, gets a promotional discount, or requests a refund, Apple sends cryptographically signed data that your server needs to verify and process. This library gives Java developers the tools to interact with Apple's App Store Server API, decode and verify those signed payloads, and manage transaction history.
At a high level, the library handles four main tasks. It provides a client to call Apple's App Store Server API directly from Java code, for things like requesting test notifications. It includes a verifier that checks Apple's cryptographic signatures on notifications and transactions, so you can trust the data is genuinely from Apple and hasn't been tampered with. It offers a receipt utility that extracts transaction IDs from old-style app receipts, letting you look up a customer's full purchase history. And it can create signatures for promotional offers, which are needed when you want to give a subscriber a special discount.
The primary audience is backend Java developers at companies with iOS apps that use in-app purchases, especially auto-renewable subscriptions. For example, if you run a streaming service and a customer contacts support saying they cancelled but were still charged, your support tool could use this library to pull that customer's transaction history from Apple and verify the subscription status. Or if your marketing team wants to offer a lapsed subscriber 50% off for three months, the signature creation feature lets your server generate the signed offer the app needs to present that discount.
One important note is that the library is currently in Beta, meaning Apple recommends it only for testing purposes, like in their Sandbox environment, and the API may change between releases. The README also notes that only the latest major version receives updates, including security patches, so teams adopting it should plan to stay current. It requires Java 11 or newer.
Where it fits
- Verify that a customer's in-app purchase or subscription data is genuinely from Apple and hasn't been tampered with.
- Look up a customer's full transaction history when they contact support about a billing issue.
- Generate signed promotional offers so your marketing team can give lapsed subscribers a special discount.
- Request and process test notifications from Apple's Sandbox environment during development.