Queries and mutations for managing API Extensions in the platform.
Queries
Query API Extensions
| Arguments | |
|---|---|
whereString | |
sortArray of String | |
limitInt | |
offsetInt | |
Get API Extension
| Arguments | |
|---|---|
idString | Queries with specified ID |
keyString | Queries with specified key |
Mutations
Create API Extension
Update API Extension
| Arguments | |
|---|---|
versionLong | |
actionsArray of ExtensionUpdateAction | |
idString | Queries with specified ID |
keyString | Queries with specified key |
Delete API Extension
Output types
Extension
dependencies field is available only as dependenciesRef, which returns a list of References. To set dependencies, use dependencies in ExtensionDraft or the Set Dependencies update action. Both take ResourceIdentifiers.keyString | User-defined unique identifier of the Extension. |
destination | The configuration for the Extension, including its type, location and authentication details. |
triggersArray of Trigger | Describes what triggers the Extension. |
timeoutInMsInt | Maximum time (in milliseconds) that the Extension can respond within.
If no timeout is provided, the default value is used for all types of Extensions.
The limit of 10000 ms (10 seconds) can be increased per Project after we review the performance impact.
Please contact the commercetools support team and provide the Region, Project key, and use case. |
dependenciesRefArray of Reference | References to other Extensions that must complete before this Extension is called. The Extension receives the resource state after all transitive ancestors' update actions have been applied. Maximum 5 entries. |
additionalContext | Configures additional information included in the payload sent to the API Extension. |
expansionPathsArray of String | Expansion paths used for reference expansion of the payload.
Be aware of the limits of this feature and its performance impact. |
idString | Unique identifier of the Extension. |
versionLong | Current version of the Extension. |
createdAt | Date and time (UTC) the Extension was initially created. |
lastModifiedAt | Date and time (UTC) the Extension was last updated. |
createdBy | IDs and references that created the Extension. |
lastModifiedBy | IDs and references that last modified the Extension. |
ExtensionQueryResult
Trigger
resourceTypeId is a String, not an enum. It accepts the values listed in ExtensionResourceTypeId.resourceTypeIdString | |
actionsArray of ActionType | Can be Create, or Update |
conditionString |
ActionType
CreateUpdate
ExtensionAdditionalContext
Configures additional information included in the payload sent to the API Extension.
includeOldResourceBoolean | Whether the payload sent to the API Extension should include an oldResource field with the state of the resource before the update.
This only applies to Update actions. For Create actions, oldResource is not included. |
ExtensionDestination
typeString |
AWSLambdaDestination
accessKey and accessSecret pair, specifically for each Extension that only has the lambda:InvokeFunction permission on this function.arnString | Amazon Resource Name (ARN) of the Lambda function in the format arn:aws:lambda:<region>:<accountid>:function:<functionName>. Use the format arn:aws:lambda:<region>:<accountid>:function:<functionName>:<functionAlias/version> to point to a specific version of the function. |
accessKeyString | Partially hidden on retrieval for security reasons. |
accessSecretString | Partially hidden on retrieval for security reasons. |
typeString |
GoogleCloudFunctionDestination
extensions@commercetools-platform.iam.gserviceaccount.com service account to invoke your function. If your function's version is 1st gen, grant the service account the IAM role Cloud Functions Invoker. For version 2nd gen, assign the IAM role Cloud Run Invoker using the Cloud Run console.urlString | URL to the target function. |
typeString |
HttpDestination
HTTPS connection for production setups. However, we also accept unencrypted HTTP connections for development purposes. HTTP redirects will not be followed and cache headers will be ignored.typeString | |
urlString | URL to the target destination. |
authentication | Authentication methods (such as Basic or Bearer). |
HttpDestinationAuthentication
typeString |
AzureFunctionsAuthentication
authLevel to function and provide the function's key to be used inside the x-functions-key header. For more information, see the Azure Functions documentation.https://foo.azurewebsites.net/api/bar instead of
https://foo.azurewebsites.net/api/bar?code=secret.keyString | Partially hidden on retrieval for security reasons. |
typeString |
Input types
ExtensionDraft
keyString | User-defined unique identifier for the Extension. |
destination | Defines where the Extension can be reached. |
triggersArray of TriggerInput | Describes what triggers the Extension. |
timeoutInMsInt | Maximum time (in milliseconds) the Extension can respond within.
If no timeout is provided, the default value is used for all types of Extensions.
We recommend keeping the timeout as low as possible to avoid performance issues.
The limit of 10000 ms (10 seconds) can be increased per Project after we review the performance impact.
Please contact the commercetools support team and provide the Region, Project key, and use case. |
dependenciesArray of ResourceIdentifierInput | Extensions that must complete before this Extension is called, identified by id or key. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions. |
additionalContext | Configures additional information included in the payload sent to the API Extension. |
expansionPathsArray of String | Expansion paths used for reference expansion of the payload.
Be aware of the limits of this feature and its performance impact. |
TriggerInput
resourceTypeIdString | |
actionsArray of ActionType | Can be Create, or Update |
conditionString |
ExtensionDestinationInput
type field. In GraphQL, the input has one field per destination type instead: HTTP, AWSLambda, and GoogleCloudFunction. These names match the type values of ExtensionDestination in REST. The same applies to HttpDestinationAuthenticationInput, which has the fields AuthorizationHeader and AzureFunctions.HTTP | |
AWSLambda | |
GoogleCloudFunction |
AWSLambdaDestinationInput
arnString | |
accessKeyString | |
accessSecretString |
HttpDestinationInput
urlString | |
authentication |
GoogleCloudFunctionDestinationInput
urlString |
AzureFunctionsAuthenticationInput
keyString |
HttpDestinationAuthenticationInput
AuthorizationHeader | |
AzureFunctions |
ExtensionAdditionalContextInput
includeOldResourceBoolean |
ExtensionUpdateAction
changeDestination | |
changeTriggers | |
setAdditionalContext | |
setExpansionPaths | |
setDependencies | |
setKey | |
setTimeoutInMs |
Update actions
Change Destination
destination | New value to set. Must not be empty. |
Change Triggers
triggersArray of TriggerInput | New value to set. Must not be empty. |
Set Additional Context
additionalContext | New value to set. |
Set Expansion Paths
expansionPathsArray of String | Expansion paths used for reference expansion of the payload.
Be aware of the limits of this feature and its performance impact. |
Set Dependencies
dependenciesArray of ResourceIdentifierInput | Extensions this Extension depends on, identified by id or key. Set to an empty array to remove all dependencies. Maximum 5 entries. |
Set Key
keyString | Value to set. If omitted, any existing value is removed. |
Set TimeoutInMs
timeoutInMsInt | Value to set.
If no timeout is provided, the default value is used for all types of Extensions.
We recommend keeping the timeout as low as possible to avoid performance issues.
The limit of 10000 ms (10 seconds) can be increased per Project after we review the performance impact.
Please contact the commercetools support team and provide the Region, Project key, and use case. |