- API-Referenz
- Marktplatz
- Creates or Updates Pricing for an Extension
Creates or Updates Pricing for an Extension
The Pricing is needed to publish paid extensions.
Request
- extensionIdstring (uuid)requiredBeispiel:
"907a24e9-0723-4566-b584-86578419e983" - contributorIdstringrequired
- Alternativeobject
- dryRunboolean
If set to true, the request will be validated but not executed.
- priceInCentsnumberrequired
Price in cents.
- Alternativeobject
- dryRunboolean
If set to true, the request will be validated but not executed.
- pricePlanobjectrequired
PricePlan with Variants.
- isDowngradeAllowedboolean
Indicates whether downgrading between variants is allowed.
- isUpgradeAllowedboolean
Indicates whether upgrading between variants is allowed.
- variantsArray von objectrequired
- Array[
- *object
- deletionDeadlinestring (date-time)
deadline for scheduled deletion of extension variant
- descriptionstring
Description of Variant.
- descriptionChangeTypestring (einer von: FEATURE_SET_MODIFIED, FEATURE_SET_UNCHANGED)
DescriptionChangeType defines how the description change should be handled. Values:
- FEATURE_SET_MODIFIED: The users have to confirm to the new contract details equal as price changes.
- FEATURE_SET_UNCHANGED: The changes are only wording updates and do not impact the contract details, so no confirm is required.
- isBookingStoppedboolean
stop extension variant from being booked
- isDeletionScheduledboolean
deletion of extension variant is scheduled
- keystringrequired
Key that needs to be unique in Variant.
- namestring
Name of Variant.
- priceInCentsnumberrequired
Price in cents.
]
Content-Type: application/json
{
"dryRun": true,
"priceInCents": 999
}
Content-Type: application/json
{
"dryRun": true,
"pricePlan": {
"variants": [
{
"description": "Description of the Variant.",
"key": "variant-key",
"name": "Name of the Variant",
"priceInCents": 999
}
]
}
}
{
"oneOf": [
{
"properties": {
"dryRun": {
"default": false,
"description": "If set to true, the request will be validated but not executed.",
"type": "boolean"
},
"priceInCents": {
"description": "Price in cents.",
"type": "number"
}
},
"required": [
"priceInCents"
],
"type": "object"
},
{
"properties": {
"dryRun": {
"default": false,
"description": "If set to true, the request will be validated but not executed.",
"type": "boolean"
},
"pricePlan": {
"description": "PricePlan with Variants.",
"properties": {
"isDowngradeAllowed": {
"description": "Indicates whether downgrading between variants is allowed.",
"type": "boolean"
},
"isUpgradeAllowed": {
"description": "Indicates whether upgrading between variants is allowed.",
"type": "boolean"
},
"variants": {
"items": {
"properties": {
"deletionDeadline": {
"description": "deadline for scheduled deletion of extension variant",
"format": "date-time",
"type": "string"
},
"description": {
"description": "Description of Variant.",
"type": "string"
},
"descriptionChangeType": {
"description": "DescriptionChangeType defines how the description change should be handled. Values:\n - FEATURE_SET_MODIFIED: The users have to confirm to the new contract details equal as price changes.\n - FEATURE_SET_UNCHANGED: The changes are only wording updates and do not impact the contract details, so no confirm is required.\n",
"enum": [
"FEATURE_SET_MODIFIED",
"FEATURE_SET_UNCHANGED"
],
"type": "string"
},
"isBookingStopped": {
"description": "stop extension variant from being booked",
"type": "boolean"
},
"isDeletionScheduled": {
"description": "deletion of extension variant is scheduled",
"type": "boolean"
},
"key": {
"description": "Key that needs to be unique in Variant.",
"type": "string"
},
"name": {
"description": "Name of Variant.",
"type": "string"
},
"priceInCents": {
"description": "Price in cents.",
"type": "number"
}
},
"required": [
"key",
"priceInCents"
],
"type": "object"
},
"type": "array"
}
},
"required": [
"variants"
],
"type": "object"
}
},
"required": [
"pricePlan"
],
"type": "object"
}
]
}
Responses
The Pricing has been updated.
- extensionIdstring (uuid)required
The ID of the Extension.
- nextPossiblePriceChangestring (date-time)
The time until which the contributor is blocked from changing the price again.
- priceChangeConsequenceobjectrequired
- contributorConsequencestring (einer von: NONE, EDIT_BLOCK)required
Description of the consequence for the Extension from the perspective of the contributor. Values: * "NONE": No consequence. * "EDIT_BLOCK": The Extension will be blocked for editing by the contributor for 30 days.
- globalCustomerConsequencestring (einer von: NONE, INFO, CONFIRM_REQUIRED)required
Description of the consequence for all Customers of the Extension. Values: * "NONE": No consequence. * "INFO": Customers will be informed about the upcoming changes to their contracts. * "CONFIRM_REQUIRED": Customers will have to confirm or select the accepted changes to their contracts within 30 days or their contracts will be automatically cancelled.
- variantConsequencesArray von objectrequired
- Array[
- *object
- consequencestring (einer von: NONE, INFO, CONFIRM_REQUIRED)
The individual consequence for customers of a specific variant of the Extension. Values: * "NONE": No consequence. * "INFO": Customers will be informed about the upcoming changes to their contracts. * "CONFIRM_REQUIRED": Customers will have to confirm or select the accepted changes to their contracts within 30 days or their contracts will be automatically cancelled.
- deletionDeadlinestring (date-time)
The date the variant will ne deleted
- variantKeystring
The key of the variant of the Extension.
]
Content-Type: application/json
{
"extensionId": "f0f86186-0a5a-45b2-aa33-502777496347",
"nextPossiblePriceChange": "1985-10-26T01:21:00.000Z",
"priceChangeConsequence": {
"contributorConsequence": "NONE",
"globalCustomerConsequence": "NONE",
"variantConsequences": [
{
"consequence": "NONE",
"deletionDeadline": "1985-10-26T01:21:00.000Z",
"variantKey": "string"
}
]
}
}
{
"properties": {
"extensionId": {
"description": "The ID of the Extension.",
"format": "uuid",
"type": "string"
},
"nextPossiblePriceChange": {
"description": "The time until which the contributor is blocked from changing the price again.",
"format": "date-time",
"type": "string"
},
"priceChangeConsequence": {
"properties": {
"contributorConsequence": {
"description": "Description of the consequence for the Extension from the perspective of the contributor. Values: * \"NONE\": No consequence. * \"EDIT_BLOCK\": The Extension will be blocked for editing by the contributor for 30 days.\n",
"enum": [
"NONE",
"EDIT_BLOCK"
],
"type": "string"
},
"globalCustomerConsequence": {
"description": "Description of the consequence for all Customers of the Extension. Values: * \"NONE\": No consequence. * \"INFO\": Customers will be informed about the upcoming changes to their contracts. * \"CONFIRM_REQUIRED\": Customers will have to confirm or select the accepted changes to their contracts within 30 days or their contracts will be automatically cancelled.\n",
"enum": [
"NONE",
"INFO",
"CONFIRM_REQUIRED"
],
"type": "string"
},
"variantConsequences": {
"items": {
"properties": {
"consequence": {
"description": "The individual consequence for customers of a specific variant of the Extension. Values: * \"NONE\": No consequence. * \"INFO\": Customers will be informed about the upcoming changes to their contracts. * \"CONFIRM_REQUIRED\": Customers will have to confirm or select the accepted changes to their contracts within 30 days or their contracts will be automatically cancelled.\n",
"enum": [
"NONE",
"INFO",
"CONFIRM_REQUIRED"
],
"type": "string"
},
"deletionDeadline": {
"description": "The date the variant will ne deleted",
"format": "date-time",
"type": "string"
},
"variantKey": {
"description": "The key of the variant of the Extension.",
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"required": [
"contributorConsequence",
"globalCustomerConsequence",
"variantConsequences"
],
"type": "object"
}
},
"required": [
"extensionId",
"priceChangeConsequence"
],
"type": "object"
}
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"
}
}
}
}
}
}
}
The requested resource was not found
- 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"
}
}
}
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"
}
}
}
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 PUT \
-d '{"dryRun":true,"priceInCents":123}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/contributors/string/extensions/f0f86186-0a5a-45b2-aa33-502777496347/pricing
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.marketplace.extensionUpdateExtensionPricing({
"extensionId": "f0f86186-0a5a-45b2-aa33-502777496347",
"contributorId": "string",
"data": {
"dryRun": true,
"priceInCents": 123
}
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\Marketplace\ExtensionUpdateExtensionPricing\ExtensionUpdateExtensionPricingRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Marketplace\ExtensionUpdateExtensionPricing\ExtensionUpdateExtensionPricingRequestBody;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
// TODO: Please consult the properties and constructor signature of
// ExtensionUpdateExtensionPricingRequestBody to learn how to construct a valid instance
$body = new ExtensionUpdateExtensionPricingRequestBody(/* TODO: ... */);
$request = (new ExtensionUpdateExtensionPricingRequest(
extensionId: "f0f86186-0a5a-45b2-aa33-502777496347",
contributorId: "string",
body: $body
));
$response = $client->marketplace()->extensionUpdateExtensionPricing($request);
var_dump($response->getBody();