Solved

Sandbox and Production Interaction

  • 29 August 2022
  • 4 replies
  • 149 views

Badge +3

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?

icon

Best answer by Jens 29 August 2022, 21:15

View original

4 replies

Userlevel 5
Badge +7

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

Badge +3

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?

Userlevel 5
Badge +7

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).

Badge +3

That’s good to know. Thank you!

Reply