< Back

New-PartnerCustomerOrder

Sat Jan 18, 2020 6:35 pm

NAME New-PartnerCustomerOrder



SYNOPSIS

Create a new order for the specified services on behalf of the customer.





SYNTAX

New-PartnerCustomerOrder [-BillingCycle {Annual | Monthly | None}] -CustomerId <String> -LineItems

<PSOrderLineItem[]> -OrderId <String> [-Confirm] [-WhatIf] [<CommonParameters>]





DESCRIPTION

Create a new order for the specified services on behalf of the customer.





PARAMETERS

-BillingCycle <BillingCycleType>

The frequency with which the partner is billed for this order.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-CustomerId <String>

The identifier of the customer making the purchase.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LineItems <PSOrderLineItem[]>

The order line items. Each order line item refers to one offer's purchase data.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-OrderId <String>

The order identifier used when purchasing an add-on.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs. The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None







OUTPUTS

Microsoft.Store.PartnerCenter.PowerShell.Models.Orders.PSOrder







NOTES









-------------------------- Example 1 --------------------------



PS C:\\> $lineItem = New-Object -TypeName Microsoft.Store.PartnerCenter.PowerShell.Models.Orders.PSOrderLineItem

PS C:\\>

PS C:\\> $lineItem.LineItemNumber = 0

PS C:\\> $lineItem.OfferId = '031C9E47-4802-4248-838E-778FB1D2CC05'

PS C:\\> $lineItem.Quantity = 1

PS C:\\>

PS C:\\> New-PartnerCustomerOrder -BillingCycle Monthly -CustomerId '46a62ece-10ad-42e5-b3f1-b2ed53e6fc08'

-LineItems @($lineItem)



Creates a new order for the specified services on behalf of the customer.





-------------------------- Example 2 --------------------------



PS C:\\> $s = Get-PartnerCustomerSubscription -CustomerId '46a62ece-10ad-42e5-b3f1-b2ed53e6fc08' -SubscriptionId

'10704f2f-3fc6-4e42-8acf-08df4f81c93c'

PS C:\\> $addOn = Get-PartnerOfferAddon -OfferId $s.OfferId | Where-Object {$_.Name -eq 'Microsoft MyAnalytics'}

PS C:\\>

PS C:\\> $lineItem = New-Object -TypeName Microsoft.Store.PartnerCenter.PowerShell.Models.Orders.PSOrderLineItem

PS C:\\>

PS C:\\> $lineItem.LineItemNumber = 0

PS C:\\> $lineItem.OfferId = $addOn.OfferId

PS C:\\> $lineItem.Quantity = 1

PS C:\\> $lineItem.FriendlyName = $addOn.Name

PS C:\\> $lineItem.ParentSubscriptionId = $s.SubscriptionId

PS C:\\>

PS C:\\> New-PartnerCustomerOrder -CustomerId '46a62ece-10ad-42e5-b3f1-b2ed53e6fc08' -LineItems @($lineItem)

-OrderId $s.OrderId



Creates an order to purchase an add-on for the specific subscription on behalf of the customer. This example shows

how to purchase the Microsoft MyAnalytics add-on for the specified subscription. In this case the specified

subscription is an Office 365 E3 subscription.







RELATED LINKS

Online Version: https://docs.microsoft.com/powershell/m ... tomerOrder