Solved

getCustomerInfo in sdk returns different data than curl request

  • 5 December 2023
  • 2 replies
  • 44 views

Badge

I use react native (react-native-purchases 7.4.0) and while executing getCustomerInfo, i get the correct subscription status (It is a renewal in a subscription).

{
"activeSubscriptions": [
"rc_5_1m_1w0"
],
"allExpirationDates": {
"rc_5_1m_1w0": "2024-01-04T09:54:55Z"
},
"allExpirationDatesMillis": {
"rc_5_1m_1w0": 1704362095000
},
"allPurchaseDates": {
"rc_5_1m_1w0": "2023-12-04T09:54:55Z"
},
"allPurchaseDatesMillis": {
"rc_5_1m_1w0": 1701683695000
},
"allPurchasedProductIdentifiers": [
"rc_5_1m_1w0"
],
"entitlements": {
"active": {
"month": [Object
]
},
"all": {
"month": [Object
]
},
"verification": "NOT_REQUESTED"
},
"firstSeen": "2023-12-04T19:19:26Z",
"firstSeenMillis": 1701717566000,
"latestExpirationDate": "2024-01-04T09:54:55Z",
"latestExpirationDateMillis": 1704362095000,
"managementURL": "https://apps.apple.com/account/subscriptions",
"nonSubscriptionTransactions": [],
"originalApplicationVersion": "1.0",
"originalAppUserId": "91ec1062-41c6-4d85-b514-7c0d429f7095",
"originalPurchaseDate": "2023-11-01T09:53:44Z",
"originalPurchaseDateMillis": 1698832424000,
"requestDate": "2023-12-05T06:19:48Z",
"requestDateMillis": 1701757188000
}

 

But, while executing an axios request on the endpoint https://api.revenuecat.com/v1/subscribers/91ec1062-41c6-4d85-b514-7c0d429f7095

{
"request_date": "2023-12-05T06:44:20Z",
"request_date_ms": 1701758660566,
"subscriber": {
"entitlements": {},
"first_seen": "2023-12-04T19:19:26Z",
"last_seen": "2023-12-04T19:19:26Z",
"management_url": null,
"non_subscriptions": {},
"original_app_user_id": "91ec1062-41c6-4d85-b514-7c0d429f7095",
"original_application_version": "1.0",
"original_purchase_date": "2023-11-01T09:53:44Z",
"other_purchases": {},
"subscriptions": {}
}
}

 

I do not get any entitlements/active subscriptions.

 

Does anybody know why this happens?
 

 

icon

Best answer by cody 7 December 2023, 15:12

View original

2 replies

Userlevel 5
Badge +8

Hello @codingjohny!

We recently shipped a change that excludes StoreKit test transactions from our GET /subscribers endpoint by default. To include these transactions, please include the following header in your request:

`X-Is-Sandbox: true`

Badge

Hello @codingjohny!

We recently shipped a change that excludes StoreKit test transactions from our GET /subscribers endpoint by default. To include these transactions, please include the following header in your request:

`X-Is-Sandbox: true`

Thanks! It works.

Reply