Forum Discussion

to_the_cosmic_end's avatar
19 days ago

Understanding Server APIs for Subscription

Hello, I am testing 2 level subscription tier (both monthly) in draft mode and I am having trouble understanding certain behavior from server APIs responses during my testing with a test user account.

1. Subscription doesn't renew automatically

GET https://graph.oculus.com/application/subscriptions

Whenever I edit subscription end period from developer dashboard, the subscription remains in active state even after past the renewal date time, `period_start_time` and `period_end_time` has no change at all and `is_active` is also set to true. So my question is this expected that for test user the renewal is not automatic and I must "renew" manually from the dashboard?

2. Mismatch between APIs

GET https://graph.oculus.com/application/subscriptions 
GET https://graph.oculus.com/$APP_ID/viewer_purchases

The expiration time is 5 days in the future for /viewer_purchases as compared to /subscriptions which returns correct expiration time. There is another problem with /subscriptions api returns start and end period in datetime format instead of unix timestamp as in viewer_purchases endpoint. I also found that  /viewer_purchases is less dependable as it continues to return the item even when subscription has been deleted from dashboard so /subscriptions appears to be more correct in this case.

3. Cancellation has no impact subscription status even after expiry

GET https://graph.oculus.com/application/subscriptions

Even after the expiration date has passed, the subscription returns `is_active` as true. so neither the subscription renews (when not cancelled) nor expires (when cancelled) from the dashboard.

{ "owner": { "id": "xxxxxxxxx" }, "sku": "example_pro_tier", "is_active": true, "period_start_time": "2025-09-20T08:20:52+0000", "period_end_time": "2025-10-20T08:20:52+0000", "next_renewal_time": "2025-10-20T08:20:52+0000", "cancellation_time": "2025-10-20T08:16:54+0000", "id": "xxxxxxxx" } }

The only thing that works is if I manually "expire" from dashboard then the `is_active` is set to false

4. No Grace Period Data

In the docs, its clearly written that subscription remains active for 3 more days if user renewal fails, however in test, there is no data related to grace period (for example: period_end_time and next_renewal_time should extended by the grace period). However, there is no way to test renew failure state -> enters into grace period state  from dashboard. 

5. Subscription ID remains unchanged

GET https://graph.oculus.com/application/subscriptions

Now this could be a feature that the Subscription ID remains same in case of upgrade, downgrade, renewals, cancellation, expiration, resubscription but this makes it harder to identify when user has actually renewed their subscription. For example, in my backend, I want to reward user some virtual items on each successful renewals, but if I depend on just SKU and expire timestamp then I would think user has renewed even in case user went into grace period and the expire timestamp has been extended (unless I am mistaken and expire timestamp doesn't extend in case of grace period). 

Now here is what I believe happens in production mode BUT I need to validate that my logic is not flawed at any point:
1. User subscribes to a low tier SKU (is_active is true)
2. User subscription renews:

     i. Success - period_end_time is extended to next date in future.

     ii. Failure - user enter grace period and ONLY next_renewal_time is extened while is_active still remain true

         a. Renewal success after grace period ends  - period_end_time is extended and is_active still remain true

         b. Renewal fails again after grace period ends OR if user cancels subscription while in grace period - then is_active is set to false

3. User decides to upgrade to higher tier SKU (sku, period_end_time is updated and is_active is set to true)
4. User decides to downgrade to lower tier SKU (no changes until renewal at which point lower tier will be activated (sku, period_end_time will be updated and is_active will remain set to true))
5. User cancels the subscription while in subscription (cancellation_time will be available but no action needed as user can continue to use remaining period left into their subscription cycle)
6. Subscription expires post expiration date after being cancelled (is_active is set to false)
7. User returns again (is_active is true and period_end_time is updated)

Let me know if I missed something here and if I can use this logic to  basically depend on sku, is_active and period_end_time changes to notify my backend to reward user indicating there was a successful purchase, renewal or upgrades.

 

No RepliesBe the first to reply

→ Find helpful resources to begin your development journey in Getting Started

→ Get the latest information about HorizonOS development in News & Announcements.

→ Access Start program mentor videos and share knowledge, tutorials, and videos in Community Resources.

→ Get support or provide help in Questions & Discussions.

→ Show off your work in What I’m Building to get feedback and find playtesters.

→ Looking for documentation?  Developer Docs

→ Looking for account support?  Support Center

→ Looking for the previous forum?  Forum Archive

→ Looking to join the Start program? Apply here.

 

Recent Discussions