Skip to main content

Schedule the Termination of a Contract

POST/v2/contracts/{contractId}/termination
API version
v2
Request method
POST
Operation ID
contract-terminate-contract

Request​

  • contractIdstringrequired

    The uuid of the Contract to be terminated.

Responses​

Format
application/json
Description

Returns the contractId, the date on which the Termination will take place and the list of affected ContractItems.

  • contractIdstring (uuid)
  • explanationstring
  • itemsScheduledForTerminationarray of string (uuid)
    • Array[
      • *string (uuid)
      ]
  • reasonstring
  • terminationTargetDatestring (date-time)
Content-Type: application/json

{
"contractId": "f0f86186-0a5a-45b2-aa33-502777496347",
"explanation": "The website for my temporary project is no longer needed",
"itemsScheduledForTermination": [
"f0f86186-0a5a-45b2-aa33-502777496347"
],
"reason": "Projekt wird nicht mehr benötigt",
"terminationTargetDate": "1985-10-26T01:21:00.000Z"
}
{
"properties": {
"contractId": {
"format": "uuid",
"type": "string"
},
"explanation": {
"example": "The website for my temporary project is no longer needed",
"type": "string"
},
"itemsScheduledForTermination": {
"items": {
"format": "uuid",
"type": "string"
},
"type": "array"
},
"reason": {
"example": "Projekt wird nicht mehr benötigt",
"type": "string"
},
"terminationTargetDate": {
"format": "date-time",
"type": "string"
}
}
}

Usage examples​

$ curl \
--fail \
--location \
-X POST \
-d '{"explanation":"The website for my temporary project is no longer needed","reason":"Projekt wird nicht mehr benötigt","terminationTargetDate":"1985-10-26T01:21:00.000Z"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/contracts/string/termination
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.terminateContract({
"contractId": "string",
"data": {
"explanation": "The website for my temporary project is no longer needed",
"reason": "Projekt wird nicht mehr benötigt",
"terminationTargetDate": "1985-10-26T01:21:00.000Z"
}
});

assertStatus(response, 201);

use \Mittwald\ApiClient\Generated\V2\Clients\Contract\TerminateContract\TerminateContractRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Contract\TerminateContract\TerminateContractRequestBody;

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

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

$request = (new TerminateContractRequest(
contractId: "string",
body: $body
));
$response = $client->contract()->terminateContract($request);

var_dump($response->getBody();

On this page