Search code examples
in-app-purchasesubscription

what is the use of expiration_intent if I want to check the user in-app subscription is expired or not?


I am currently using sandbox and server to validate my receipt. when it come to handling the subscriptions expired or cancelled , I have to check the flags. Would you please tell me how to handle these 2 cases with respect of the flags?

"pending_renewal_info": [
     {
      "expiration_intent": "1",  (cancelled subscription)
      "auto_renew_product_id": “product_ name”,
      "original_transaction_id": “11111111111111111”,
      "is_in_billing_retry_period": "0",
      "product_id": “product_name”,
      "auto_renew_status": "0"
    }
  ]

Solution

  • The expiration_intent is the reason for the subscription expiration. If this field is present, it means the subscription has expired. You can also check the expires_date to determine when it expired.

    This key is only present for a receipt containing an expired auto-renewable subscription. You can use this value to decide whether to display appropriate messaging in your app for customers to resubscribe.

    “1” - Customer canceled their subscription.

    “2” - Billing error; for example customer’s payment information was no longer valid.

    “3” - Customer did not agree to a recent price increase.

    “4” - Product was not available for purchase at the time of renewal.

    “5” - Unknown error.