Public/Get-GW2CommerceDelivery.ps1

<#
    .SYNOPSIS
        Retrieves items and coins available for pickup at the trading post.
 
    .DESCRIPTION
        The Get-GW2CommerceDelivery cmdlet retrieves information about items and coins currently waiting for pickup at the trading post.
        This endpoint requires an API key with the 'tradingpost' scope.
 
    .PARAMETER APIKey
        Your Guild Wars 2 API Key.
 
    .EXAMPLE
        Get-GW2CommerceDelivery -APIKey "Your-API-Key"
        Retrieves items and coins waiting for pickup.
 
    .NOTES
        API Endpoint: /v2/commerce/delivery
    #>

function Get-GW2CommerceDelivery {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string]$APIKey
    )

    $Uri = "https://api.guildwars2.com/v2/commerce/delivery"
    $Headers = @{
        "Authorization" = "Bearer $APIKey"
    }

    try {
        Invoke-RestMethod -Uri $Uri -Method Get -Headers $Headers
    }
    catch {
        Write-Error "Failed to retrieve commerce delivery: $_"
    }
}