.NET SDK 发行说明

以下发行说明适用于新版本的 Microsoft 合作伙伴中心 .NET SDK。 可以在 GitHub 上查找 .NET SDK 示例 。 可以在 . NET API 浏览器中找到合作伙伴中心 .NET API 参考

版本 3.1.1

重要

版本 3.1.0 已弃用。 请勿下载 .NET SDK v.3.1.0

Microsoft 合作伙伴中心 .NET SDK v3.1.1 现已正式发布。 还提供了已更新的 GitHub 示例。 此版本中包含以下更改:

交易和管理

公共合同中的新字段

将促销 ID 添加到计划的更改
管理新商务订阅的计划更改

  • Patch {baseURL}/v1/customers/{customer-tenant-id}/subscriptions/{subscription-id}

对订阅状态值“disabled”的新 SDK 支持。

合作伙伴中心 API 将在从 v3.1.1 SDK 版本 90 天后开始返回新的“已禁用”状态。 合作伙伴在 API 返回“已禁用”状态前有 90 天的时间更新其 SDK 并遵守变更管理原则。

新 API 更新

查询迁移的订阅 是一个 API,合作伙伴可在其中查询所有已迁移的子项,以获取给定的输入条件。

  • GET {baseURL}/v1/migrations/newcommerce

获取新商务迁移事件 API 用于根据当前订阅 ID 或迁移 ID 提取迁移事件的详细信息。

  • GET {baseURL}/v1/customers/{customer-tenant-id}/migrations/newcommerce/events

版本 3.0.1

Microsoft 合作伙伴中心 .NET SDK v3.0.1 现已正式发布。 还提供了已更新的 GitHub 示例。 此版本中包含以下更改:

交易和管理

公共合同中的新字段

  • POST {baseURL}/v1/customers/{customer_id}/subscriptions/{subscription_id}/transition
  • GET {baseUrl}/v1/customers/{customer_id}/subscriptions/{subscription_id}/transitions
  • GET/PATCH {baseUrl}/v1/customers/{customer_id}/subscriptions/{subscription_id}
    • Subscription模型添加了RefundableQuantity属性
    • ScheduledNextTermInstructions模型添加了CustomTermEndDate属性
    • Subscription模型添加了MigratedFromSubscriptionId属性
  • POST {baseUrl}/v1/customers/{customer_tenant_id}/migrations/newcommerce/validate
    • NewCommerceMigration模型添加了AddOnMigrations属性
  • POST {baseUrl}/v1/customers/{customer_tenant_id}/migrations/newcommerce
    • NewCommerceMigration模型添加了AddOnMigrations属性
  • GET {baseUrl}/v1/customers/{customer_tenant_id}/migrations/newcommerce/{migration_id}
    • NewCommerceMigration模型添加了AddOnMigrations属性
  • POST {baseURL}/v1/customers/{customer_id}/carts
    • 添加了新的 CartErrorCode 枚举值
    • CartError模型添加了新AdditionalInformation模型
    • CartLineItem模型添加了CustomTermEndDate属性
  • GET/PUT {baseURL}/v1/customers/{customer_id}/carts/{cart_id}
    • 添加了新的 CartErrorCode 枚举值
    • CartError模型添加了新AdditionalInformation模型
    • CartLineItem模型添加了CustomTermEndDate属性
  • GET/POST {baseURL}/v1/customers/{customer_id}/orders
    • OrderLineItem模型添加了CustomTermEndDate属性
  • GET/PATCH {baseURL}/v1/customers/{customer_id}/orders/{order_id}
    • OrderLineItem模型添加了CustomTermEndDate属性

NCE 批处理迁移工具

为了方便合作伙伴高效迁移大量订阅的需求,我们启用了 Batch 迁移 (BAM) 工具。 BAM 工具允许合作伙伴使用以下方法将订阅迁移到 NCE:

  • 简化开放源代码 .NET SDK 示例应用体验
  • 使用 Excel 管理迁移编辑
  • 支持批量高质量、可重复和可自定义迁移方案的简单工具

可在此处找到有关使用 该工具的详细说明。

安全性

新的 API

  • 修补 {baseURL}/v1/customers/{customer-tenant-id}
    • 删除 DAP API – 将 DAP set AllowDelegatedAccess 属性删除为 false

审核和 Webhook

审核更新 - 为“管理超额”、“DAP 管理员 Microsoft 终止的关系”和“检测到 Azure 欺诈事件”添加了新的操作类型。

审核资源

版本 3.0.0

Microsoft 合作伙伴中心 .NET SDK v3.0.0 现已正式发布。 还提供了已更新的 GitHub 示例。 此版本中包含以下更改:

常见更新

将 System.ComponentModel.Annotations 升级到最新的 5.0 版本,以解决现有的兼容性问题。

交易和管理

