间接经销商的合作伙伴API [英] Partner API for Indirect Reseller
问题描述
您好,
我们目前是间接经销商,希望为我们的客户提供购买许可证的门户网站。似乎要提供此功能(为了能够自动分配许可证),我们需要访问合作伙伴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://docs.microsoft.com/en-us/partner-center/indirect-provider-tasks-in-合作伙伴中心
最好的问候,
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");More information:
https://docs.microsoft.com/en-us/partner-center/indirect-provider-tasks-in-partner-center
Best Regards,
这篇关于间接经销商的合作伙伴API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!