- API-Referenz
- Vertrag
- Create an Order
Create an Order
Request
- orderDataeine von 8 Alternativen
- Alternativeobject
- customerIdstringrequired
- descriptionstringrequired
- diskspaceInGiBnumberrequired
- promotionCodestring
- recommendationCodestring
- speceine von 2 Alternativenrequired
- Alternativeobject
- machineTypestring
Has to match the machineType of an available Article exactly. Reachable via the /articles endpoint.
- Alternativeobject
- ramnumber
- vcpunumber
- useFreeTrialboolean
- Alternativeobject
- customerIdstring (≥ 1 Zeichen)required
- descriptionstringrequired
- diskspaceInGiBnumberrequired
- machineTypestringrequired
- promotionCodestring
- recommendationCodestring
- useFreeTrialboolean
- Alternativeobject
- authCodestring
- domainstringrequired
- handleDataobjectrequired
- adminCArray von objectdeprecated
- Array[
- *object
- namestringrequired
- valuestringrequired
]
- ownerCArray von objectrequired
- Array[
- *object
- namestringrequired
- valuestringrequired
]
- projectIdstring (uuid)required
- Alternativeobject
You are able to order an External Certificate if you already created a Certificate Request.
- certificateRequestIdstring (uuid)required
- projectIdstring (uuid)required
- Alternativeobject
- customerIdstringrequired
- reservationLimitintegerrequired
- unlockLimitintegerrequired
- Alternativeobject
- mailAddressIdstring (uuid)required
- syncExistingMailsboolean
- Alternativeobject
- customerIdstringrequired
- monthlyTokensintegerrequired
Has to match the monthlyTokens of an available AI Hosting Article exactly. Reachable via the /articles endpoint.
- namestring
- requestsPerMinuteintegerrequired
Has to match the requestsPerMinute of an available AI Hosting Article exactly. Reachable via the /articles endpoint.
- useFreeTrialboolean
- Alternativeeine von 1 Alternativen
- Alternativeobject
TYPO3 ELTS license
- descriptionstringrequired
Describe for which typo3 instance the license will be used.
- licenseType"typo3"required
- majorVersionnumberrequired
The major version for which a license should be purchased.
- projectIdstring (uuid)required
- orderTypestring (einer von: domain, projectHosting, server, externalCertificate, leadFyndr, mailArchive, aiHosting, license)
orderData has to match the properties of an AI Hosting Article exactly. Reachable via the /articles endpoint.
Content-Type: application/json
{
"orderData": {
"customerId": "0f5ec9cd-1b1b-4850-9061-fcebe765c62d",
"monthlyTokens": 2000000,
"requestsPerMinute": 120
},
"orderType": "aiHosting"
}
Content-Type: application/json
{
"orderData": {
"domain": "mittwald.example",
"handleData": {
"ownerC": [
{
"name": "name",
"value": "Ada Lovelace"
}
]
},
"projectId": "190f3eec-8a71-42ed-94a5-c03e0d832c2a"
},
"orderType": "domain"
}
Content-Type: application/json
{
"orderData": {
"certificateRequestId": "7ea73ca6-4de6-4dd8-b64a-ccc46623f237",
"projectId": "190f3eec-8a71-42ed-94a5-c03e0d832c2a"
},
"orderType": "externalCertificate"
}
Content-Type: application/json
{
"orderData": {
"customerId": "0f5ec9cd-1b1b-4850-9061-fcebe765c62d",
"reservationLimit": 8,
"unlockLimit": 100
},
"orderType": "leadFyndr"
}
Content-Type: application/json
{
"orderData": {
"mailAddressId": "af279ce0-9aef-4fd6-9d0f-8c109038cfdf",
"syncExistingMails": true
},
"orderType": "mailArchive"
}
Content-Type: application/json
{
"orderData": {
"customerId": "0f5ec9cd-1b1b-4850-9061-fcebe765c62d",
"description": "My first project",
"diskspaceInGiB": 20,
"spec": {
"machineType": "prospace.2cpu.4gb"
},
"useFreeTrial": true
},
"orderType": "projectHosting"
}
Content-Type: application/json
{
"orderData": {
"customerId": "0f5ec9cd-1b1b-4850-9061-fcebe765c62d",
"description": "My first server",
"diskspaceInGiB": 100,
"spec": {
"machineType": "shared.xlarge"
},
"useFreeTrial": true
},
"orderType": "server"
}
Content-Type: application/json
{
"orderData": {
"description": "License for a-xxxxxx",
"licenseType": "typo3",
"majorVersion": 12,
"projectId": "190f3eec-8a71-42ed-94a5-c03e0d832c2a"
},
"orderType": "license"
}
{
"properties": {
"orderData": {
"oneOf": [
{
"properties": {
"customerId": {
"example": "0f5ec9cd-1b1b-4850-9061-fcebe765c62d",
"type": "string"
},
"description": {
"example": "My first project",
"type": "string"
},
"diskspaceInGiB": {
"example": 20,
"type": "number"
},
"promotionCode": {
"example": "123456",
"type": "string"
},
"recommendationCode": {
"example": "mp-123456",
"type": "string"
},
"spec": {
"oneOf": [
{
"properties": {
"machineType": {
"description": "Has to match the machineType of an available Article exactly. Reachable via the /articles endpoint.",
"example": "prospace.2cpu.4gb",
"type": "string"
}
},
"type": "object"
},
{
"properties": {
"ram": {
"example": 2,
"type": "number"
},
"vcpu": {
"example": 1,
"type": "number"
}
},
"type": "object"
}
]
},
"useFreeTrial": {
"type": "boolean"
}
},
"required": [
"customerId",
"diskspaceInGiB",
"description",
"spec"
],
"type": "object"
},
{
"properties": {
"customerId": {
"example": "f3435305-fd26-470e-9f21-43d9be7e67e7",
"minLength": 1,
"type": "string"
},
"description": {
"example": "My first project",
"type": "string"
},
"diskspaceInGiB": {
"example": 100,
"type": "number"
},
"machineType": {
"example": "shared.xlarge",
"type": "string"
},
"promotionCode": {
"example": "123456",
"type": "string"
},
"recommendationCode": {
"example": "mp-123456",
"type": "string"
},
"useFreeTrial": {
"type": "boolean"
}
},
"required": [
"customerId",
"machineType",
"diskspaceInGiB",
"description"
],
"type": "object"
},
{
"properties": {
"authCode": {
"example": "XXXXXXX",
"type": "string"
},
"domain": {
"example": "mittwald.example",
"type": "string"
},
"handleData": {
"properties": {
"adminC": {
"deprecated": true,
"items": {
"properties": {
"name": {
"example": "name",
"type": "string"
},
"value": {
"example": "Ada Lovelace",
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"type": "array"
},
"ownerC": {
"items": {
"properties": {
"name": {
"example": "name",
"type": "string"
},
"value": {
"example": "Ada Lovelace",
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"ownerC"
],
"type": "object"
},
"projectId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"projectId",
"domain",
"handleData"
],
"type": "object"
},
{
"description": "You are able to order an External Certificate if you already created a Certificate Request.",
"properties": {
"certificateRequestId": {
"format": "uuid",
"type": "string"
},
"projectId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"projectId",
"certificateRequestId"
],
"type": "object"
},
{
"properties": {
"customerId": {
"example": "0f5ec9cd-1b1b-4850-9061-fcebe765c62d",
"type": "string"
},
"reservationLimit": {
"example": 15,
"type": "integer"
},
"unlockLimit": {
"example": 80,
"type": "integer"
}
},
"required": [
"customerId",
"unlockLimit",
"reservationLimit"
],
"type": "object"
},
{
"properties": {
"mailAddressId": {
"format": "uuid",
"type": "string"
},
"syncExistingMails": {
"type": "boolean"
}
},
"required": [
"mailAddressId"
],
"type": "object"
},
{
"properties": {
"customerId": {
"example": "0f5ec9cd-1b1b-4850-9061-fcebe765c62d",
"type": "string"
},
"monthlyTokens": {
"description": "Has to match the monthlyTokens of an available AI Hosting Article exactly. Reachable via the /articles endpoint.",
"example": 2000000,
"type": "integer"
},
"name": {
"example": "Managed AI Hosting",
"type": "string"
},
"requestsPerMinute": {
"description": "Has to match the requestsPerMinute of an available AI Hosting Article exactly. Reachable via the /articles endpoint.",
"example": 120,
"type": "integer"
},
"useFreeTrial": {
"type": "boolean"
}
},
"required": [
"customerId",
"requestsPerMinute",
"monthlyTokens"
],
"type": "object"
},
{
"oneOf": [
{
"description": "TYPO3 ELTS license",
"properties": {
"description": {
"description": "Describe for which typo3 instance the license will be used.",
"type": "string"
},
"licenseType": {
"enum": [
"typo3"
],
"type": "string"
},
"majorVersion": {
"description": "The major version for which a license should be purchased.",
"example": 12,
"type": "number"
},
"projectId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"licenseType",
"projectId",
"majorVersion",
"description"
],
"type": "object"
}
]
}
]
},
"orderType": {
"enum": [
"domain",
"projectHosting",
"server",
"externalCertificate",
"leadFyndr",
"mailArchive",
"aiHosting",
"license"
],
"example": "projectHosting",
"type": "string"
}
},
"type": "object"
}
Responses
- orderIdstringrequired
Content-Type: application/json
{
"orderId": "string"
}
{
"properties": {
"orderId": {
"type": "string"
}
},
"required": [
"orderId"
]
}
Validation Error caused by invalid input data in the request
- type"ValidationError"required
- messagestring
- validationErrorsArray von objectrequired
- Array[
- *object
- messagestringrequired
The standard error message
- pathstringrequired
The path to the part of the data that was validated. JavaScript property access notation (e.g., ".prop[1].subProp") is used.
- typestringrequired
ajv validation error type (e.g. "format", "required", "type") or own validation error types
- contextobject
The object with the additional information about the error that can be used to create custom error messages. Keys depend on the type that failed validation (e.g. "missingProperty" for type "required")
- *string
]
Content-Type: application/json
{
"type": "ValidationError",
"message": "Validation failed",
"validationErrors": [
{
"message": "should be string",
"path": ".address.street",
"type": "format",
"context": {
"format": "email"
}
}
]
}
{
"type": "object",
"required": [
"type",
"validationErrors"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ValidationError"
]
},
"message": {
"type": "string",
"example": "Validation failed"
},
"validationErrors": {
"type": "array",
"items": {
"type": "object",
"required": [
"message",
"path",
"type"
],
"properties": {
"message": {
"type": "string",
"description": "The standard error message",
"example": "should be string"
},
"path": {
"type": "string",
"description": "The path to the part of the data that was validated. JavaScript property access notation (e.g., \".prop[1].subProp\") is used.\n",
"example": ".address.street"
},
"type": {
"type": "string",
"description": "ajv validation error type (e.g. \"format\", \"required\", \"type\") or own validation error types",
"example": "format"
},
"context": {
"type": "object",
"example": {
"format": "email"
},
"description": "The object with the additional information about the error that can be used to create custom error messages. Keys depend on the\ntype that failed validation (e.g. \"missingProperty\" for type \"required\")\n",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
Unprocessable Content
- errorobject
Content-Type: application/json
{
"error": {}
}
{
"properties": {
"error": {
"type": "object"
}
}
}
Your request ran into a rate limit. You have to wait until rate limit expires
- messagestring
- typestring
Content-Type: application/json
{
"message": "too many requests",
"type": "RateLimitError"
}
{
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "too many requests"
},
"type": {
"type": "string",
"example": "RateLimitError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Nutzungsbeispiele
$ curl \
--fail \
--location \
-X POST \
-d '{"orderData":{"customerId":"0f5ec9cd-1b1b-4850-9061-fcebe765c62d","description":"My first project","diskspaceInGiB":20,"promotionCode":"123456","recommendationCode":"mp-123456","spec":{"machineType":"prospace.2cpu.4gb"},"useFreeTrial":true},"orderType":"projectHosting"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/orders
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.orderCreateOrder({
"data": {
"orderData": {
"customerId": "0f5ec9cd-1b1b-4850-9061-fcebe765c62d",
"description": "My first project",
"diskspaceInGiB": 20,
"promotionCode": "123456",
"recommendationCode": "mp-123456",
"spec": {
"machineType": "prospace.2cpu.4gb"
},
"useFreeTrial": true
},
"orderType": "projectHosting"
}
});
assertStatus(response, 201);
use \Mittwald\ApiClient\Generated\V2\Clients\Contract\OrderCreateOrder\OrderCreateOrderRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Contract\OrderCreateOrder\OrderCreateOrderRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// OrderCreateOrderRequestBody to learn how to construct a valid instance
$body = new OrderCreateOrderRequestBody(/* TODO: ... */);
$request = (new OrderCreateOrderRequest(
body: $body
));
$response = $client->contract()->orderCreateOrder($request);
var_dump($response->getBody();