I went backand forth inside documentation about how my backend with in shole flow.
Please add explanation on how my backend register user id and check payment/subscription status
As far as I understand
- frontend app need to get RevenueCat customer id via SDK
- Send that ID to backend to save. Assuming RevenueCat customer ID does not change, Our backend should keep track of it.
- When user does action All kind of Webhook will send request to my backend.
- Somehow we have to figure out RevenueCat customer ID from webhook request params. ( which I could not do )
- Then we have to call REST API /subscriptions. https://www.revenuecat.com/docs/customers/customer-info#web-apps But it is not documented
About step 1, here answer says webhook is suggestion. Is there any other ways?
About step 2, link mention send customer id everytime to backend. But no documentation about why. Does it change everytime?. Can’t we just save it first time?. What about my backend cronjobs? they can’t take this id from frontend …
About step 4 also there is no documentation about how we get customer id from Webhook.
About step 5, I tried it Webhook have something like this, app_user_id: "$RCAnonymousID:09488af8a5de45******4e17f76e2f4b". Why there is RCAnonymousID should we send it to /subscribers endpoint as it is? I tried sending CURL,
❯ curl --request GET \
--url https://api.revenuecat.com/v1/subscribers/$RCAnonymousID:09488af8a5*****9c394e17f76e2f4b \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer appl_hrtnJxTH******AgknhnanEoQWh'
response was object with empty subscriptions.
{"request_date":"2024-02-22T08:00:43Z","request_date_ms":1708588843368,"subscriber":{"entitlements":{},"first_seen":"2024-02-22T07:59:51Z","last_seen":"2024-02-22T07:59:51Z","management_url":null,"non_subscriptions":{},"original_app_user_id":":09488af8a5de45469c394e17f76e2f4b","original_application_version":null,"original_purchase_date":null,"other_purchases":{},"subscriptions":{}}}
I know there is a subscription for this user because that is how i get `$RCAnonymousID:09488af8a5*****9c394e17f76e2f4b` value from webhook.
So many mysteries to solve, Just to get user status on backend we need to wrestle with community questions and spend many hours.
Please add explanation on how Mobile App + RevenueCat SDK works with Backend + RevenueCat API
Also documentation about this Webhook and REST API customer ID difference. SDK gives some ID, Wenhook Gives 2 type of ID. how they are different which is connected to what?