AWS Marketplace

Updating pricing in your AMI products in AWS Marketplace using Catalog APIs

Recently, we announced a set of features within the AWS Marketplace Catalog APIs that help sellers streamline the management of their products. Catalog API provides an interface for sellers to access product listing capabilities programmatically. This enables you to integrate the API into your internal DevOps process and CI/CD pipelines to automate your publishing needs. While Catalog API was introduced in March of 2021, new features are always being added based on partner feedback.

Sellers faced challenges applying price updates for single-AMI products through the AWS Marketplace Management Portal (AMMP). Sellers spent significant time using AMMP or product load form (PLF) to update the price for each instance type individually within a product. This reduced seller agility and limited bandwidth for more value-added tasks. With the newly released features of Catalog API, sellers can create and update products through automation and focus their time more efficiently.

Catalog API enables you to use automation, which in turn can enable bulk updates. Let’s discuss three different use cases to demonstrate how you can use Catalog API for single-AMI products as it relates to pricing updates.

  1. Automate pricing updates of all of your single-AMI products: Deliver changes rapidly while keeping all updates consistent and reducing human error from your product refresh cycle. This augments the current Catalog API functionality.
  2. Configure your CI/CD pipeline to update pricing for all of your AWS Marketplace products programmatically. This increases efficiency compared to creating manual updates using the AWS Marketplace Management Portal.
  3. New instance type automation: Automate addition of new instances and prices with bulk updates to your single AMI products when AWS releases additional Amazon Elastic Compute Cloud (Amazon EC2) instance types. You can combine the UpdatePricingTerm ChangeType with other ChangeTypes to fit your use case. With this approach, your products will support the latest instance types whenever they are released to the public.

In this post, we discuss a new feature, a ChangeType called UpdatePricingTerms that allows you to update your single Amazon Machine Image (AMI) product’s prices. We will also discuss the benefits of using this feature of Catalog API to update prices. Further, we highlighted the different options for scaling your pricing updates.

Flow Diagram for CAPI AMI Pricing

Prerequisites

In order to use the new Catalog API capability UpdatePricingTerms to update single-AMI product pricing, a few prerequisites are required:

[default]

Region = us-east-1

Solution overview

One of the benefits of using Catalog API to update your single-AMI product’s pricing is the time saved applying updates to your products. You won’t have to enter each field in the UI from AWS Marketplace Management Portal or via a PLF and then submit it for review. With the new UpdatePricingTerms change type, you can automate pricing updates with a JSON file and submit your request. Updates you submit with Catalog API will be processed more quickly by the Catalog API backend service. You can use AWS SDKs with your programming language of choice or the AWS CLI. This gives your team flexibility to update pricing using the SDKs and CLI without using the AWS Management Console or filling out the PLF. Catalog API simplifies the pricing update process by enabling you to invoke only the relevant offer change type to modify prices. You can also save all of the offer prices locally and programmatically incorporate them into the Catalog API input parameters.

Solution walkthrough

Let’s walk through a sample scenario of how you would update the pricing for a single-AMI product using Catalog API. You can use this example as a building block to build out a solution that meets your product’s requirements. Let’s assume your developers update your product with improved features, and as a result you are required to update your AWS Marketplace listing prices. You want to increase the prices of supported instances from $0.12 to $0.15 per hour. For simplicity, your product supports one instance type. Now with Catalog API, we can achieve the same results as submitting the request through the AMMP but in a faster, automated approach. We will be using the sample Python code from the cloned GitHub repository to update the offer of a product to reflect the price increase.

Step 1: Sign in to your seller account where your product is listed. Find the product requiring a pricing update and copy the product ID.

Step 2: Call the ListEntities API with your product ID and retrieve the offer ID you want to update the price for.

The following snippet shows a sample API request payload that is passed to ListEntities. Providing product ID in the ValueList will generate a list of offer IDs for your product.

{
    "Catalog": "AWSMarketplace",
    "EntityType": "Offer",
    "MaxResults": 25,
    "EntityTypeFilters": {
        "OfferFilters": {
            "ProductID": {
                "ValueList": [
                    "prod-xxxxxxxx"
                ]
            }
        }
    }
}

Step 3: Visit the following sample code GitHub repository and clone the repository to your local machine via HTTPS, SSH, or by downloading the ZIP folder.

Step 4: From your command line prompt, change directories into the newly created folder and set up your environment following the README file.

Step 5: From your local cloned copy of the repository, navigate to the update_offer_with_hourly_annual_pricing example code.

{
    "catalog": "AWSMarketplace",
    "changeSet": [
        {
            "ChangeType": "UpdatePricingTerms",
            "Entity": {
                "Type": "Offer@1.0",
                "Identifier": "offer-111111111111"
            },
            "DetailsDocument": {
                "PricingModel": "Usage",
                "Terms": [
                    {
                        "Type": "UsageBasedPricingTerm",
                        "CurrencyCode": "USD",
                        "RateCards": [
                            {
                                "RateCard": [
                                    {
                                        "DimensionKey": "t2.micro",
                                        "Price": "0.15"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    ]
}

Note: To run the script, execute the start_changeset.py file. For updates, edit the “changeset.json” file.

Step 6: Edit the changeset.json file by modifying the value of the identifier key with the offer ID that you retrieved in step 2. Edit the DimensionKey field to reflect the instance type you have in your product. Set the Price to $0.15 to reflect the price increase within your IDE of choice. Save the changes made to the changeset.json file.

Note: If you’re updating the pricing of multiple instance types at a time, you will need a DimensionKey for each instance size and its corresponding price.

Step 7: From your command line, change the directory to the changeset.json file location where you made the changes. Run the Python script with the command:

python3 start_changeset.py

The following image shows a successful message from the command line.

Completed Changeset

Conclusion

In this post, we demonstrated how to use the new change type UpdatePricingTerms of Catalog API to update your AMI product’s pricing in AWS Marketplace. We explained the benefits that come with using Catalog API and best practices that you can share with your team.

We discussed three use cases and showed how to increase price for a product to demonstrate how Catalog API can help you streamline pricing updates.

For more information, read the AWS Marketplace Catalog API documentation and review the seller workshop on managing products and managing offers. Catalog API allows you and your organization to scale, which is a significant reason why you should integrate Catalog API for your product updates. We encourage you to take advantage of Catalog API to update pricing efficiently for your single-AMI products. This will improve your organization’s agility when implementing it in your DevOps processes and CI/CD workflows.

About Authors

Tuan Vo

Tuan Vo is a Marketplace Specialist Solutions Architect who focuses on supporting sellers to list their products on AWS Marketplace. He supports large enterprises and public sector customers. Outside of work, Tuan enjoys traveling, trying out new food, and going on walks.

Aniket Bulbule

Aniket Bulbule is a Partner Solutions Architect, helping partners scale and sell through for AWS Marketplace. He is passionate about Server-less computing and loves solving new problems.

Mohamed Mohamud

Mohamed Mohamud is a Partner Solutions Architect supporting ISV partners in developing technical expertise and capacity and collaborates with customers and partners on key engagements. With a passion for data analytics, Mohamed aims to become an SME in this field and utilizes data to solve problems.