Skip to content

Search the documentation by title, section, or page text.

Real-Time Developer Notifications (RTDN)

Real-Time Developer Notifications (RTDN) are how Google Play tells Botsi about events that happen outside your app: renewals, cancellations, refunds, billing problems. They're the Google Play counterpart to App Store Server Notifications. Google Play publishes each notification to a Cloud Pub/Sub topic, and a push subscription on that topic delivers it to Botsi.

Before setting this up, connect Botsi to Google Play (Connect to Google Play), give the service account its Play Console permissions (Grant Permissions), and enable the Cloud Pub/Sub API (Enable Developer APIs).

Your RTDN URL is in the Botsi dashboard under App Settings → Google Play Store → Google Play RTDN topic name, as URL for Google server notifications. It has this form:

https://api.botsi.com/v2/notifications/google/<notification-key>

The dashboard shows the same URL on app.botsi.com, which works the same way. See Notification URLs.

Pointing the push subscription at Botsi#

  1. In the Google Cloud console, go to Pub/Sub → Subscriptions.
  2. Open the push subscription on your RTDN topic and choose Edit.
  3. Set the endpoint URL to your Botsi RTDN URL.
  4. Save.

What Botsi needs#

All three must be set before notifications can be processed:

  • Your app's Package Name in Botsi.
  • The service account JSON key in Botsi.
  • Access to the Google Play Orders API for that service account. Botsi reads the charged order for every purchase and renewal.

How Botsi verifies notifications#

The decoded notification's package name must equal the Package Name saved in Botsi. Botsi doesn't check a Pub/Sub push authentication token, so you don't need to turn one on for the subscription.

A package name mismatch is dropped, not retried

A notification that can never succeed, such as one for a different package name or a malformed message, is acknowledged with 200 and not processed. Pub/Sub never redelivers it, so check the Package Name in Botsi before you point the subscription at Botsi.

What Botsi records#

Each notification updates the subscriber's status and Access Levels. Botsi also records revenue from it:

Google notificationRecorded as
Purchased, renewed, recovered, or restartedA charge. The amount comes from Google's order record: what the buyer paid and your revenue as the developer
Free trialA $0 trial start
Introductory priceA paid trial start
First full-price charge after a trialThe trial conversion
One-time product purchasedA one-time purchase, from the order
One-time purchase canceledA $0 billing issue
Voided purchaseA refund, as negative revenue. A partial refund uses the refunded amount
Canceled, expired, grace period, on hold, paused, or pending purchase canceledA $0 status change, recorded only when Google's current subscription state agrees

Revoked and test notifications aren't recorded as revenue. Test purchases are recorded as sandbox.

Responses#

Pub/Sub retries any response other than 2xx.

StatusWhen
200The notification was processed. Also returned for a malformed message or a package name mismatch, which are acknowledged and not processed
404No app has this notification key. Pub/Sub retries it
500A temporary failure, such as the Google Orders API or Botsi's database. Pub/Sub retries