Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content
The Receipt Verification Service (RVS) enables validation of purchases made by your app’s users. In the preview release, you can use RVS in sandbox mode. This page introduces you to RVS and shows the syntax of RVS requests and responses.

RVS overview

The following image shows the purchase workflow with receipt verification. RVS starts after the IAP API completes the purchase and returns the purchase receipt to the app. The steps in the following table match the callouts in the diagram above: You can also use RVS to enable access to a subscription purchased on another platform, such as your website, as long as the purchase was made through Amazon. The following scenario describes this workflow:
  1. Your app’s user purchases a subscription through Amazon via your company’s website.
  2. Your app receives a receipt for the purchased subscription
  3. To enable access, your app then sends information from the receipt to your server. Finally, your server validates this transaction by querying RVS.

RVS request syntax

Use RVS to validate the PurchaseResponse object, or the PurchaseUpdatesResponse object. From these response objects, you can extract a UserId, which denotes a unique identifier of the user. The PurchaseResponse object contains a ReceiptId, which is used in conjunction with the UserId to perform an out-of-band server-side validation of the purchase. Requests from your server require a shared secret to be passed to confirm your identity for security. These requests use the following format:
The terms in angle brackets are the request parameters, replace them with the following values for the transaction being verified:
  • Protocol: Protocol being used to communicate with the server or sandbox, such as https:.
  • Server: URL for the RVS server that you are communicating with.
  • sandbox: Use the value “sandbox”.
  • 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 for your developer account with the Amazon Appstore: https://developer.amazon.com/sdk/shared-key.html. For the RVSSandbox, the Shared Secret can be any non-empty string.
  • UserId: ID representing a distinct Amazon customer for your Appstore app: PurchaseResponse.getUserData().getUserId().
  • ReceiptId: Unique ID for the purchase: PurchaseResponse.getReceipt().getReceiptId() or PurchaseUpdatesResponse.getReceipts()Receipt.getReceiptId().

RVS response syntax

RVS provides a RESTful JSON API interface. As a best practice, use a JSON parser class for reading the JSON responses from the RVS server. After making a request to verify a transaction, the RVS server or sandbox returns a response code indicating if the request was successful. If successful, the returned JSON response includes information about the transaction. The following example shows a successful response:

RVS response codes

The Receipt Verification Service responds with one of the following codes, which indicate the result of the validation check:

RVS response fields for successful transactions

The following table lists and describes the fields included in an RVS response for a successful transaction:

Cancel date and renewal date

The renewalDate field contains the date that an auto-renew subscription purchase next needs to be renewed. This field applies to subscription purchases only. If a customer has a monthly subscription, the subscription renews monthly on the same date the customer first subscribed. In the case where the next month does not include the exact date, the renewal date is the closest prior date. For example:
  • If a customer subscribed on January 2, the next three renewal dates are February 2, March 2, and April 2.
  • If a customer subscribed on January 31, the next three renewal dates are February 28 (or February 29 if it is a leap year), March 31, and April 30.
The cancelDate field contains the date that a subscription purchase expired or that Amazon customer service canceled the purchase. The cancel date represents the date when the customer lost access to the content. When a customer cancels their subscription by turning off auto-renew, the cancel date is when the renewal date would have been. The renewalDate and cancelDate fields are stored as time in milliseconds. You can use java.util.Date(timeInMillis) to convert the value into a date object. Consumable or entitlement purchase In a valid receipt, the cancel date and renewal date both contain the null value. If the cancel date field is not null, it contains the date that Amazon customer service canceled the purchase. Subscription purchase In a valid subscription receipt, the cancel date is null. If the cancelDate field is not null, it contains the date that the subscription expired, or that Amazon customer service canceled the purchase. The renewalDate field contains the date that an auto-renew subscription purchase next needs to be renewed. The field value will be null if the subscription is not set to auto-renew. In the following example, the user has a subscription that was canceled:
  • The subscription was active from 2016/01/01 – 2016/03/01. In this receipt, the purchaseDate for this subscription is set to 2016/01/01, and the cancelDate is set to 2016/03/01.
  • If this subscription is subsequently reactivated on 2016/04/01, the subscription will have a second receipt. The second receipt will show a purchaseDate of 2016/04/01 and a cancelDate of null.

RVS Cloud Sandbox

To set up RVS in sandbox mode, see Use RVS Cloud Sandbox.
Last modified on September 30, 2025