- Connection with the Google Publisher API.
- Configure the Apple Webhook.
- Attach the application username when making purchases.
Pulling regularly the Customer Purchases API for all your customers isn’t a great solution. Instead, you can setup a endpoint on your server that Fovea will call whenever a user’s purchases might have changed. This Webhook will be called as when the user validates a receipt or when Apple or Google themselves sends a notification (for subscription events).
- Your endpoint should use SSL, using an
https://endpoint. Self-signed certificates are accepted.
- Make sure to return status
200for all calls, even for unrecognized webhook types. The webhook might be extended with new message types.
The format of the request sent to your server is described below.
Fovea will call your webhook URL request using the POST method. The body will be a JSON object containing the webhook type and the associateed data.
|type||string||Only one possible value for now:
|applicationUsername||string||Your application user identifier. See the applicationUsername documentation.|
|purchases||object||The Purchases Collection object, see below. Only available it type is
|password||string||Should match your account’s Secret Key (found in your Dashboard Settings), to ensure that Fovea is calling your endpoint and not someone else.|
An object whose keys are product identifiers and values are Purchase objects. See below.
A purchase object.
|productId||string||The unique identifier of the product.|
|purchaseId||string||The unique identifier of the purchase.|
|platform||string||Platform vendor that generated the purchase (apple, google, …)|
|sandbox||boolean||Whether the purchase was made in a sandbox or a production environment.|
|purchaseDate||date-time||Time at which the product was granted, in the ISO 8601 date-time format.|
|expirationDate||date-time||Time at which the current (or last active) subscription is set to expire, in the ISO 8601 date-time format.|
|isExpired||boolean||Whether a subscription has expired. Check the cancelationReason field to know the reason why the subscription has expired.|
|renewalIntent||string||Whether the customer intents to let a subscription be renewed when it reaches its current expiry time. Possible values:
|renewalIntentChangeDate||date-string||Last time the customer or system changed the renewalIntent status.|
|cancelationReason||string||The reason why a transaction was canceled, a subscription is not auto-renewing or expired. Possible values are:
You can use this value to display an alternative subscription product in your app, to win back the customer, such as a lower-level subscription plan to which the user can downgrade from their current plan. Consider presenting an attractive upgrade or downgrade offer.
|isBillingRetryPeriod||boolean||Whether an auto-renewable subscription is in the billing retry period.
This field indicates whether the platform is attempting to renew an expired subscription automatically. If the customer’s subscription failed to renew because the platform was unable to complete the transaction, this value reflects whether the platform is still trying to renew the subscription. You can use this field to:
|isTrialPeriod||boolean||Whether a subscription is in the free trial period. Possible values are:
|isIntroPeriod||boolean||Whether an auto-renewable subscription is in the introductory price period.|
|discountId||string||Identifier of the subscription offer redeemed by the user. (iOS only)
You provide this value in the Promotional Offer Product Code field when you create the subscription offer in App Store Connect. You can use this value to:
|priceConsentStatus||string||Price consent status for a subscription price increase. Possible values: