StoreKit

Sync StoreKit Transaction

Changed on

Forwards a StoreKit 2 JWS (JSON Web Signature) transaction to ZeroSettle for verification and recording. The backend verifies the JWS against Apple's root certificate chain, creates a Transaction and Entitlement, and returns success. The SDK should call transaction.finish() only after receiving a success response.

SDK 1.3+ additionally forwards will_auto_renew (pulled from Product.SubscriptionInfo.RenewalInfo.willAutoRenew) on every sync. The backend diffs this against the stored entitlement state and emits CANCELLED / REACTIVATED events when the flag flips, so auto-renew state stays accurate even in deployments without App Store Server Notifications (ASSN) v2 configured.

post/iap/storekit-transactions

Request

  • Base URL
    https://api.zerosettle.io/v1
  • URL
    https://api.zerosettle.io/v1/iap/storekit-transactions
  • Auth
    API key in header X-ZeroSettle-Key

Request body

jws_representationstring required

The StoreKit 2 transaction's JWS representation string.

user_idstring required

The user's external ID.

will_auto_renewboolean

Optional (SDK 1.3+). The current willAutoRenew value from StoreKit's Product.SubscriptionInfo.RenewalInfo for the subscription this JWS belongs to. When provided, the backend compares it against the stored entitlement and emits CANCELLED (true→false) or REACTIVATED (false→true) events. Omit the field for non-subscription syncs or older SDKs; behaviour is unchanged when missing.

renewal_state'subscribed' | 'expired' | 'in_billing_retry_period' | 'in_grace_period' | 'revoked'

Optional (SDK 1.3+, reserved). Mirror of StoreKit's Product.SubscriptionInfo.RenewalState for future use. Accepted but not currently acted on. Typical values: subscribed, expired, in_billing_retry_period, in_grace_period, revoked.

Response

Transaction synced successfully

statusstring
is_test_purchaseboolean

true when Apple processed the transaction as a sandbox purchase (TestFlight, App Review or Xcode) but the request used a live key. The purchase is saved in Live as a test purchase and is left out of revenue.

Example response

{
  "status": "ok"
}

Changes