All articles

App Store attribution

How to attribute App Store subscription renewals to an affiliate

Map the first paid transaction, every renewal, refunds, and cancellations to a single commission state using an appAccountToken and App Store Server Notifications v2.

Published · Last reviewed

Written by Attribloom Engineering · Reviewed by Attribloom Product · Last reviewed

One token, a whole subscription lifecycle

A subscription is not one event. It is a first purchase, then a series of renewals, sometimes a refund, sometimes a cancellation. To pay an affiliate fairly you have to tie all of those events back to the same referral and keep a running commission state, not just credit the first charge.

The key that makes this possible is the StoreKit 2 appAccountToken. It is a UUID your app sets on the purchase, and Apple echoes it back in the signed transaction and in every App Store Server Notification about that subscription. Because the same token rides every renewal notification, each renewal resolves to the same affiliate without any new client action.

The event to commission map

App Store Server Notifications v2 arrive as signed JWS messages with a notificationType. Attribloom verifies each one against Apple's certificate chain, reads the appAccountToken, finds the affiliate, and moves the commission state accordingly.

  • First paid transaction: confirm the conversion and accrue commission on the real transaction value, excluding trials.
  • Renewal: accrue again against the same affiliate, because the token is carried on the renewal notification.
  • Refund: reverse the commission for that transaction through a clawback.
  • Cancellation: stop future accrual. A cancellation is not a refund, so it does not reverse commission already earned on paid periods.

Why renewals need a hold, not just a credit

A renewal can still be refunded after it is charged. Attribloom matures each commission for 30 days before it becomes payable, so a refund that lands inside that window reverses cleanly before any money settles. If a refund arrives after payout, the amount is recorded against the affiliate's future balance.

All of this posts to a double-entry ledger in integer minor units, so a duplicate notification cannot double-pay and a reversal is always a balanced entry. Apple re-delivers notifications and Attribloom deduplicates by notification identifier, which is what makes the renewal stream safe to replay.

Sources and verification

Primary documentation last checked on 2026-07-20. Each source below links the exact page and its own last-checked date.

Next steps

Frequently asked

Does each renewal need the app to set the token again?

No. You set the appAccountToken once on the original purchase. Apple carries it on every renewal notification, so renewals attribute to the same affiliate with no further client action.

Is a cancellation treated like a refund?

No. A cancellation stops future renewals and future accrual, but it does not reverse commission already earned on periods the customer paid for. Only a refund triggers a clawback of a specific transaction.

What if a renewal is refunded after the affiliate was paid?

The commission is clawed back against the affiliate's future balance, and written down as a loss only if it cannot be recovered. The 30-day hold is designed to catch most refunds before payout.

In the glossary

Continue reading

App Store attribution

How to attribute App Store subscriptions to an affiliate

App Store attribution

Why iOS affiliate installs are invisible to web attribution tools

Shopify attribution

How to attribute Shopify sales to affiliates without third-party cookies

Pricing models

Commission-only vs revenue-share affiliate programs

App Store attribution

How to validate App Store attribution before release

Payouts

How commission holds and clawbacks protect an affiliate program

iOS program launch

How to start an affiliate program for an iOS app

Shopify program launch

How to launch a Shopify affiliate program

Program economics

Affiliate commission rates: 2026 benchmarks by industry and how to set yours

Program policy

Affiliate program agreement template (2026): full contract and clause guide

Creator strategy

AI UGC vs human creators for affiliate marketing

Custom attribution

How signed conversion postbacks and refunds work

App Store attribution

RevenueCat affiliate attribution for iOS subscriptions: a server-side pattern

App Store attribution

Affiliate-aware paywalls on iOS: pass referral context without fingerprinting

App Store attribution

iOS affiliate tracking without an SDK: StoreKit 2, appAccountToken, and server notifications

App Store attribution

SKAdNetwork vs affiliate attribution for iOS subscriptions

Shopify attribution

How to run a Shopify affiliate program without editing your theme

Shopify attribution

Shopify affiliate link tracking with cart attributes: a theme.liquid recipe

Compliance

FTC affiliate disclosure: the complete 2026 guide (rules, examples, placement)

Attribution concepts

What is deferred deep linking? A plain-English guide for attribution
Get startedSee pricingMore articles