Menu
Amazon DevPay
Developer Guide (API Version 2007-12-01)

Confirming a Customer's Subscription Status

If you provide customer support for your paid or supported AMI products, you can confirm that any customer who calls for support is an active subscriber to the AMI product in question. To do this, you must integrate with the License Service API (for information, see License Service API Reference).

The process for verifying the customer's status is described in the following diagram and corresponding table.

Verifying a Customer's Subscription Status

Process for Confirming Customer Status

You register your AMI product with DevPay.

As part of the registration, you receive a product code and a product token. You store those two values together. For more information about product registration, see Registering Your Product.

You implement your paid or supported AMI.

For information about paid AMIs, see Process for Creating and Using Paid AMIs. For information for supported AMIs, see Supported AMIs.

Later, a customer signs up for your AMI product. At the end of the sign-up process, the customer's browser window splits into two frames. The top frame contains a confirmation for the purchase. The bottom frame contains the redirect URL that you provided when you registered your AMI product with DevPay, with two values appended as query parameters: an activation key and the product code for the AMI product.

For example, if your redirect URL is http://www.example.com/productActivation.html, the customer would be redirected to http://www.example.com/productActivation.html?ActivationKey=<activation key value>&ProductCode=<product code value>.

The activation key is also displayed in the top frame of the window. For information about why it's displayed there, see Exception Handling for the Redirect URL.

You provide an application that retrieves the two values appended to the redirect URL. The application looks up the product token that is associated with the product code. Then the application makes a signed request to the License Service action ActivateHostedProduct with the product token and the activation key. The response includes a persistent identifier (PID) for the customer. Your application stores the PID.

Later, when a customer contacts you for support on one of your AMI products, your customer service representative looks up the PID for the customer. The application then makes a signed request to the License Service action VerifyProductSubscriptionByPid with the PID and the product code for the AMI product in question. The response confirms whether the customer is currently subscribed to the AMI product.


Note

The PID represents the relationship between you (the AMI product owner) and the customer. Even if a customer buys 10 different AMI products from you, you have only one PID for that customer.

Exception Handling for the Redirect URL

Although the failure rate for the redirect is expected to be low, your application must be prepared to handle any failure cases. It's plausible the customer could close the browser window and prevent your application from retrieving the activation key and product code from the redirect. Your application must handle the situation in which one or both of the parameters are not available through the redirect. See the suggested actions in the following table.

Activation Key RetrievedProduct Code RetrievedSuggested Action

No

Yes

Your web page should display the name of the AMI product and prompt the customer for the activation key, which was displayed in the top frame of the browser window.

The customer can then either provide the activation key from the top frame or obtain a new activation key by clicking the activate URL that you display.

In either case, you should provide a way for the customer to paste the activation key into a form on your page.

Yes

No

Your web page should display a list of your AMI products and ask the customer to select the AMI product just purchased (the one the activation key is associated with).

The customer can then select the product, enabling your application to retrieve the product token to use in a request for ActivateHostedProduct. If the customer chooses the wrong product, the request fails.

No

No

One reason this situation occurs is if the customer closes the browser window.

Your web page should display a list of your AMI products and ask the customer to select the AMI product (the one the activation key is associated with). The page should also prompt the customer for the activation key, which was displayed in the top frame of the browser window.

The customer can then either provide the activation key from the top frame or obtain a new activation key by clicking the activate URL that you display.

In either case, you should provide a way for the customer to paste the activation key into a form on your page.