新的 API

  • POST {baseUrl}/v1/customers/{customer_tenant_id}/migrations/newcommerce/validate
  • POST {baseUrl}/v1/customers/{customer_tenant_id}/migrations/newcommerce
  • GET {baseUrl}/v1/customers/{customer_tenant_id}/migrations/newcommerce/{migration-id}
  • GET {baseURL}/customers/{customerId}/subscriptions/overage

公共合同中的新字段

  • PATCH {baseURL}/v1/customers/{customer_id}/subscriptions/{subscription_id}
  • POST {baseURL}/v1/customers/{customer_id}/subscriptions/{subscription_id}/transition
  • GET {baseUrl}/v1/customers/{customer_id}/subscriptions/{subscription_id}/transitions
  • POST/PUT {baseURL}/v1/customers/{customer-tenant-id}/cart
  • POST {baseURL}/v1/customers/{customer-tenant-id}/orders
  • PUT {baseURL}/v1/customers/{customer-id}/carts/{cart-id}

Catalog/Price/Promotion

新建 API

  • POST {baseURL}/v1/customers/{customerId}/promotionEligibilities
  • GET {baseURL}/v1/productpromotions/{promotion-id}?country={country-code}
  • GET {baseURL}/v1/productpromotions?country={country-code}&segment={segment}

公共合同中的新字段

  • GET {baseURL}/v1/offers/{offer-id}?country={country-code}
  • GET {baseURL}/v1/products/{product-id}/skus?country={country-code}&targetSegment={target-segment}
  • GET {baseURL}/v1/products/{product-id}/skus/{sku-id}?country={country-code}
  • GET {baseURL}/v1/products?country={country}&targetView={targetView}&targetSegment={targetSegment}
  • POST {baseURL}/v1/customers/{customer-tenant-id}/products?targetView={targetView}
  • GET {baseURL}/v1/products/{product-id}?country={country}
  • POST {baseURL}/v1/customers/{customer-tenant-id}/products/{product-id}/skus
  • GET {baseURL}/v1/products/{product-id}/skus?country={country-code}&targetSegment={target-segment}
  • GET {baseURL}/v1/products/{product-id}/skus/{sku-id}?country={country-code}
  • GET {baseURL}/v1/products/{product-id}/skus/{sku-id}/availabilities?country={country-code}&targetSegment={target-segment}
  • POST {baseURL}/v1/customers/{customer-tenant-id}/products/{product-id}/skus/{sku-id}
  • GET {baseURL}/v1/products/{product-id}/skus/{sku-id}/availabilities/{availability-id}?country={country-code}

客户

新建 API

  • GET {baseURL}/v1/customers/{customer-id}/validationStatus?type=account

审核和 Webhook

审核已更新 - 为“添加 SoftwareAttestation”和“添加设备和策略”添加了新的操作类型更新

审核资源 - 合作伙伴中心应用开发者 | Microsoft Docs

  • GET {baseURL}/v1/products/{product-id}/skus?country={country-code}&targetSegment={target-segment}
  • GET {baseURL}/v1/products/{product-id}/skus/{sku-id}?country={country-code}
  • GET {baseURL}/v1/products?country={country}&targetView={targetView}&targetSegment={targetSegment}
  • POST {baseURL}/v1/customers/{customer-tenant-id}/products?targetView={targetView}
  • GET {baseURL}/v1/products/{product-id}?country={country}
  • POST {baseURL}/v1/customers/{customer-tenant-id}/products/{product-id}/skus
  • GET {baseURL}/v1/products/{product-id}/skus?country={country-code}&targetSegment={target-segment}
  • GET {baseURL}/v1/products/{product-id}/skus/{sku-id}?country={country-code}
  • GET {baseURL}/v1/products/{product-id}/skus/{sku-id}/availabilities?country={country-code}&targetSegment={target-segment}
  • POST {baseURL}/v1/customers/{customer-tenant-id}/products/{product-id}/skus/{sku-id}
  • GET {baseURL}/v1/products/{product-id}/skus/{sku-id}/availabilities/{availability-id}?country={country-code}
  • PUT {baseURL}/customers/{customerId}/subscriptions/overage
  • GET {baseURL}/customers/{customerId}/subscriptions/overage

版本 2.0.1

Microsoft 合作伙伴中心 .NET SDK v2.0.1 现已正式发布。 还提供了已更新的 GitHub 示例。 此版本中包含以下更改:

注意

作为新商务体验的一部分引入的一些更改 (“NCE”) ,这些更改目前仅根据邀请提供给属于 M365/D365 新商务体验技术预览版的合作伙伴。 不属于新商业个人预览版的合作伙伴不应注意到影响,并且应向后兼容。

通用

  • 更改对身份验证库的引用 - 引用从 Azure Active Directory 身份验证库 (ADAL) 更改为 Microsoft 身份验证库 (MSAL)

    应进行以下更改,以确保 MSAL 在应用程序或 .NET 示例中正确运行:

    • 添加 https://login.microsoftonline.com/common/oauth2/nativeclient 为 Mobile 和桌面应用程序的 RedirectUrl

    • 添加到应用程序配置文件中的 UserAuthentication 部分。

      域是创建 Azure AD 应用程序的 Azure Active Directory 域或租户 ID

  • 错误代码 - 添加了新错误代码

    • 408:请求超时
    • 504:网关超时

