Portal shows: €5.95 for 64GB storage_premium_perf0 in eu01-1
Let's figure out what the API price actually represents...
Array
(
[Single AZ] => Array
(
[title] => Block Storage for disk volumes Premium-Performance 0-EU01
[id] => STA_SKU_14553118
[sku] => ST-0017801
[region] => eu01
[category] => Storage
[product] => Block Storage
[name] => Block Storage for disk volumes Premium-Performance 0-EU01
[unit] => Hours
[unitBilling] => per disk/hour
[maturityModelState] => ga
[documentation] =>
[price] => 0.00245833333
[monthlyPrice] => 1.7699999976
[currency] => €
[generalProductGroup] => Block Storage
[priceListVisibility] => Yes
[deprecated] => No
[finOpsFocus] => Array
(
[serviceCategory] => Storage
[serviceSubcategory] => Block Storage
)
[attributes] => Array
(
[cfUniqueIds] => Array
(
[0] => 0a5b8f61-7c88-4481-a0da-b94fa81cd0fa
[1] => 55c9f8f8-1f77-46d7-8f7e-ba6a9e07766a
[2] => 64ddafb9-0f03-44ed-9221-6f820fd5f99e
[3] => 6e2eaf21-d8d9-45b5-82a4-e067dd1d0834
[4] => ST-0017801
)
[class] => storage_premium_perf0
[maxIOPerSec] => 120
[maxTroughInMB] => 25
[metro] =>
[storage] => volume
[type] => performance
)
)
[Metro] => Array
(
[title] => Block Storage for disk volumes Premium-Performance 0-EU01-m
[id] => STA_SKU_14553119
[sku] => ST-0017901
[region] => eu01
[category] => Storage
[product] => Block Storage
[name] => Block Storage for disk volumes Premium-Performance 0-EU01-m
[unit] => Hours
[unitBilling] => per disk/hour
[maturityModelState] => ga
[documentation] =>
[price] => 0.00493055556
[monthlyPrice] => 3.5500000032
[currency] => €
[generalProductGroup] => Block Storage
[priceListVisibility] => Yes
[deprecated] => No
[finOpsFocus] => Array
(
[serviceCategory] => Storage
[serviceSubcategory] => Block Storage
)
[attributes] => Array
(
[cfUniqueIds] => Array
(
[0] => 0a5b8f61-7c88-4481-a0da-b94fa81cd0fa-metro
[1] => 55c9f8f8-1f77-46d7-8f7e-ba6a9e07766a-metro
[2] => 64ddafb9-0f03-44ed-9221-6f820fd5f99e-metro
[3] => 6e2eaf21-d8d9-45b5-82a4-e067dd1d0834-metro
)
[class] => storage_premium_perf0
[maxIOPerSec] => 120
[maxTroughInMB] => 25
[metro] => 1
[storage] => volume
[type] => performance
)
)
)
Portal shows: €5.95 for 64GB = €0.092969 per GB per month
API shows: monthlyPrice = €1.7699999976
| Interpretation | Calculation | Result for 64GB | Match Portal? |
|---|---|---|---|
| Per GB per month | 1.7699999976 × 64 | €113.28 | ❌ Too high |
| Per TB per month | (1.7699999976 ÷ 1000) × 64 | €0.11 | ❌ Too low |
| Per GB per hour | 1.7699999976 × 64 × 720 | €81,561.60 | ❌ Way too high |
| Flat monthly rate | 1.7699999976 | €1.77 | ❌ |
| Find divisor | 1.7699999976 ÷ 0.092969 | Divisor: 19.04 | - |
| Base allocation | 1.7699999976 ÷ 0.092969 | ~19 GB base | - |
If portal shows €5.95 for 64GB and API shows €1.7699999976, then:
Array
(
[title] => Block Storage for Archiving Premium-Capacity-EU01
[id] => STA_SKU_143119
[sku] => ST-0110001
[region] => eu01
[category] => Storage
[product] => Block Storage
[name] => Block Storage for Archiving Premium-Capacity-EU01
[unit] => Gigabyte Hours
[unitBilling] => per GB/hour
[maturityModelState] => ga
[documentation] =>
[price] => 0.00009076380
[monthlyPrice] => 0.065349936
[currency] => €
[generalProductGroup] => Archiving
[priceListVisibility] => No
[deprecated] => Yes
[finOpsFocus] => Array
(
[serviceCategory] => Storage
[serviceSubcategory] => Block Storage
)
[attributes] => Array
(
[cfUniqueIds] => Array
(
[0] => ST-0110001
)
[class] =>
[maxIOPerSec] =>
[maxTroughInMB] =>
[metro] =>
[storage] => volume
[technicalProductGroup] => archiving
[type] => capacity
)
)
Based on the analysis, the API's monthlyPrice field appears to be incorrectly interpreted. The actual calculation should be:
// In your getvolumeprice() function:
// The API price seems to be for a different unit or scale
// You need to determine the correct divisor or multiplier
// Option 1: If API price is for a base unit (e.g., 19-20 GB)
$pricePerGB = $valldata->price / 19.04; // Approximate divisor
$monthlyprice = $pricePerGB * $volume;
// Option 2: Use a fixed price mapping
$fixedPrices = [
'storage_premium_perf0' => ['Single AZ' => 0.093, 'Metro' => 0.234],
// ... other classes
];