Solved

`/v2/products/` REST API Endpoint

  • 25 July 2023
  • 3 replies
  • 60 views

Badge +2

Hi there!

How is trial_period calculated in `/v2/products/` endpoint?

1) We have a subscription with an offer in PlayStore with the Eligibility criteria type: Developer determined and the only Free Trial phase, but the data for this subscription does not match the expected values:

"subscription": {
"duration": "P1Y",
"grace_period_duration": "P14D",
"trial_duration": null
}

 

2) For AppStore subscriptions, there is no data available at all:

"subscription": {
"duration": null,
"grace_period_duration": null,
"trial_duration": null
}

, even though the subscription has an Introductory Offer with a zero price.

icon

Best answer by antonio 25 July 2023, 18:17

View original

3 replies

Badge +1

Hi @whisk-developer. Those are good questions and we should probably document it better. 

Answering your 2 questions more specifically.

1) We have a subscription with an offer in PlayStore with the Eligibility criteria type: Developer determined and the only Free Trial phase, but the data for this subscription does not match the expected values:

Since Google launched their subscriptions V2, there isn’t really just one free trial duration. A base plan (which maps to a RC product) can have multiple offers, and those offers could have different trial configurations.

If you use our Android SDK in versions before 6.0 (not included), the `trial_duration` property will be populated when we receive a purchase. For versions 6.0 and superior, this property will remain empty. We’re aware of this issue and will eventually fix it, but we have no timeline defined yet.

We also sync with the Play Store periodically to get the standard duration and the grace period duration. That’s probably why those two properties are available in your product.

 

2) For AppStore subscriptions, there is no data available at all:

For App Store products, we set the duration when we process a purchase. So I assume no purchase has been made yet for them?

 

Hope this helps.

Badge +2

For versions 6.0 and superior, this property will remain empty

I see, thank you for the explanation!

 

So I assume no purchase has been made yet for them?

We have purchased that product in the sandbox… Store Identifier is: wsk_dev_premium_v0_299_1m_1w0, identifier: prodc7c726af81

Badge +1

So I assume no purchase has been made yet for them?

We have purchased that product in the sandbox… Store Identifier is: wsk_dev_premium_v0_299_1m_1w0, identifier: prodc7c726af81

Sorry, I forgot to mention that we only populate the duration when it’s a production purchase. This is because in sandbox the duration could be different to the real one. 

Reply