Palbase IAP · API
/iap/googleConnect Google Play purchases
Sells in one of the environment's Android apps on Google Play: the app's topic is made in Palbase's Cloud project (Play's own account may publish to it; every environment of the project selling in the app shares it) and this environment's push subscription of it, to its own address, signed. The project's Play connection must exist (the stores module's: palbase stores:google:connect). Connected again for the same app, nothing changes. Then, in Play Console: Monetize with Play › Monetization setup, the topic, Send test notification. Emits iap.store.changed (connected).
Called by your server, with the project's secret key.
Headers
Idempotency-Keystring · optionalMakes the write safe to send again (at most 255 characters). A retry with the same key and the same request gets the first answer back, marked `Idempotent-Replayed: true`, and changes nothing; the same key with a different request is refused with 422, and while the first request still runs a retry gets 409 with Retry-After. Answers are kept for 24 hours.Request body
app_idstring (uuid) · requiredOne of the environment's Android apps (the registry's id).curl -X POST "https://<your-ref>.palbase.studio/iap/google" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"app_id":"00000000-0000-0000-0000-000000000000"}'Responses
200Connected already, for this app
201Connected
400The request is malformed, or a field breaks a rule (the error names which)
401No key, not a key of this project, or a token that is not valid (the edge's answer)
403Not the project's secret key (`secret_key_required`)
409The project has no Play connection (`play_not_connected`), Google Play purchases are connected for another app (`google_connected`), or a request with this Idempotency-Key is still running (`idempotency_key_in_use`, Retry-After)
413The request body is too large (`request_too_large`)
422`app_id` is none of the environment's Android apps (`app_not_registered`), or the Idempotency-Key was sent with a different request (`idempotency_key_reused`)
429Over the project's share of calls to Google (`google_rate_limited`): Palbase's Cloud project holds every project's Play quota, and each project's calls are its own share; Retry-After says when to try again. Or over the project's request limit
502Google refused the topic or the subscription (`google_refused`, in its words)
503Google could not be reached, or did not answer (`google_unreachable`, Retry-After), or this Palbase has no Google Cloud project (`google_unavailable`)
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation ConnectGoogle of iap's contract.