question

jcspuul avatar image
jcspuul asked

Get the child sku on the server side api call

When verifying the subscription on the server side, we only get the parent sku of the transaction. Is it possible to get the child SKU as well? Our parent sku has two children. Thanks!
iap
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Jcspuul, There is no way to get the child sku name from the current purchase token in RVS as of now. Can you please let us know the use case of it? I mean, why do you need child sku name to be retrieved after validate the response from back end?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jcspuul avatar image
jcspuul answered
Hello, Sorry for the late response. Just an overview, we have a parent SKU which we call Premium, under it we have child sku: 1. premium_for_30_days 2. premium_for_1_year On the server side, after validating the purchase, we mark what child sku did the user buy, for accounting purposes. This is what we usually do for ios and android.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Icspull, Thank you for writing back. Part of the IAP value proposition is that we manage the complexity of the subscription for the developer so they don't have to. We intentionally hide the subscription complexity from developer so that they can easily adopt the system. Developers are supposed to check periodically whether the subscription is still valid or expired from RVS response (by checking the end date field) from the app back end to lock/unlock the item for the same user for other platform like iOS or Desktop. So for a subscription when we receive a success callback in the onPurchaseResponse() with the parent SKU as an identifier and a purchase token, we are supposed to deliver (or unlock) the content in the app client and persist the purchase token along with the user id (the one returned by IAP SDK) in the app back end (if the app has one). Now we can check the validity of subscription periodically in the client from onPurchaseUpdatesResponse and from RVS response from app back end. If the item is found out of the subscription period, we would invalidate the item for that user. This is how subscription works. So if it's a question of delivering or invalidating the subscription, what the current infrastructure provides,it should be sufficient to meet your requirements. Document links: https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs/rvs https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs/flowchart https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs/fundamentals
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.