Uninstall (Uninstall Hook)
When a merchant uninstalls your app from the App Store, the App Store sends a notification to your Uninstall Hook URL. You are expected to delete the store's records when you receive it.
- 1.Merchant→App Store
Uninstalls the app
- 2.App Store→Your uninstall hook
Sends the uninstall notification
POSTwithusername,hashanddomainin the JSON body. - 3.Your uninstall hook
Verifies the hash and deletes the store's data
- 4.Your uninstall hook→App Store
Returns HTTP 200
For any other response the notification is retried a limited number of times.
Request
Code
| Field | Description |
|---|---|
username | MD5 digest of the store address: md5("https://your-store.myideasoft.com"). |
hash | HMAC-SHA256 signature (hex) of the text {"username":"<username>"}, keyed with your Client Secret. |
domain | The address of the store that uninstalled the app, including the scheme. |
Verification
- Recompute
hashfrom theusernamein the body and compare in constant time. The signed text is PHPjson_encodeoutput:{"username":"b277c22af6e6dad43c3ac70c65a85ddd"}. - Check that
usernameequalsmd5(domain). - If verification succeeds, delete the store's tokens and records, then return HTTP 200.
Test vector: for client_secret=example-client-secret and domain=https://your-store.myideasoft.com, username is b277c22af6e6dad43c3ac70c65a85ddd and hash is e86628c8bc958d88d62af73974554f0de3f30674012c85f2cf8cd905214a5631. The request above uses these values; you can try your endpoint with curl:
Code
Response and retries
- Only HTTP 200 counts as success. Any other response, including
201and204, and connection errors count as failures. - A failed notification is retried a limited number of times through a queue; the delay between attempts is not guaranteed.
- The same store may be notified more than once. Make your handler idempotent: return 200 even if the records are already deleted.
- Respond quickly; run long deletions in the background.
Earlier format
Earlier versions sent username and hash in the Uninstall Hook URL's path or query string. In the current format all fields are in the JSON request body, and the domain field was added.
If the store installs the app again, the installation flow runs from the start.