间接经销商的合作伙伴API [英] Partner API for Indirect Reseller

查看:66
本文介绍了间接经销商的合作伙伴API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我们目前是间接经销商,希望为我们的客户提供购买许可证的门户网站。似乎要提供此功能(为了能够自动分配许可证),我们需要访问合作伙伴API,该API只能通过直接转销商获得


在这种情况下,有哪些选择?


此外,我们有兴趣成为直接经销商,但我们的印象是门户网站实际上是成为一个门户网站的要求,如何在没有提前访问相关API的情况下提供这种方式?


非常感谢,


Thomas

解决方案

嗨托马斯,


要通过间接经销商为客户下订单,请从github查看以下代码。

 var partnerOperations = this.Context.UserPartnerOperations; 

string customerId = this.ObtainCustomerId("输入进行购买的客户的ID);
string offerId = this.ObtainOfferId("输入要购买的要约的ID");
string indirectResellerId = this.ObtainIndirectResellerId("输入间接经销商的ID:");

this.Context.ConsoleHelper.StartProgress("获取间接经销商列表");
var indirectResellers = partnerOperations.Relationships.Get(PartnerRelationshipType.IsIndirectCloudSolutionProviderOf);
this.Context.ConsoleHelper.StopProgress();

var selectedIndirectReseller =(indirectResellers!= null&& indirectResellers.Items.Any())?
indirectResellers.Items.FirstOrDefault(reseller => reseller.Id.Equals(indirectResellerId,StringComparison.OrdinalIgnoreCase)):
null;

var order = new Order()
{
ReferenceCustomerId = customerId,
LineItems = new List< OrderLineItem>()
{
new OrderLineItem()
{
OfferId = offerId,
FriendlyName =" new offer purchase",
Quantity = 5,
PartnerIdOnRecord = selectedIndirectReseller!= null? selectedIndirectReseller.MpnId:null
}
}
};

this.Context.ConsoleHelper.WriteObject(order,"Order to be placed");
this.Context.ConsoleHelper.StartProgress(" Placing order");

var createdOrder = partnerOperations.Customers.ById(customerId).Orders.Create(order);

this.Context.ConsoleHelper.StopProgress();
this.Context.ConsoleHelper.WriteObject(createdOrder," Created order");

源代码:  https://github.com/Microsoft/Partner-Center-DotNet-Samples/blob/master/ sdk / SdkSamples / IndirectModel / PlaceOrderForCustomer.cs


更多信息:


https://docs.microsoft.com/en-us/partner-center/indirect-provider-tasks-in-合作伙伴中心


最好的问候,


Dennis



Hi,

We are currently an indirect reseller that would like to offer a portal for purchasing licenses to our customers. It seems that to provide this (to be able to automate the assigning of licenses) we would require access to the Partner API which is only accessible to direct resellers.

With this being the case, what options are available?

Additionally, we are interested in progressing towards becoming a direct reseller, but we're under the impression that a portal is effectively a requirement of becoming one, how is this possible to provide without having access to the relevant APIs in advance?

Many thanks,

Thomas

解决方案

Hi Thomas,

To place order for a customer with an indirect reseller, please check the code below from github.

var partnerOperations = this.Context.UserPartnerOperations;

string customerId = this.ObtainCustomerId("Enter the ID of the customer making the purchase");
string offerId = this.ObtainOfferId("Enter the ID of the offer to purchase");
string indirectResellerId = this.ObtainIndirectResellerId("Enter the ID of the indirect reseller: ");

this.Context.ConsoleHelper.StartProgress("Getting list of indirect resellers");
var indirectResellers = partnerOperations.Relationships.Get(PartnerRelationshipType.IsIndirectCloudSolutionProviderOf);
this.Context.ConsoleHelper.StopProgress();

var selectedIndirectReseller = (indirectResellers != null && indirectResellers.Items.Any()) ?
	indirectResellers.Items.FirstOrDefault(reseller => reseller.Id.Equals(indirectResellerId, StringComparison.OrdinalIgnoreCase)) :
	null;

var order = new Order()
{
	ReferenceCustomerId = customerId,
	LineItems = new List<OrderLineItem>()
	{
		new OrderLineItem()
		{
			OfferId = offerId,
			FriendlyName = "new offer purchase",
			Quantity = 5,
			PartnerIdOnRecord = selectedIndirectReseller != null ? selectedIndirectReseller.MpnId : null
		}
	}
};

this.Context.ConsoleHelper.WriteObject(order, "Order to be placed");
this.Context.ConsoleHelper.StartProgress("Placing order");

var createdOrder = partnerOperations.Customers.ById(customerId).Orders.Create(order);

this.Context.ConsoleHelper.StopProgress();
this.Context.ConsoleHelper.WriteObject(createdOrder, "Created order");

Source Code: https://github.com/Microsoft/Partner-Center-DotNet-Samples/blob/master/sdk/SdkSamples/IndirectModel/PlaceOrderForCustomer.cs

More information:

https://docs.microsoft.com/en-us/partner-center/indirect-provider-tasks-in-partner-center

Best Regards,

Dennis


这篇关于间接经销商的合作伙伴API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