A running Amazon EC2 instance can determine if has an Amazon DevPay product code. The instance retrieves the product code similarly to how retrieves other metadata. For more information about retrieving metadata, see Instance Metadata.
To retrieve a product code, query a web server with this REST-like API call:
GET http://169.254.169.254/2007-03-01/meta-data/product-codes
Amazon EC2 returns a response similar to the following: