Fovea.Billing

is now IAPTIC, please go to the new and better version of our system.

Customer Purchases API

GET /v2/customers/:applicationUsername/purchases
Get customer purchases.

Requirements

Response body

The /v2/customers/:applicationUsername/purchases request returns a JSON object containing information about the last purchase for each product made by a customer.

Property name Type Description
applicationUsername string User identifier from your application as specified in the store.order() call. See the applicationUsername documentation.
purchases object The Purchases Collection object. See below.

Purchases Collection

An object whose keys are product identifiers and values are Purchase objects. See below.

Purchase

A purchase object.

Property name Type Description
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:

  • Renew – The subscription will renew at the end of the current subscription period.
  • Lapse – The customer has turned off automatic renewal for the subscription. Check the cancelationReason field for details.
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:

  • Developer – Subscription canceled by the developer.
  • System – Subscription canceled by the system for an unspecified reason.
  • System.Replaced – Subscription upgraded or downgraded to a new subscription.
  • System.ProductUnavailable – Product not available for purchase at the time of renewal.
  • System.BillingError – Billing error; for example customer’s payment information is no longer valid.
  • Customer – Subscription canceled by the user for an unspecified reason.
  • Customer.TechnicalIssues – Customer canceled their transaction due to an actual or perceived issue within your app.
  • Customer.PriceIncrease – Customer did not agree to a recent price increase. See also priceConsentStatus.
  • Customer.Cost – Customer canceled for cost-related reasons.
  • Customer.FoundBetterApp – Customer claimed to have found a better app.
  • Customer.NotUsefulEnough – Customer did not feel he is using this service enough.
  • Customer.OtherReason – Subscription canceled for another reason; for example, if the customer made the purchase accidentally.
  • Unknown – Subscription canceled for unknown reasons.

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.

  • true – The platform is attempting to renew the subscription.
  • false – The platform has stopped attempting to renew the subscription.

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:

  • Inform the user that there may be an issue with their billing information. For example, an expired credit card or insufficient balance could prevent this customer’s account from being billed.
  • Implement a grace period to improve recovery, if the value is true and the isExpired field is set. A grace period is free or limited subscription access while a subscriber is in a billing retry state.
isTrialPeriod boolean Whether a subscription is in the free trial period. Possible values are:

  • true – The subscription is in the free trial period
  • false – The subscription is not in the free trial period
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:

  • Confirm that the sale of the subscription was from a subscription offer.
  • Confirm which subscription offer was redeemed.
  • Keep track of the subscription offers that a user has redeemed to limit discounts you offer, according to your business model.
priceConsentStatus string Price consent status for a subscription price increase. Possible values:

  • Notified – Customer has been notified of the price increase but did not agree to it.
  • Agreed – Customer agreed to the price increase.