Synchronize a purchase
Verify a store purchase and attach its Feature access to a customer.
https://i.nuxie.ai/purchaseAttach a verified App Store or Google Play purchase to a customer and return the resulting Feature access. type selects the store; distinct_id identifies the customer for either store.
The iOS SDK’s default StoreKit integration sends verified transactions, retries synchronization, and finishes transactions for you. For another billing provider, see purchase ownership.
Request body
apiKeybodystringrequiredPublishable key for the app platform. A pk_test_ key selects test data; a pk_live_ key selects live data. Copy it from Connect your app.
typebodystringrequiredappstore or playstore.
distinct_idbodystringrequiredThe identified or anonymous customer ID your app supplies to the SDK, rather than Nuxie’s internal customer record ID. See Customer identifiers.
transaction_jwtbodystringRequired for appstore: the signed transaction returned by StoreKit 2.
purchase_tokenbodystringRequired for playstore: the token returned by Google Play Billing.
product_idbodystringGoogle Play Product identifier, when relevant.
base_plan_idbodystringGoogle Play subscription base plan, when relevant.
purchase_option_idbodystringGoogle Play one-time purchase option, when relevant.
offer_idbodystringSelected Google Play store offer, when relevant.
product_typebodystringGoogle Play subscription or one_time.
Use the publishable key for the matching iOS or Android platform. The configured Google Play connection supplies the package context. Nuxie verifies the purchase with the store before attaching access to the customer.
Response
successbooleanrequiredtrue when the purchase is attached.
customer_idstringrequiredNuxie’s resolved customer record ID.
featuresobject[]requiredResulting Feature access.
idempotent_replaybooleanrequiredWhether this purchase was already processed.
transaction_idstringApp Store transaction identifier, returned for appstore.
purchase_tokenstringGoogle Play purchase token, returned for playstore.
order_idstringGoogle Play order identifier, returned for playstore.
catalog_productobjectGoogle Play mapping to the matched Product, base plan, purchase option, offer, and store product type.
Repeat the same evidence when retrying. Nuxie recognizes the existing transaction or token instead of granting it twice.
Purchase errors
Error codes use the prefix app_store_purchase_ or google_play_purchase_:
| Suffix | Status | Action |
|---|---|---|
invalid |
400 |
Check the evidence, Product identifiers, App, and environment |
owner_unverified |
400 |
Check the customer identity used for checkout and synchronization |
unsupported |
400 |
Inspect detail for why the purchase cannot be attached |
conflict |
409 |
Resolve the ownership or conflicting replay before resubmitting |
reconciliation_retryable |
503 |
Retry with the same evidence after a delay |
unavailable |
503, or 429 for Google Play |
Retry with backoff |