01-17-2023 02:19 AM
Hi Support,
For IAP S2S requests in this doc: https://developer.oculus.com/documentation/native/ps-iap-s2s/
1. Verify Item OwnerShip: there is no user id in the request, is this intended? if yes, how will oculus identify the user?
curl -d "access_token=OC|$APP_ID|$APP_SECRET" -d "sku=$SKU" https://graph.oculus.com/$APP_ID/verify_entitlement
2. Consume an IAP Item: the same quest as no.1
curl -d "access_token=OC|$APP_ID|$APP_SECRET" -d "sku=$SKU" https://graph.oculus.com/$APP_ID/consume_entitlement
3. Retrieve Items Owned: what is the user id? app scoped id or org scoped id?
curl -G -d "access_token=OC|$APP_ID|$APP_SECRET" -d "user_id=$USER_ID" -d "fields=id,grant_time,expiration_time,item{sku}" https://graph.oculus.com/$APP_ID/viewer_purchases
Thanks
06-15-2023 02:45 PM
I noticed the same thing... it looks wrong. I'll try USER_ID instead of APP_ID, let's see if that works. Did you figure it out?
08-31-2023 07:22 AM
Also confused with this. Any Updates?
09-30-2023 10:00 AM - edited 09-30-2023 10:00 AM
OK, figured it out... No idea why the docs don't have it for all requests https://developer.oculus.com/documentation/unity/ps-iap-s2s/ but the key is using the `user_id` parameter. It's only used in the "Retrieve Items Owned" example...
Here's how I verify and consume purchases in Python using the requests library:
def verify_oculus_in_app_purchase(meta_user_id: str, sku: str):
return requests.post(
f'https://graph.oculus.com/{app_id}/verify_entitlement',
data={'sku': sku, 'access_token': access_token, 'user_id': meta_user_id}
).json()
def consume_oculus_in_app_purchase(meta_user_id: str, sku: str) -> bool:
return requests.post(
f'https://graph.oculus.com/{app_id}/consume_entitlement',
data={'sku': sku, 'access_token': access_token, 'user_id': meta_user_id}
).json()
Good luck with your projects everyone!