---
title: "apple: verify signed payload · RUAL Documentation"
description: "Verifies an Apple-signed JWS : an App Store Server Notification's signedPayload, or the signedTransactionInfo / signedRenewalInfo nested inside one : an…"
canonical: https://docs.rual.nl/block-types/payments/function_appstore_verify_signed_payload
language: en
---

# apple: verify signed payload

This block is part of the [`payments`](https://docs.rual.nl/block-types/payments) group and was last modified in core [`v15.0.0`](https://docs.rual.nl/core-versions/150000).

Verifies an Apple-signed JWS : an App Store Server Notification's `signedPayload`, or the `signedTransactionInfo` / `signedRenewalInfo` nested inside one : and returns its claims. The signature is the only thing separating a real purchase from someone posting themselves a subscription, so nothing downstream should trust a payload this block did not pass.

- flow `flow`

- signed payload required `value` The JWS to verify: a notification's `signedPayload`, or a nested `signedTransactionInfo` / `signedRenewalInfo`.

- root certificate required `value` Apple's root CA in PEM, the trust anchor for the chain. Download **AppleRootCA-G3** from https://www.apple.com/certificateauthority/ and keep it in a system setting. **Without it this block refuses** : it is not baked in so a rotated root needs a setting change, not a release.

- bundle id `value` Your app's bundle id. Strongly recommended: a valid signature only proves *Apple* signed it, not that it was about your app : without this, another developer's notification verifies perfectly.

- flow `flow`

- success `condition` True only when the chain verified to the supplied root, the signature checked out, and the bundle id matched.

- error `value` MISSING_SIGNED_PAYLOAD, MISSING_ROOT_CERTIFICATE, MALFORMED_JWS, INVALID_CERTIFICATE_CHAIN, UNSUPPORTED_ALGORITHM, CERTIFICATE_CHAIN_NOT_TRUSTED, UNSUPPORTED_LEAF_KEY, SIGNATURE_INVALID or BUNDLE_ID_MISMATCH.

- payload `object` The verified claims.

- notification type `value` SUBSCRIBED, DID_RENEW, EXPIRED, REFUND, … (notifications only).

- subtype `value` INITIAL_BUY, RESUBSCRIBE, VOLUNTARY, BILLING_RETRY, … (notifications only).

- bundle id `value`

- environment `value` Production or Sandbox. Worth branching on : a sandbox purchase must never grant a real entitlement.

- signed transaction info `value` Still signed, and deliberately not decoded here: run it back through this block. Handing back an unverified inner payload is the mistake this block exists to prevent.

- signed renewal info `value` As above : verify it separately.

- original transaction id `value` The stable id for a subscription across every renewal : the one to store against a user.

- product id `value`

- transaction id `value`

- expires date `number` Expiry in unix milliseconds, 0 when absent.

- revocation date `number` Set when Apple refunded or revoked the purchase : non-zero means revoke the entitlement.

| `apple` |
| --- |
| `app store` |
| `iap` |
| `in app purchase` |
| `subscription` |
| `notification` |
| `verify` |
| `jws` |
| `storekit` |
| `receipt` |

### Version history

Introduced in [`v15.0.0`](https://docs.rual.nl/core-versions/150000).

### Service documentation
