Skip to main content

Working through setting up RC for the first time am using https://docs.revenuecat.com/reference/subscribers to grab a particular user’s entitlements and subscriptions information. Per the docs, I see that the subscriptions payload returns a mapping of product_id to the subscription itself. When testing with a Sandbox account, I see the is_sandbox populates as true which is to be expected.

 

If a user has a sandbox subscription and I then subscribe the same user with a production subscription, what exactly happens? Is this allowed and, if so, how does this affect the final subscriptions payload?

yes, this is allowed, and you would find both subscriptions in the subscriptions payload (one with `is_sandbox` true, and one false)


yes, this is allowed, and you would find both subscriptions in the subscriptions payload (one with `is_sandbox` true, and one false)

But the subscriptions object is a mapping of a product_id to a single subscription object. Example (pardon the formatting):

subscriptions: {
<product_id_1>: {
billing_issues_detected_at: None,
expires_date: 2022-08-24T19:14:10Z,
grace_period_expires_date: None,
is_sandbox: True,
original_purchase_date: 2022-08-19T17:59:46Z,
ownership_type: PURCHASED,
period_type: normal,
purchase_date: 2022-08-24T19:09:10Z,
store: app_store,
unsubscribe_detected_at: None
},
<product_id_2>: {
billing_issues_detected_at: None,
expires_date: 2022-08-29T14:11:13Z,
grace_period_expires_date: None,
is_sandbox: True,
original_purchase_date: 2022-08-19T17:59:46Z,
ownership_type: PURCHASED,
period_type: trial,
purchase_date: 2022-08-29T14:06:13Z,
store: app_store,
unsubscribe_detected_at: None
}
}

For this to show up, wouldn’t we need a unique product id?


ah yeah, that’s a good point. in that case you will get whatever has the latest expiration date (which will most likely be the production subscription because sandbox subscriptions have accelerated expirations).


That’s good to know. Thank you!


Reply