

AWS Marketplace API 參考已重組。如需支援的 API 操作的詳細資訊，請參閱 [AWS Marketplace API 參考](https://docs.aws.amazon.com/marketplace/latest/APIReference/Welcome.html)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# AWS Marketplace 使用 AWS SDKs程式碼範例
<a name="service_code_examples"></a>

下列程式碼範例示範如何使用 AWS Marketplace 搭配 AWS 軟體開發套件 (SDK)。

如需 AWS SDK 開發人員指南和程式碼範例的完整清單，請參閱 [搭配 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)
  + [Offers](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 產品建立具有合約和依用量計費定價的私有優惠](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)
    + [更新優惠以套用具有隨需依用量計費定價的合約](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 產品和公有優惠](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)