Skip to content

Commit

Permalink
fix customerid
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Feb 3, 2025
1 parent 8fa5f37 commit ebd6868
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ function Get-SherwebCurrentSubscription {
[string]$SKU,
[string]$ProductName
)
if($TenantFilter){
Get-ExtensionMapping -Extension 'Sherweb' | Where-Object { $_.RowKey -eq $TenantFilter } | ForEach-Object {
write-host "Extracted customer id from tenant filter - It's $($_.IntegrationId)"
$CustomerId = $_.IntegrationId
if ($TenantFilter) {
$TenantFilter = (Get-Tenants -TenantFilter $TenantFilter).customerId
$CustomerId = Get-ExtensionMapping -Extension 'Sherweb' | Where-Object { $_.RowKey -eq $TenantFilter } | Select-Object -ExpandProperty IntegrationId
}
}

$AuthHeader = Get-SherwebAuthentication
$Uri = "https://api.sherweb.com/service-provider/v1/billing/subscriptions/details?customerId=$CustomerId"
$SubscriptionDetails = Invoke-RestMethod -Uri $Uri -Method GET -Headers $AuthHeader
Expand Down

0 comments on commit ebd6868

Please sign in to comment.