Canonical history import, version 1
Use UTF-8 CSV (header row, RFC-style quoted fields) or JSONL (one object per line), one row per store subscription. Use the fields and types below; extra fields are rejected.
Required: store is app_store with original_transaction_id, or play_store with purchase_token. Optional app_user_id (1–128 characters) supplies the owner mapping. Optional product_id supplies the historical product. IDs remain strings. ID-only rows are valid. No secrets belong in the file.
{"store":"app_store","original_transaction_id":"synthetic-original","app_user_id":"synthetic-user"}
{"store":"play_store","purchase_token":"synthetic-token","product_id":"synthetic.monthly","transactions":[{"order_id":"synthetic-order","purchased_at":"2026-09-01T12:00:00Z","price":"9.990000","currency":"USD","country":"US","plan_id":"monthly","period":"P1M"}]}
Optional transactions are Google history only. Every charge requires transaction_id or order_id, ISO timestamp with UTC offset, decimal string price (nonnegative, at most 6 fractional digits), and ISO currency. Optional fields are product_id, two-letter country, plan_id and ISO duration period (P1M, P1Y, P3M, P1W, etc.). In CSV the transactions cell is a quoted JSON array. Numeric JSON money is rejected rather than rounded. Apple prices in the file are ignored; Apple history and state always come from its signed store responses.
For Google, the current state is store-verified. Historical file charges are explicitly event_source=import and synthetic_source=<source>. Order ID is the deduplication identity when supplied. Existing verified charges win; a later verified charge replaces provider money and clears its synthetic marker. Matching re-imports can enrich a missing synthetic period without changing charge identity or money. Verified store data also replaces synthetic type, environment and subscription linkage. No amount is inferred from a catalog. Provider historical charges must supply their own product; an available order can supply it. Never substitute the current product for unknown history.
The charge's explicit period wins. Otherwise an explicit plan uses only that product/plan's catalog entry. If neither is supplied, orders.get labels the order's own base plan and phase; each order is read once per row attempt. A regular charge follows its own plan; an intro follows its own offer phase; trial period stays null. Missing/unavailable orders leave nulls. No single-plan or latest-plan fallback exists. Calendar service intervals for synthetic charges are estimated from the file purchase date and its own period, labelled provider_period; they never accrue Apple paid service. Actual later store bounds replace these estimates. Unknown periods remain visible in normalization evidence.
Upload and retry
Open Migrate history, select the canonical file path and upload CSV or JSONL, optionally gzip-compressed. Hosted uploads allow 20 MiB per compressed and decompressed file and 30 MiB per request. Split larger exports on subscription boundaries. The reject report gives record numbers and reasons without raw purchase identifiers.
Retry store verification resumes the already staged history run; uploading again creates a new attempt. Each row is verified and committed before its checkpoint; a crash can repeat that idempotent row. After verification, proceeds, historical rollups and LTV are recomputed in order. A finished upload does not mean all later verification stages have succeeded. A row gets at most three automatic verification attempts; persistent failures and Apple verification warnings are quarantined without blocking later rows. Correct the cause before explicitly retrying quarantined rows. A quarantined run cannot pass cutover.
Source money is never used to overwrite an existing verified charge or current subscription state. Historical imports can emit first-observation accounting events; receivers must use current verified entitlements for access rather than treating every imported purchase as new access.