管理账单

  • 发票行项 - 添加到以下 API 的新属性:

    • GET /invoices/{invoice-id}/lineitems?provider={provider}&invoicelineitemtype=billinglineitems
    • GET /invoices/unbilled/lineitems?provider=onetime&invoicelineitemtype=billinglineitems

    新属性:

    • productQualifiers
    • subscriptionStartDate
    • subscriptionEndDate
    • referenceId
    • creditReasonCode (仅适用于 NCE)
    • promotionId
  • 每日分级使用情况行项 – 添加到以下 API 的新属性:

    • GET /invoices/{invoice-id}/lineitems?provider=onetime&invoicelineitemtype=usagelineitems

    新属性:

    • hasPartnerEarnedCredit (仅适用于 NCE)
    • creditType (仅适用于 NCE)
    • rateOfCredit (仅适用于 NCE)

管理订单

  • 订阅资源 - 添加了新属性。

    • CancellationAllowedUntilDate - (仅适用于 NCE)
  • 转换资源 (仅适用于 NCE) – 添加了新属性

    • FromSubscriptionId

管理客户帐户

  • 验证地址 – 响应已从布尔值更改为 API 的新模型:

    • POST /validations/address

    新的响应模型:

    • AddressValidationResponse
  • 客户资格同步 API 已弃用。

版本 1.17.0

Microsoft 合作伙伴中心 .NET SDK v1.17.0 现已正式发布。 还提供了已更新的 GitHub 示例。 此版本中包含以下更改:

  • 审核更新 - 添加了新的操作类型,用于了解客户何时批准和终止 DAP

  • 审核更新 - 添加了用于支持客户目录角色方案的新资源和操作类型

  • SDK 更新客户帐户 - 支持以下 API

    • GET /customers/{customer-tenant-id}/directSignedMicrosoftCustomerAgreementStatus
    • GET /customers/{customer-tenant-id}/qualifications
    • POST /customers/{customer_id}/qualifications?code={validationCode}
  • 根据新商务的一部分引入的更改,这些更改目前仅根据邀请提供给属于 M365/D365 新商务体验技术预览版的合作伙伴。 不属于新商业个人预览版的合作伙伴不应注意到影响,并且应该向后兼容。

    • 目录更改:
      • GET /products/{product-id}/skus/{sku-id}
    • 购买和管理:
      • GET /customers/{customerId}/subscriptions
      • GET /customers/{customerId}/subscriptions/{subscriptionId}
      • PATCH /customers/{customerId}/subscriptions/{subscriptionId}
      • GET /customers/{customerId}/subscriptions/{subscriptionId}/transitioneligibilities
      • GET /customers/{customerId}/subscriptions/{subscriptionId}/transitions
      • POST /customers/{customerId}/subscriptions/{subscriptionId}/transitions

版本 1.16.3

Microsoft 合作伙伴中心 .NET SDK v1.16.3 现已正式发布。 还提供了已更新的 GitHub 示例。 此版本中包含以下更改:

版本 1.16.2

Microsoft 合作伙伴中心 .NET SDK v1.16.2 现已正式发布。 还提供了已更新的 GitHub 示例。 此版本中包含以下更改:

  • 更新了审核记录支持的操作类型。 新添加的值为:

    • CreateSelfServePolicy
    • UpdateSelfServePolicy
    • DeleteSelfServePolicy
    • RemovePartnerRelationship
    • DeleteTipCustomer
    • CreateRelatedReferral
    • UpdateRelatedReferral
  • 现已弃用服务请求创建功能

  • 现已弃用支持主题

版本 1.16.1

Microsoft 合作伙伴中心 .NET SDK v1.16.1 现已正式发布。 还提供了已更新的 GitHub 示例。 此版本中包含以下更改:

我们已将现有的 Microsoft 合作伙伴中心 SDK 从 .NET Framework 迁移到 .NET Standard 2.0 平台。 这将使 SDK 与使用 .NET Framework 4.6.1 及更高版本的现有应用程序兼容。 SDK 将支持 .NET Core 2.0 及更高版本。 在将其移植到现有应用程序之前,请检查 .NET 实现支持

版本 1.15.3

Microsoft 合作伙伴中心 .NET SDK v1.15.3 现已正式发布。 还可以使用更新的 REST API 和 GitHub 示例 。 此版本中包含以下更改:

  • 合作伙伴协议
  • 产品
    • 以下两个接口错误地放置在 Microsoft.Store.PartnerCenter.Products 命名空间下。 现在,它们位于 Microsoft.Store.PartnerCenter.Customers.Products 命名空间下。
      • ICustomerProductByReservationScope
      • ICustomerSkuByReservationScope