Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Latest commit

 

History

History
208 lines (146 loc) · 4.57 KB

New-PCOrder.md

File metadata and controls

208 lines (146 loc) · 4.57 KB

New-PCOrder

Creates a new order.

SYNTAX

New-PCOrder [-TenantId <String>] -OrderId <String> [-LineItems <Array>] [-SaToken <String>] [<CommonParameters>]

New-PCOrder [-TenantId <String>] -LineItems <Array> [-SaToken <String>] [<CommonParameters>]

New-PCOrder [-TenantId <String>] -OfferId <String> -Quantity <UInt16> [-FriendlyName <String>] [-PartnerIdOnRecord <String>] [-SaToken <String>] [<CommonParameters>]

DESCRIPTION

The New-PCOrder cmdlet creates a new order.

PARAMETERS

-TenantId <String>

Specifies the tenant used for scoping this cmdlet.

Required?                    false
Position?                    named
Default value                $GlobalCustomerId
Accept pipeline input?       false
Accept wildcard characters?  false

-OrderId <String>

Specifies the order id if this is an add on order.

Required?                    true
Position?                    named
Default value
Accept pipeline input?       false
Accept wildcard characters?  false

-LineItems <Array>

Specifies line items to include in the order

Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Accept wildcard characters?  false

-OfferId <String>

Specifies the offer id guid for the ordered items.

Required?                    true
Position?                    named
Default value
Accept pipeline input?       false
Accept wildcard characters?  false

-Quantity <UInt16>

Specifies the number of licenses for a license-based subscription or instances for an Azure reservation.

Required?                    true
Position?                    named
Default value                0
Accept pipeline input?       false
Accept wildcard characters?  false

-FriendlyName <String>

Specifies a friendly name for the subscription defined by the partner to help disambiguate.

Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Accept wildcard characters?  false

-PartnerIdOnRecord <String>

When an indirect provider places an order on behalf of an indirect reseller, populate this field with the MPN ID of the indirect reseller only (never the ID of the indirect provider). This ensures proper accounting for incentives.

Required?                    false
Position?                    named
Default value
Accept pipeline input?       false
Accept wildcard characters?  false

-SaToken <String>

Specifies an authentication token with your Partner Center credentials.

Required?                    false
Position?                    named
Default value                $GlobalToken
Accept pipeline input?       false
Accept wildcard characters?  false

INPUTS

OUTPUTS

NOTES

EXAMPLES

EXAMPLE 1

Order a new subscription

Select a customer

PS C:\>$customer = Get-PCCustomer -TenantId '<tenant id GUID>'

Get an offer id

    $offer = Get-PCOffer -CountryId '<Country two digits id>' -OfferId '<offer id GUID>'

Create the OrderLineItem

    $lineItems = @()
    $lineItems += [OrderLineItem]::new()
    $lineItems[0].LineItemNumber = 0
    $lineItems[0].FriendlyName = '<friendly name>'
    $lineItems[0].OfferId = $offer.id
    $lineItems[0].Quantity = <quantity>

Send order

New-PCOrder -TenantId $customer.id -LineItems $lineItems

EXAMPLE 2

Order an Addon to an existing subscription

Get subscription

    $subscription = Get-PCSubscription -TenantId $customer.id -subscriptionid '<subscription id>'

Get list of addons available for the subscription offer

    $addons = Get-PCOffer -CountryId '<Country two digits id>' -OfferId $subscription.OfferId -addons

Get addon offer

    $addon = Get-PCOffer -CountryId 'US' -OfferId '<offer id>'

Get subscription order

    $order = Get-PCOrder -TenantId $customer.id -OrderId $subscription.OrderId

Get the next OrderLineItem number

    $newLineItemNumber = $order.lineItems.Count

Create the addon OrderLineItem

    $lineItems = @()
    $lineItems += [OrderLineItem]::new()
    $lineItems[0].LineItemNumber = 0
    $lineItems[0].FriendlyName = '<friendly name>'
    $lineItems[0].OfferId = $addon.id
    $lineItems[0].ParentSubscriptionId = $subscription.id
    $lineItems[0].Quantity = <quantity>

Send order

    New-PCOrder -TenantId $customer.id -OrderId $order.id -LineItems $lineItems