Webhooks Setup
BitEasy needs to receive purchase events to calculate partner earnings. This page explains how to configure webhooks for each supported provider.
Overview
Section titled “Overview”When a user makes a purchase, the purchase event flows through your IAP provider to BitEasy:
flowchart LR
A[User Purchase] --> B[App Store / Play Store]
B --> C[RevenueCat / Direct]
C --> D[BitEasy Webhook]
D --> E[Partner Earnings Calculated]
RevenueCat
Section titled “RevenueCat”RevenueCat is the recommended integration for most apps.
-
Get your webhook URL from BitEasy:
https://api.biteasy.co/api/v1/revenuecat/<YOUR_APP_ID> -
Create a webhook secret in your RevenueCat project settings
-
Configure the webhook in RevenueCat Dashboard:
- Go to Project Settings → Integrations → Webhooks
- Add a new webhook with the BitEasy URL
- Set the authorization header to your secret
-
Enter the secret in BitEasy:
- Go to your app’s Settings
- Under IAP Provider, select RevenueCat
- Enter the Webhook Authorization Secret
Apple App Store (Direct)
Section titled “Apple App Store (Direct)”For direct integration with Apple’s App Store Server Notifications V2:
-
Get your webhook URL:
https://api.biteasy.co/api/v1/apple/<YOUR_APP_ID> -
Configure App Store Connect:
- Go to App Store Connect → My Apps → Your App
- Navigate to App Information → App Store Server Notifications
- Enter the BitEasy webhook URL
-
Create an API Key:
- Go to Users and Access → Keys → In-App Purchase
- Create a new key and download it
-
Configure BitEasy:
- In app Settings, select Apple as IAP Provider
- Enter Bundle ID, App Apple ID, Issuer ID, Key ID
- Paste the base64-encoded private key
| Field | Where to Find |
|---|---|
| Bundle ID | Your app’s bundle identifier (e.g., com.yourcompany.app) |
| App Apple ID | App Store Connect → General → App Information |
| Issuer ID | App Store Connect → Users and Access → Keys |
| Key ID | From the API key you created |
| Encoded Key | Base64-encode your .p8 private key file |
Google Play (Direct)
Section titled “Google Play (Direct)”For direct integration with Google Play Real-time Developer Notifications (RTDN):
-
Enable the Google Play Android Developer API in your GCP project:
- Go to Google Cloud Console → APIs & Services → Library
- Search for Google Play Android Developer API (
androidpublisher.googleapis.com) - Click Enable
-
Create a service account (if you haven’t already):
- Go to IAM & Admin → Service Accounts in your GCP project
- Create a service account and download the JSON key
- You’ll paste the full JSON content in your BitEasy app settings
-
Grant the service account access in Play Console:
- Go to Google Play Console → Settings → Users and permissions
- Click Invite new users and enter the service account email (e.g.,
your-sa@your-project.iam.gserviceaccount.com) - Grant these permissions: View app information and download bulk reports, View financial data, orders, and cancellation survey responses, Manage orders and subscriptions
- Scope to your app or all apps, then save
-
Create a Pub/Sub topic in Google Cloud Console → Pub/Sub:
- Create a topic (e.g.,
play-rtdn) - Important: Add
google-play-developer-notifications@system.gserviceaccount.comas a Pub/Sub Publisher on the topic. Without this, Google Play cannot send notifications to your topic.
- Create a topic (e.g.,
-
Configure RTDN in Play Console:
- Go to Google Play Console → Your app → Monetization setup → Real-time developer notifications
- Enter the full topic path:
projects/<project-id>/topics/<topic-name>
-
Create a push subscription on the topic:
- In Google Cloud Pub/Sub, create a push subscription on the topic
- Set the endpoint URL to:
https://api.biteasy.co/api/v1/google/<YOUR_APP_ID>
- Under Authentication, select Enable authentication with your service account and set the audience to the endpoint URL
- Set the acknowledgement deadline to 10 seconds (the webhook is lightweight and responds quickly)
-
Configure BitEasy:
- In app Settings, select Google as IAP Provider
- Enter your Package Name, Pub/Sub Topic, and paste the Service Account JSON key
-
Send a test notification:
- In Google Play Console → Monetization setup → Real-time developer notifications, click Send test notification
- Check your API logs to confirm receipt
| Field | Description |
|---|---|
| Package Name | Your app’s package name (e.g., com.yourcompany.app) |
| Pub/Sub Topic | Full topic path: projects/<project-id>/topics/<topic-name> |
| Service Account JSON | Full JSON key file contents for a service account with Play Console access |
| Error | Cause | Fix |
|---|---|---|
| 403 SERVICE_DISABLED | Google Play Android Developer API not enabled | Enable androidpublisher.googleapis.com in your GCP project |
| 401 permissionDenied | Service account not invited in Play Console | Add the service account email in Play Console → Settings → Users and permissions |
| No notifications received | Missing Pub/Sub Publisher role | Add google-play-developer-notifications@system.gserviceaccount.com as Publisher on your Pub/Sub topic |
| Topic not found in Play Console | Wrong topic format | Use the full path: projects/<project-id>/topics/<topic-name> |
| OIDC token verification failed | Push subscription auth misconfigured | Ensure your push subscription uses OIDC authentication with the correct service account |
Supported Event Types
Section titled “Supported Event Types”BitEasy processes these purchase event types:
| Event | Description |
|---|---|
| INITIAL_PURCHASE | New subscription or one-time purchase |
| RENEWAL | Subscription renewal |
| PRODUCT_CHANGE | Plan upgrade/downgrade |
| CANCELLATION | Subscription cancelled (refund) |
Revenue is attributed to the partner who referred the subscriber.
Verifying Setup
Section titled “Verifying Setup”After configuring your webhook:
- Make a test purchase in your app (sandbox/TestFlight)
- Check your IAP provider’s webhook delivery logs to confirm delivery
- View the Finances → Earnings tab in BitEasy to see if the purchase was recorded
Troubleshooting
Section titled “Troubleshooting”Webhooks Not Arriving
Section titled “Webhooks Not Arriving”- Verify the webhook URL is correct
- Check your provider’s webhook delivery logs
- Ensure the authorization secret matches
Earnings Not Calculating
Section titled “Earnings Not Calculating”- Verify the subscriber was attributed (has a
subscribersrecord) - Check the
biteasyInstallIdorapp_user_idmatches
Duplicate Events
Section titled “Duplicate Events”BitEasy automatically deduplicates based on transaction_id. Retried webhooks won’t create duplicate earnings.
Next Steps
Section titled “Next Steps”- Referral Links Overview — Create links for partners
- Earnings — View partner earnings from purchases