Skip to main content

Preview TariffChange

POST/v2/tariff-change-previews
API version
v2
Request method
POST
Operation ID
order-preview-tariff-change

Request​

Responses​

Format
application/json
Description
  • machineTypePricenumberrequired
  • storagePricenumberrequired
  • totalPricenumberrequired
Content-Type: application/json

{
"machineTypePrice": 100,
"storagePrice": 900,
"totalPrice": 1000
}
{
"properties": {
"machineTypePrice": {
"example": 100,
"type": "number"
},
"storagePrice": {
"example": 900,
"type": "number"
},
"totalPrice": {
"example": 1000,
"type": "number"
}
},
"required": [
"totalPrice",
"storagePrice",
"machineTypePrice"
]
}

Usage examples​

$ curl \
--fail \
--location \
-X POST \
-d '{"tariffChangeData":{"contractId":"string","diskspaceInGiB":20,"spec":{"machineType":"prospace.2cpu.4gb"}},"tariffChangeType":"projectHosting"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/tariff-change-previews
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.contract.orderPreviewTariffChange({
"data": {
"tariffChangeData": {
"contractId": "string",
"diskspaceInGiB": 20,
"spec": {
"machineType": "prospace.2cpu.4gb"
}
},
"tariffChangeType": "projectHosting"
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Contract\OrderPreviewTariffChange\OrderPreviewTariffChangeRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Contract\OrderPreviewTariffChange\OrderPreviewTariffChangeRequestBody;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

// TODO: Please consult the properties and constructor signature of
// OrderPreviewTariffChangeRequestBody to learn how to construct a valid instance
$body = new OrderPreviewTariffChangeRequestBody(/* TODO: ... */);

$request = (new OrderPreviewTariffChangeRequest(
body: $body
));
$response = $client->contract()->orderPreviewTariffChange($request);

var_dump($response->getBody();

On this page