Skip to content

Commit 03e6120

Browse files
hyochanclaude
andcommitted
docs: add appAccountToken UUID format requirement
- Update unified-apis.md with UUID format requirement and examples - Update purchase-flow.md Key iOS Options section - Update types.md with UUID format note on PurchaseIOS Refs #128 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 168c087 commit 03e6120

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

docs/docs/api/methods/unified-apis.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,15 @@ await requestPurchase({
180180
apple: {
181181
sku: productId,
182182
quantity: 1,
183-
appAccountToken: 'user-account-token',
183+
appAccountToken: '550e8400-e29b-41d4-a716-446655440000', // Must be UUID format
184184
},
185185
},
186186
type: 'in-app',
187187
});
188188
```
189189

190+
> **⚠️ Important:** The `appAccountToken` must be a valid UUID format. Apple's StoreKit silently returns `null` for non-UUID values. Generate a UUID using `crypto.randomUUID()` or a UUID library. See [OpenIAP Request Types](https://openiap.dev/docs/types/request) for details.
191+
190192
#### iOS with Advanced Commerce Data (iOS 15+)
191193

192194
Use `advancedCommerceData` to pass attribution data (campaign tokens, affiliate IDs) during purchase:
@@ -224,7 +226,7 @@ await requestPurchase({
224226
- **Android**: `skus` (string[]) - Array of product IDs to purchase
225227
- **Cross-platform**: Include both `sku` and `skus` for compatibility
226228
- `quantity?` (number, iOS only): Purchase quantity
227-
- `appAccountToken?` (string, iOS only): User identifier for purchase verification
229+
- `appAccountToken?` (string, iOS only): User identifier for purchase verification. **Must be a valid UUID format** (e.g., `550e8400-e29b-41d4-a716-446655440000`). If a non-UUID value is provided, Apple will silently return `null` for this field in the purchase response.
228230
- `advancedCommerceData?` (string, iOS only): Campaign token or attribution data for StoreKit 2's `Product.PurchaseOption.custom` API (iOS 15+)
229231
- `obfuscatedAccountIdAndroid?` (string, Android only): Obfuscated account ID
230232
- `obfuscatedProfileIdAndroid?` (string, Android only): Obfuscated profile ID

docs/docs/api/types.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export interface PurchaseAndroid extends PurchaseCommon {
116116
}
117117

118118
export interface PurchaseIOS extends PurchaseCommon {
119+
// Note: Must be UUID format when set via requestPurchase, or Apple returns null
119120
appAccountToken?: string | null;
120121
environmentIOS?: string | null;
121122
expirationDateIOS?: number | null;

docs/docs/examples/purchase-flow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ Notes:
9393

9494
### Key iOS Options
9595

96-
- `appAccountToken`: set per user to correlate receipts on your backend
96+
- `appAccountToken`: set per user to correlate receipts on your backend. **Must be a valid UUID format** (e.g., `550e8400-e29b-41d4-a716-446655440000`). If a non-UUID value is provided, Apple will silently return `null` for this field in the purchase response.
9797
- `quantity`: purchase quantity for iOS (consumables)
9898

9999
### Purchase Object Properties

0 commit comments

Comments
 (0)