Environment requirements
Before you use RVS Cloud Sandbox, make sure your environment meets the following requirements.App Tester
RVS Cloud Sandbox is used to validate receipts generated by the App Tester. You must install the Amazon App Tester tool on an Fire device before you can use the RVS Cloud Sandbox. For more details, see App Tester Setup. The App Tester sends a receipt for each completed in app purchase. You need to pass the App Tester receipt to your app server, then call RVS Cloud Sandbox to verify the receipt.Secure protocol
The server needs to communicate securely with RVS Cloud Sandbox via a secure protocol such as HTTPS. Your server sends validation requests to RVS Cloud Sandbox and processes the responses.RVS response objects
The RVS Cloud Sandbox request uses data from the object, or the object. From these response objects, you can extract aUserId, which denotes a unique identifier of the user. The PurchaseResponse object contains a ReceiptId, which is used along with the UserId to perform an out-of-band server-side validation of the purchase.
Send an RVS Cloud Sandbox request
To use RVS Cloud Sandbox, you must send a request over HTTPS to the RVS Cloud Sandbox endpoint:https://appstore-sdk.amazon.com/sandbox.
Use the following format for your request, replacing the terms in the angle brackets with the values in the table below:
| Parameter | Description |
|---|---|
| operation-version-number | Version number of the verifyReceiptId operation. This version number is independent of the IAP version number. The current verifyReceiptId version number is “1.0”. |
| shared-secret | Shared secret used to identify the developer issuing the request. Your shared secret can be found on the Shared Key page in the Developer Console: https://developer.amazon.com/sdk/shared-key.html. For the RVS Cloud Sandbox, the shared secret can be any non-empty string. The RVS Cloud Sandbox server does not validate the shared secret, as it’s only validated for the production servers. |
| user-id | ID representing a distinct Amazon customer for your Appstore app. Obtain the user ID from PurchaseResponse.getUserData().getUserId(). |
| receipt-id | Unique ID for the purchase. Obtain the reciept ID from PurchaseResponse.getReceipt().getReceiptId() or PurchaseUpdatesResponse.getReceipts() → Receipt.getReceiptId(). |
RVS Cloud Sandbox example
The following request verifies a receipt in the RVS Cloud Sandbox:Test receipts in RVS Cloud Sandbox
Appstore manages separate flows for production and sandbox environments for RVS. In the sandbox flow, App Tester generates the receipt, which makes it a test receipt. RVS Cloud Sandbox allows you to verify the receipts generated by App Tester but doesn’t support every production scenario. When using RVS Cloud Sandbox to verify a test receipt, it appends the suffix_term to the termSku property. In production RVS, the _term suffix is not added to the termSku property.
In the JSON file that you pushed to the device when you set up App Tester, all subscription entries have a different SKU from the subscription parent. When you purchase any SKU through App Tester, the RVS Cloud Sandbox response generates the value of the termSku property as follows:
- If subscription base SKU is available:
<subscriptionBase>_term - If subscription base SKU is not available:
<subscriptionParent>_term
COMMERCE_AMAZONIAP_MOONBUG_001. There is no subscription base SKU, and the subscription parent SKU is Moonbug_TEST. RVS Cloud Sandbox returns a value of Moonbug_TEST_term in the termSku property of the response.
