---
title: "Sync StoreKit Transaction"
method: POST
path: "/iap/storekit-transactions"
tags: ["StoreKit"]
---

# Sync StoreKit Transaction

`POST /iap/storekit-transactions`

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.

## Request body

- object
  - `jws_representation` string, required — The StoreKit 2 transaction's JWS representation string.
  - `user_id` string, required — The user's external ID.
  - `will_auto_renew` boolean — 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 `200`

Transaction synced successfully

- object
  - `status` string

## Other responses

- `400` — Invalid request -- missing or malformed parameters.
- `401` — Invalid or missing API key.

---

[API](https://skmtc.net/zerosettle/apis/zerosettle-iap-api.md) · [All operations](https://skmtc.net/zerosettle/apis/zerosettle-iap-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zerosettle/zerosettle-iap-api/versions/1a7aa12f3d5e/schema)
