CONCEPTS

Purchases and revenue.

How a store receipt becomes a verified transaction, and how RevFox turns transactions into the numbers on your charts.

01

App Store verification

The SDK sends StoreKit 2's signed transaction (VerificationResult<Transaction>.jwsRepresentation). RevFox:

  1. checks the certificate chain in the JWS header leads to one of Apple's root certificates, which ship inside RevFox. Other roots, including the system's, are not trusted;
  2. checks the leaf and intermediate certificates carry Apple's App Store markers, and verifies the ES256 signature;
  3. checks the signed bundle ID matches the app;
  4. with the app's In-App Purchase key, fetches the subscription's full history from the App Store Server API and records any payments it was missing.

A bare transaction ID is never accepted. Anyone can read one, so it proves nothing about who holds the purchase.

02

Google Play verification

The SDK sends the purchase token. RevFox looks it up with the Android Publisher API using the app's service account, then reads the order for price and tax.

  • Subscriptions are looked up by token alone. Each base plan is its own store item, productId:basePlanId.
  • One-time products need the product ID too, which the SDK sends. They never expire. A pending purchase is refused until it is paid.
  • Acknowledgement. Google refunds a purchase that is not acknowledged within three days. The SDK acknowledges, or consumes, only after RevFox has recorded the purchase.

A Play purchase token is a long random value from Google Play, so holding one proves the app received the purchase.

03

Environments

Every transaction is PRODUCTION or SANDBOX. One customer can have both.

  • App Store: from the signed transaction. Xcode and TestFlight purchases are sandbox.
  • Google Play: purchases Google marks as test purchases, made by license testers, are sandbox.
  • The SDK reads the environment of the build it runs in: on iOS from how the app was signed, on Android sandbox for debuggable builds unless configured otherwise.
  • Charts hide sandbox data unless you turn on the sandbox toggle.
04

Transaction types

TypeMeaning
NEW_SUBThe first paid period of a subscription.
TRIALA subscription that starts with a free trial.
RENEWALA later paid period. renewal_number counts periods: the first purchase is 1.
PRODUCT_CHANGEAn upgrade, downgrade or crossgrade.
PURCHASEA one-time product.
CANCELLATION, UNCANCELLATIONAuto-renew turned off or back on.
BILLING_ISSUEA renewal failed. The subscription may be in a grace period.
EXPIRATIONAccess ended.
REFUND, REFUND_REVERSEDA payment was refunded, or a refund was undone.

Webhooks use RevenueCat's names for these. See webhook event types.

05

Refunds and revocations

A refund is recorded as a REFUND with the negated revenue, dated when the refund happened, so revenue charts subtract it in that period. Each payment is refunded at most once, whichever source reports it first.

SourceRefund date
App Store REFUND notification, live or from notification historyrevocationDate
App Store transaction history, read during a purchase or importrevocationDate
Play voided purchase notificationWhen the notification arrived
Play Voided Purchases API, read every 30 minutesvoidedTimeMillis
Play order found refunded during verificationThe order's last event
  • A refund ends the access that payment granted. Refunding a past renewal leaves the current period active.
  • Google can refund a Play subscription payment without ending the subscription, so Play subscription refunds only reverse revenue. Access ends when Google revokes the subscription.
  • A revocation ends access for the whole subscription from that moment.
  • REFUND_REVERSED restores the access and the revenue.
06

Revenue, tax and commission

Revenue is the gross price the customer paid, tax included, in their currency and converted to USD at that day's exchange rate. Each transaction also stores two shares of that price:

ShareApp StoreGoogle Play
TaxEstimated from the storefront country's VAT or GST on digital sales, for example 20% in Turkey. US prices exclude sales tax, so 0%. Canada uses the federal 5% GST.The tax Google reports on the order.
Commission30%, or 15% inside the app's Small Business Program dates.From the order.

Proceeds are price × (1 − commission − tax). For 149.99 TRY with 20% VAT on Google Play, tax is 25.00 TRY, commission 18.75 TRY and proceeds 106.24 TRY.

Ready to build?

Add the SDK to your app.

iOS SDK