

AWS Marketplace API 参考已重组。有关支持的 API 操作的更多信息，请参阅 [AWS Marketplace API 参考](https://docs.aws.amazon.com/marketplace/latest/APIReference/Welcome.html)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 的代码示例 AWS Marketplace 使用 AWS 软件开发工具包
<a name="service_code_examples"></a>

以下代码示例说明如何 AWS Marketplace 使用 AWS 软件开发套件 (SDK)。

有关 S AWS DK 开发者指南和代码示例的完整列表，请参阅[将此服务与 AWS SDK](sdk-general-information-section.md)。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。

**Contents**
+ [AWS Marketplace 目录 API](service_code_examples_marketplace-catalog.md)
  + [AMI 产品](service_code_examples_marketplace-catalog_ami_products.md)
    + [向现有 AMI 产品添加维度并更新优惠定价条款](marketplace-catalog_example_marketplace-catalog_AddDimensionToAmiProductAndSetPriceInPublicOffer_section.md)
    + [添加部署 AMI 产品的区域](marketplace-catalog_example_marketplace-catalog_AddRegionExistingAmiProduct_section.md)
    + [创建公开或受限 AMI 产品和按小时按年定价的公开优惠](marketplace-catalog_example_marketplace-catalog_CreateLimitedAmiProductAndPublicOfferWithHourlyAnnualPricing_section.md)
    + [创建公开或受限 AMI 产品和按小时按月定价的公开优惠](marketplace-catalog_example_marketplace-catalog_CreateLimitedAmiProductAndPublicOfferWithHourlyMonthlyPricing_section.md)
    + [创建公开或受限 AMI 产品和按小时定价的公开优惠](marketplace-catalog_example_marketplace-catalog_CreateLimitedAmiProductAndPublicOfferWithHourlyPricing_section.md)
    + [创建采用公开优惠草稿的 AMI 产品草稿](marketplace-catalog_example_marketplace-catalog_CreateDraftAmiProductWithDraftPublicOffer_section.md)
    + [限制部署 AMI 产品的区域](marketplace-catalog_example_marketplace-catalog_RestrictRegionExistingAmiProduct_section.md)
    + [限制产品可见性](marketplace-catalog_example_marketplace-catalog_RestrictExistingAmi_section.md)
    + [指定是否在新区域中部署 AMI 资产](marketplace-catalog_example_marketplace-catalog_UpdateFutureRegionSupport_section.md)
  + [渠道合作伙伴优惠](service_code_examples_marketplace-catalog_channel_partner_offers.md)
    + [为任何产品类型创建 CPPO 草稿](marketplace-catalog_example_marketplace-catalog_CreateDraftCppoOffer_section.md)
    + [创建采用合同定价的转售授权替代专属优惠](marketplace-catalog_example_marketplace-catalog_CreateResaleAuthorizationReplacementOffer_section.md)
    + [列出渠道合作伙伴创建的所有 CPPO](marketplace-catalog_example_marketplace-catalog_ListAllCppoOffers_section.md)
    + [列出渠道合作伙伴可获得的所有共享转售授权](marketplace-catalog_example_marketplace-catalog_ListAllSharedResaleAuthorizations_section.md)
    + [发布 CPPO 并附加买家 EULA](marketplace-catalog_example_marketplace-catalog_PublishCppoEula_section.md)
    + [使用一次性转售授权发布 CPPO 并更新价格加成](marketplace-catalog_example_marketplace-catalog_PublishOneTimeCppoWithPriceMarkup_section.md)
    + [发布 CPPO 草稿并更新价格加成](marketplace-catalog_example_marketplace-catalog_PublishCppoPriceMarkup_section.md)
    + [更新 CPPO 的到期日期](marketplace-catalog_example_marketplace-catalog_UpdateCppoExpiryDate_section.md)
  + [容器产品](service_code_examples_marketplace-catalog_container_products.md)
    + [创建采用公开优惠草稿的容器产品草稿](marketplace-catalog_example_marketplace-catalog_CreateDraftContainerProductWithDraftPublicOffer_section.md)
    + [创建采用公开优惠和合同定价的受限容器产品](marketplace-catalog_example_marketplace-catalog_CreateLimitedContainerProductPublicOffer_section.md)
  + [实体](service_code_examples_marketplace-catalog_entities.md)
    + [在单次调用中描述所有实体](marketplace-catalog_example_marketplace-catalog_BatchDescribeEntities_section.md)
    + [列出并描述与产品关联的所有优惠](marketplace-catalog_example_marketplace-catalog_ListProductOffers_section.md)
  + [优惠](service_code_examples_marketplace-catalog_offers.md)
    + [为 SaaS 产品创建自定义维度并创建专属优惠](marketplace-catalog_example_marketplace-catalog_CreateSaasProductCustomDimensionAndPrivateOffer_section.md)
    + [为 AMI 或 SaaS 产品创建专属优惠草稿](marketplace-catalog_example_marketplace-catalog_CreateDraftPrivateOffer_section.md)
    + [为 SaaS 产品创建包含合同和 Pay-As-You-Go 定价的私人报价](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithContractWithPayAsYouGoPricingForSaasProduct_section.md)
    + [为 SaaS 产品创建采用合同定价和灵活付款时间表的专属优惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithContractPricingWithFlexiblePaymentScheduleForSaasProduct_section.md)
    + [为容器产品创建采用合同定价的专属优惠。](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithContractPricingForContainerProduct_section.md)
    + [为 AMI 产品创建采用合同定价的专属优惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithContractPricingForAmiProduct_section.md)
    + [为 AMI 产品创建采用按小时按年定价和灵活付款时间表的专属优惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithHourlyAnnualPricingAndFlexiblePaymentScheduleForAmiProduct_section.md)
    + [为 AMI 产品创建采用按小时按年定价的专属优惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithHourlyAnnualPricingForAmiProduct_section.md)
    + [为 AMI 产品创建采用按小时定价的专属优惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithHourlyPricingForAmiProduct_section.md)
    + [为 SaaS 产品创建采用订阅定价的专属优惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithSubscriptionPricingForSaasProduct_section.md)
    + [为 SaaS 产品创建采用分级合同定价的专属优惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithTieredContractPricingForSaasProduct_section.md)
    + [为 SaaS 产品创建采用订阅定价的公开免费试用优惠](marketplace-catalog_example_marketplace-catalog_CreatePublicFreeTrialOfferWithSubscriptionPricingForSaasProduct_section.md)
    + [创建采用合同定价的替代专属优惠](marketplace-catalog_example_marketplace-catalog_CreateReplacementPrivateOfferWithContractPricing_section.md)
    + [描述公开优惠](marketplace-catalog_example_marketplace-catalog_DescribeOffer_section.md)
    + [使专属优惠草稿过期](marketplace-catalog_example_marketplace-catalog_ExpirePrivateOffer_section.md)
    + [列出所有专属优惠](marketplace-catalog_example_marketplace-catalog_ListAllPrivateOffers_section.md)
    + [列出针对特定产品 ID 发布的公开优惠和专属优惠](marketplace-catalog_example_marketplace-catalog_ListProductPublicOrPrivateReleasedOffers_section.md)
    + [更新报价以应用带 Pay-As-You-Go 定价的合同](marketplace-catalog_example_marketplace-catalog_UpdateOfferWithContractAndPayAsYouGoPricing_section.md)
    + [更新优惠以应用按小时按年定价](marketplace-catalog_example_marketplace-catalog_UpdateOfferWithHourlyAnnualPricing_section.md)
    + [更新优惠以将目标应用于特定地理区域](marketplace-catalog_example_marketplace-catalog_UpdateOfferTargeting_section.md)
    + [更新公开优惠的名称和描述](marketplace-catalog_example_marketplace-catalog_UpdateOfferNameAndDescription_section.md)
    + [更新优惠的 EULA](marketplace-catalog_example_marketplace-catalog_UpdateEula_section.md)
    + [将专属优惠的到期日期更新为将来的日期](marketplace-catalog_example_marketplace-catalog_UpdateOfferExpirationDateOfPrivateOffer_section.md)
    + [更新 SaaS 产品的公开免费试用优惠的免费试用期限](marketplace-catalog_example_marketplace-catalog_UpdateFreeTrialDurationOfPublicFreeTrialOfferForSaasProduct_section.md)
    + [更新优惠的退款政策](marketplace-catalog_example_marketplace-catalog_UpdateRefundPolicy_section.md)
  + [产品](service_code_examples_marketplace-catalog_products.md)
    + [描述 AMI、SaaS 或容器产品](marketplace-catalog_example_marketplace-catalog_DescribeProduct_section.md)
    + [列出所有 AMI、SaaS 或容器产品以及关联的公开优惠](marketplace-catalog_example_marketplace-catalog_ListProducts_section.md)
  + [转售授权](service_code_examples_marketplace-catalog_resale_authorization.md)
    + [创建转售授权草稿](marketplace-catalog_example_marketplace-catalog_DraftResaleauthAllproducttype_section.md)
    + [描述转售授权](marketplace-catalog_example_marketplace-catalog_DescribeResaleAuthorization_section.md)
    + [发布采用专属优惠的一次性转售授权](marketplace-catalog_example_marketplace-catalog_OnetimeResaleauthPrivateoffer_section.md)
    + [发布带到期日期的多次使用转售授权](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthExpirydateCppo_section.md)
    + [发布带到期日期的多次使用转售授权和 EULA](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthExpirydateCustomEula_section.md)
    + [发布带到期日期的多次使用转售授权和经销商合同文档](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthExpirydateCustomresellerContractdoc_section.md)
    + [发布带到期日期的多次使用转售授权，并添加特定的买家账户](marketplace-catalog_example_marketplace-catalog_PublishMultiuseResaleAuthorizationExpirydateSpecificBuyer_section.md)
    + [发布无到期日期的多次使用转售授权](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthNoExpirydateCppo_section.md)
    + [发布无到期日期的多次使用转售授权和 EULA](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthNoExpirydateCustomEula_section.md)
    + [发布无到期日期的多次使用转售授权和经销商合同文档](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthNoExpirydateCustomresellerContractdoc_section.md)
    + [发布无到期日期的多次使用转售授权，并添加特定的买家账户](marketplace-catalog_example_marketplace-catalog_PublishMultiuseResaleAuthorizationNoExpirydateSpecificBuyer_section.md)
    + [发布一次性转售授权并添加灵活的付款时间表](marketplace-catalog_example_marketplace-catalog_PublishOnetimeResaleAuthorizationFlexiblePayment_section.md)
    + [发布一次性转售授权并添加 EULA](marketplace-catalog_example_marketplace-catalog_OnetimeResaleauthCustomEula_section.md)
    + [发布一次性转售授权并添加特定的买家账户](marketplace-catalog_example_marketplace-catalog_PublishOnetimeResaleAuthorizationSpecificBuyer_section.md)
    + [发布一次性转售授权并添加经销商合同文档](marketplace-catalog_example_marketplace-catalog_OnetimeResaleauthCustomresellerContractdoc_section.md)
    + [发布一次性转售授权并添加它是否为续订](marketplace-catalog_example_marketplace-catalog_OnetimeResaleauthRenewal_section.md)
    + [限制转售授权](marketplace-catalog_example_marketplace-catalog_RestrictResaleAuthorization_section.md)
    + [更新一次性或多次使用转售授权的名称和描述](marketplace-catalog_example_marketplace-catalog_UpdateUnpublishedResaleAuthorization_section.md)
  + [SaaS 产品](service_code_examples_marketplace-catalog_saas_products.md)
    + [创建采用公开优惠草稿的 SaaS 产品草稿](marketplace-catalog_example_marketplace-catalog_CreateDraftSaasProductWithDraftPublicOffer_section.md)
    + [创建公开或受限 SaaS 产品和按合同定价的公开优惠](marketplace-catalog_example_marketplace-catalog_CreateLimitedSaasProductAndPublicOfferWithContractPricing_section.md)
    + [创建具有定价合同的公开或有限的 SaaS 产品和公开报 Pay-As-You-Go 价](marketplace-catalog_example_marketplace-catalog_CreateLimitedSaasProductAndPublicOfferWithContractWithPayAsYouGoPricing_section.md)
    + [创建公开或受限 SaaS 产品和采用订阅定价的公开优惠](marketplace-catalog_example_marketplace-catalog_CreateLimitedSaasProductAndPublicOfferWithSubscriptionPricing_section.md)
    + [发布 SaaS 产品和关联的公开优惠](marketplace-catalog_example_marketplace-catalog_PublishSaasProductPublicOffer_section.md)
    + [根据现有草稿发布 SaaS 产品和关联的公开优惠](marketplace-catalog_example_marketplace-catalog_PublishExistingSaas_section.md)
    + [更新 AMI 或 SaaS 产品的维度](marketplace-catalog_example_marketplace-catalog_UpdateNameDimensionSaasProduct_section.md)
  + [公用事业机构](service_code_examples_marketplace-catalog_utilities.md)
    + [用于启动更改集的实用程序](marketplace-catalog_example_marketplace-catalog_ChangeSetUtilities_section.md)
+ [AWS Marketplace 协议 API](service_code_examples_marketplace-agreement.md)
  + [协议](service_code_examples_marketplace-agreement_agreements.md)
    + [获取所有协议 ID](marketplace-agreement_example_marketplace-agreement_GetAllAgreementsIds_section.md)
    + [获取所有协议](marketplace-agreement_example_marketplace-agreement_GetAllAgreements_section.md)
    + [从协议中获取客户 ID](marketplace-agreement_example_marketplace-agreement_GetAgreementCustomer_section.md)
    + [从协议中获取财务详细信息](marketplace-agreement_example_marketplace-agreement_GetAgreementFinancialDetails_section.md)
    + [从协议中获取免费试用详细信息](marketplace-agreement_example_marketplace-agreement_GetAgreementTermsFreeTrialDetails_section.md)
    + [获取有关协议的信息](marketplace-agreement_example_marketplace-agreement_DescribeAgreement_section.md)
    + [从协议中获取产品和优惠详细信息](marketplace-agreement_example_marketplace-agreement_GetProductAndOfferDetailFromAgreement_section.md)
    + [获取协议的 EULA](marketplace-agreement_example_marketplace-agreement_GetAgreementTermsEula_section.md)
    + [获取协议的自动续订条款](marketplace-agreement_example_marketplace-agreement_GetAgreementAutoRenewal_section.md)
    + [获取在协议中购买的维度](marketplace-agreement_example_marketplace-agreement_GetAgreementTermsDimensionPurchased_section.md)
    + [获取在协议中购买的每个维度的实例](marketplace-agreement_example_marketplace-agreement_GetAgreementTermsDimensionInstances_section.md)
    + [获取协议的付款时间表](marketplace-agreement_example_marketplace-agreement_GetAgreementTermsPaymentSchedule_section.md)
    + [获取协议中每个维度的定价](marketplace-agreement_example_marketplace-agreement_GetAgreementTermsPricingEachDimension_section.md)
    + [获取协议的定价类型](marketplace-agreement_example_marketplace-agreement_GetAgreementPricingType_section.md)
    + [获取协议的产品类型](marketplace-agreement_example_marketplace-agreement_GetAgreementProductType_section.md)
    + [获取协议的状态](marketplace-agreement_example_marketplace-agreement_GetAgreementStatus_section.md)
    + [获取协议的支持条款](marketplace-agreement_example_marketplace-agreement_GetAgreementTermsSupportTerm_section.md)
    + [获取协议的条款](marketplace-agreement_example_marketplace-agreement_GetAgreementTerms_section.md)
    + [按账户 ID 搜索协议](marketplace-agreement_example_marketplace-agreement_SearchAgreementsByAccountId_section.md)
    + [按协议 ID 搜索协议](marketplace-agreement_example_marketplace-agreement_SearchAgreementsById_section.md)
    + [按结束日期搜索协议](marketplace-agreement_example_marketplace-agreement_SearchAgreementsByEndDate_section.md)
    + [按优惠 ID 搜索协议](marketplace-agreement_example_marketplace-agreement_SearchAgreementsByOfferId_section.md)
    + [按产品 ID 搜索协议](marketplace-agreement_example_marketplace-agreement_SearchAgreementsByProductId_section.md)
    + [按状态搜索协议](marketplace-agreement_example_marketplace-agreement_SearchAgreementsByByStatus_section.md)
    + [通过一个自定义筛选条件来搜索协议](marketplace-agreement_example_marketplace-agreement_SearchAgreementsByOneFilter_section.md)
    + [通过两个自定义筛选条件来搜索协议](marketplace-agreement_example_marketplace-agreement_SearchAgreementsByTwoFilters_section.md)