Preview TariffChange
POST/tariff-change-previews/ 
v2
POST
order-preview-tariff-change
Request
Responses
Usage examples
- cURL
 - JavaScript SDK
 - PHP SDK
 
$ 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();