

There are more AWS SDK examples available in the [AWS Doc SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples) GitHub repo.

# Code examples for AWS Marketplace Catalog API using AWS SDKs
<a name="marketplace-catalog_code_examples"></a>

The following code examples show you how to use AWS Marketplace Catalog API with an AWS software development kit (SDK).

**More resources**
+  **[AWS Marketplace Catalog API Seller Guide](https://docs.aws.amazon.com/marketplace/latest/userguide/what-is-marketplace.html)** – More information about AWS Marketplace Catalog API.
+ **[AWS Marketplace Catalog API API Reference](https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html)** – Details about all available AWS Marketplace Catalog API actions.
+ **[AWS Developer Center](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23)** – Code examples that you can filter by category or full-text search.
+ **[AWS SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples)** – GitHub repo with complete code in preferred languages. Includes instructions for setting up and running the code.

**Contents**
+ [AMI products](marketplace-catalog_code_examples_ami_products.md)
  + [Add a dimension to an existing AMI product and update the offer pricing terms](marketplace-catalog_example_marketplace-catalog_AddDimensionToAmiProductAndSetPriceInPublicOffer_section.md)
  + [Add a region where an AMI product is deployed](marketplace-catalog_example_marketplace-catalog_AddRegionExistingAmiProduct_section.md)
  + [Create a public or limited AMI product and a public offer with hourly annual pricing](marketplace-catalog_example_marketplace-catalog_CreateLimitedAmiProductAndPublicOfferWithHourlyAnnualPricing_section.md)
  + [Create a public or limited AMI product and public offer with hourly monthly pricing](marketplace-catalog_example_marketplace-catalog_CreateLimitedAmiProductAndPublicOfferWithHourlyMonthlyPricing_section.md)
  + [Create a public or limited AMI product and public offer with hourly pricing](marketplace-catalog_example_marketplace-catalog_CreateLimitedAmiProductAndPublicOfferWithHourlyPricing_section.md)
  + [Create an draft AMI product with a draft public offer](marketplace-catalog_example_marketplace-catalog_CreateDraftAmiProductWithDraftPublicOffer_section.md)
  + [Restrict a region where an AMI product is deployed](marketplace-catalog_example_marketplace-catalog_RestrictRegionExistingAmiProduct_section.md)
  + [Restrict product visibility](marketplace-catalog_example_marketplace-catalog_RestrictExistingAmi_section.md)
  + [Specify whether AMI assets are deployed in new regions](marketplace-catalog_example_marketplace-catalog_UpdateFutureRegionSupport_section.md)
+ [Channel partner offers](marketplace-catalog_code_examples_channel_partner_offers.md)
  + [Create a draft CPPO for any product type](marketplace-catalog_example_marketplace-catalog_CreateDraftCppoOffer_section.md)
  + [Create a resale authorization replacement private offer with contract pricing](marketplace-catalog_example_marketplace-catalog_CreateResaleAuthorizationReplacementOffer_section.md)
  + [List all CPPOs created by a channel partner](marketplace-catalog_example_marketplace-catalog_ListAllCppoOffers_section.md)
  + [List all shared resale authorizations available to a channel partner](marketplace-catalog_example_marketplace-catalog_ListAllSharedResaleAuthorizations_section.md)
  + [Publish a CPPO and append a buyer EULA](marketplace-catalog_example_marketplace-catalog_PublishCppoEula_section.md)
  + [Publish a CPPO using one-time resale authorization and update price markup](marketplace-catalog_example_marketplace-catalog_PublishOneTimeCppoWithPriceMarkup_section.md)
  + [Publish a draft CPPO and update price markup](marketplace-catalog_example_marketplace-catalog_PublishCppoPriceMarkup_section.md)
  + [Update the expiration date of a CPPO](marketplace-catalog_example_marketplace-catalog_UpdateCppoExpiryDate_section.md)
+ [Container products](marketplace-catalog_code_examples_container_products.md)
  + [Create a draft container product with a draft public offer](marketplace-catalog_example_marketplace-catalog_CreateDraftContainerProductWithDraftPublicOffer_section.md)
  + [Create a limited container product with a public offer and contract pricing](marketplace-catalog_example_marketplace-catalog_CreateLimitedContainerProductPublicOffer_section.md)
+ [Entities](marketplace-catalog_code_examples_entities.md)
  + [Describe all entities in a single call](marketplace-catalog_example_marketplace-catalog_BatchDescribeEntities_section.md)
  + [List and describe all offers associated with a product](marketplace-catalog_example_marketplace-catalog_ListProductOffers_section.md)
+ [Offers](marketplace-catalog_code_examples_offers.md)
  + [Create a custom dimension for a SaaS product and create a private offer](marketplace-catalog_example_marketplace-catalog_CreateSaasProductCustomDimensionAndPrivateOffer_section.md)
  + [Create a draft private offer for an AMI or SaaS product](marketplace-catalog_example_marketplace-catalog_CreateDraftPrivateOffer_section.md)
  + [Create a private offer with contract and Pay-As-You-Go pricing for a SaaS product](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithContractWithPayAsYouGoPricingForSaasProduct_section.md)
  + [Create a private offer with contract pricing and a flexible payment schedule for a SaaS product](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithContractPricingWithFlexiblePaymentScheduleForSaasProduct_section.md)
  + [Create a private offer with contract pricing for a Container product](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithContractPricingForContainerProduct_section.md)
  + [Create a private offer with contract pricing for an AMI product](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithContractPricingForAmiProduct_section.md)
  + [Create a private offer with hourly annual pricing and a flexible payment schedule for an AMI product](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithHourlyAnnualPricingAndFlexiblePaymentScheduleForAmiProduct_section.md)
  + [Create a private offer with hourly annual pricing for an AMI product](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithHourlyAnnualPricingForAmiProduct_section.md)
  + [Create a private offer with hourly pricing for an AMI product](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithHourlyPricingForAmiProduct_section.md)
  + [Create a private offer with subscription pricing for a SaaS product](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithSubscriptionPricingForSaasProduct_section.md)
  + [Create a private offer with tiered contract pricing for a SaaS product](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithTieredContractPricingForSaasProduct_section.md)
  + [Create a public free trial offer with subscription pricing for a SaaS product](marketplace-catalog_example_marketplace-catalog_CreatePublicFreeTrialOfferWithSubscriptionPricingForSaasProduct_section.md)
  + [Create a replacement private offer with contract pricing](marketplace-catalog_example_marketplace-catalog_CreateReplacementPrivateOfferWithContractPricing_section.md)
  + [Describe a public offer](marketplace-catalog_example_marketplace-catalog_DescribeOffer_section.md)
  + [Expire a draft private offer](marketplace-catalog_example_marketplace-catalog_ExpirePrivateOffer_section.md)
  + [List all private offers](marketplace-catalog_example_marketplace-catalog_ListAllPrivateOffers_section.md)
  + [List released public and private offers for a specific product ID](marketplace-catalog_example_marketplace-catalog_ListProductPublicOrPrivateReleasedOffers_section.md)
  + [Update an offer to apply a contract with Pay-As-You-Go pricing](marketplace-catalog_example_marketplace-catalog_UpdateOfferWithContractAndPayAsYouGoPricing_section.md)
  + [Update an offer to apply hourly annual pricing](marketplace-catalog_example_marketplace-catalog_UpdateOfferWithHourlyAnnualPricing_section.md)
  + [Update an offer to apply targeting to specific geographic regions](marketplace-catalog_example_marketplace-catalog_UpdateOfferTargeting_section.md)
  + [Update name and description of a public offer](marketplace-catalog_example_marketplace-catalog_UpdateOfferNameAndDescription_section.md)
  + [Update the EULA of an offer](marketplace-catalog_example_marketplace-catalog_UpdateEula_section.md)
  + [Update the expiration date of a private offer to a future date](marketplace-catalog_example_marketplace-catalog_UpdateOfferExpirationDateOfPrivateOffer_section.md)
  + [Update the free trial duration of a public free trial offer for a SaaS product](marketplace-catalog_example_marketplace-catalog_UpdateFreeTrialDurationOfPublicFreeTrialOfferForSaasProduct_section.md)
  + [Update the refund policy of an offer](marketplace-catalog_example_marketplace-catalog_UpdateRefundPolicy_section.md)
+ [Products](marketplace-catalog_code_examples_products.md)
  + [Describe an AMI, SaaS, or Container product](marketplace-catalog_example_marketplace-catalog_DescribeProduct_section.md)
  + [List all AMI, SaaS, or Container products and associated public offers](marketplace-catalog_example_marketplace-catalog_ListProducts_section.md)
+ [Resale authorization](marketplace-catalog_code_examples_resale_authorization.md)
  + [Create draft resale authorization](marketplace-catalog_example_marketplace-catalog_DraftResaleauthAllproducttype_section.md)
  + [Describe a resale authorization](marketplace-catalog_example_marketplace-catalog_DescribeResaleAuthorization_section.md)
  + [Publish a one-time resale authorization with a private offer](marketplace-catalog_example_marketplace-catalog_OnetimeResaleauthPrivateoffer_section.md)
  + [Publish multi-use resale authorization with an expiration date](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthExpirydateCppo_section.md)
  + [Publish multi-use resale authorization with an expiration date and a EULA](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthExpirydateCustomEula_section.md)
  + [Publish multi-use resale authorization with an expiration date and reseller contract documentation](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthExpirydateCustomresellerContractdoc_section.md)
  + [Publish multi-use resale authorization with expiration and add a specific buyer account](marketplace-catalog_example_marketplace-catalog_PublishMultiuseResaleAuthorizationExpirydateSpecificBuyer_section.md)
  + [Publish multi-use resale authorization without an expiration date](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthNoExpirydateCppo_section.md)
  + [Publish multi-use resale authorization without an expiration date and a EULA](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthNoExpirydateCustomEula_section.md)
  + [Publish multi-use resale authorization without an expiration date and reseller contract documentation](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthNoExpirydateCustomresellerContractdoc_section.md)
  + [Publish multi-use resale authorization without expiration and add a specific buyer account](marketplace-catalog_example_marketplace-catalog_PublishMultiuseResaleAuthorizationNoExpirydateSpecificBuyer_section.md)
  + [Publish one-time resale authorization and add Flexible payment schedule](marketplace-catalog_example_marketplace-catalog_PublishOnetimeResaleAuthorizationFlexiblePayment_section.md)
  + [Publish one-time resale authorization and add a EULA](marketplace-catalog_example_marketplace-catalog_OnetimeResaleauthCustomEula_section.md)
  + [Publish one-time resale authorization and add a specific buyer account](marketplace-catalog_example_marketplace-catalog_PublishOnetimeResaleAuthorizationSpecificBuyer_section.md)
  + [Publish one-time resale authorization and add reseller contract documentation](marketplace-catalog_example_marketplace-catalog_OnetimeResaleauthCustomresellerContractdoc_section.md)
  + [Publish one-time resale authorization and add whether it is a renewal](marketplace-catalog_example_marketplace-catalog_OnetimeResaleauthRenewal_section.md)
  + [Restrict resale authorization](marketplace-catalog_example_marketplace-catalog_RestrictResaleAuthorization_section.md)
  + [Update name and description of one-time or multi-use resale authorization](marketplace-catalog_example_marketplace-catalog_UpdateUnpublishedResaleAuthorization_section.md)
+ [SaaS products](marketplace-catalog_code_examples_saas_products.md)
  + [Create a draft SaaS product with a draft public offer](marketplace-catalog_example_marketplace-catalog_CreateDraftSaasProductWithDraftPublicOffer_section.md)
  + [Create a public or limited SaaS product and public offer with contract pricing](marketplace-catalog_example_marketplace-catalog_CreateLimitedSaasProductAndPublicOfferWithContractPricing_section.md)
  + [Create a public or limited SaaS product and public offer with contract with Pay-As-You-Go pricing](marketplace-catalog_example_marketplace-catalog_CreateLimitedSaasProductAndPublicOfferWithContractWithPayAsYouGoPricing_section.md)
  + [Create a public or limited SaaS product and public offer with subscription pricing](marketplace-catalog_example_marketplace-catalog_CreateLimitedSaasProductAndPublicOfferWithSubscriptionPricing_section.md)
  + [Publish a SaaS product and associated public offer](marketplace-catalog_example_marketplace-catalog_PublishSaasProductPublicOffer_section.md)
  + [Publish a SaaS product and associated public offer from an existing draft](marketplace-catalog_example_marketplace-catalog_PublishExistingSaas_section.md)
  + [Update dimensions on an AMI or SaaS product](marketplace-catalog_example_marketplace-catalog_UpdateNameDimensionSaasProduct_section.md)
+ [Utilities](marketplace-catalog_code_examples_utilities.md)
  + [Utilities to start a changeset](marketplace-catalog_example_marketplace-catalog_ChangeSetUtilities_section.md)