1. Registry
  2. Packages
  3. Commercetools Provider
  4. API Docs
  5. ApiExtension
Viewing docs for commercetools 1.23.2
published on Tuesday, Oct 27, 2026 by labd
commercetools
Viewing docs for commercetools 1.23.2
published on Tuesday, Oct 27, 2026 by labd

    Create a new API extension to extend the behaviour of an API with business logic. Note that API extensions affect the performance of the API it is extending. If it fails, the whole API call fails

    Also see the API Extension API Documentation

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as commercetools from "@pulumi/commercetools";
    import * as google from "@pulumi/google";
    
    // HTTP api extension
    const my_http_extension = new commercetools.ApiExtension("my-http-extension", {
        key: "my-http-extension-key",
        destination: {
            type: "HTTP",
            url: "https://example.com",
            authorizationHeader: "Basic 12345",
        },
        triggers: [{
            resourceTypeId: "customer",
            actions: [
                "Create",
                "Update",
            ],
        }],
    });
    // AWS Lambda api extension
    const my_awslambda_extension = new commercetools.ApiExtension("my-awslambda-extension", {
        key: "my-awslambda-extension-key",
        destination: {
            type: "awslambda",
            arn: "us-east-1:123456789012:mylambda",
            accessKey: "mykey",
            accessSecret: "mysecret",
        },
        triggers: [{
            resourceTypeId: "customer",
            actions: [
                "Create",
                "Update",
            ],
        }],
    });
    // Google Cloud Function api extension
    const my_googlecloudfunction_extension = new commercetools.ApiExtension("my-googlecloudfunction-extension", {
        key: "my-googlecloudfunction-extension-key",
        destination: {
            type: "googlecloudfunction",
            url: "https://example.com",
        },
        triggers: [{
            resourceTypeId: "customer",
            actions: [
                "Create",
                "Update",
            ],
        }],
    });
    const myCloudFunction = new google.index.CloudfunctionsFunction("my_cloud_function", {
        name: "function-test",
        description: "My function",
        runtime: "nodejs16",
    });
    const invoker = new google.index.CloudfunctionsFunctionIamMember("invoker", {
        project: "my-project",
        region: "europe-central2",
        cloudFunction: myCloudFunction.name,
        role: "roles/cloudfunctions.invoker",
        member: "serviceAccount:extensions@commercetools-platform.iam.gserviceaccount.com",
    });
    // An API extension which runs after another extension, expands references in the
    // payload and receives the state of the resource before the update
    const my_dependent_extension = new commercetools.ApiExtension("my-dependent-extension", {
        key: "my-dependent-extension-key",
        destination: {
            type: "HTTP",
            url: "https://example.com",
            authorizationHeader: "Basic 12345",
        },
        triggers: [{
            resourceTypeId: "cart",
            actions: [
                "Create",
                "Update",
            ],
        }],
        dependencies: [
            my_http_extension.key,
            "an-extension-managed-elsewhere",
        ],
        expansionPaths: [
            "lineItems[*].variant",
            "customerGroup",
        ],
        additionalContext: {
            includeOldResource: true,
        },
    });
    
    import pulumi
    import pulumi_commercetools as commercetools
    import pulumi_google as google
    
    # HTTP api extension
    my_http_extension = commercetools.ApiExtension("my-http-extension",
        key="my-http-extension-key",
        destination={
            "type": "HTTP",
            "url": "https://example.com",
            "authorization_header": "Basic 12345",
        },
        triggers=[{
            "resource_type_id": "customer",
            "actions": [
                "Create",
                "Update",
            ],
        }])
    # AWS Lambda api extension
    my_awslambda_extension = commercetools.ApiExtension("my-awslambda-extension",
        key="my-awslambda-extension-key",
        destination={
            "type": "awslambda",
            "arn": "us-east-1:123456789012:mylambda",
            "access_key": "mykey",
            "access_secret": "mysecret",
        },
        triggers=[{
            "resource_type_id": "customer",
            "actions": [
                "Create",
                "Update",
            ],
        }])
    # Google Cloud Function api extension
    my_googlecloudfunction_extension = commercetools.ApiExtension("my-googlecloudfunction-extension",
        key="my-googlecloudfunction-extension-key",
        destination={
            "type": "googlecloudfunction",
            "url": "https://example.com",
        },
        triggers=[{
            "resource_type_id": "customer",
            "actions": [
                "Create",
                "Update",
            ],
        }])
    my_cloud_function = google.index.CloudfunctionsFunction("my_cloud_function",
        name=function-test,
        description=My function,
        runtime=nodejs16)
    invoker = google.index.CloudfunctionsFunctionIamMember("invoker",
        project=my-project,
        region=europe-central2,
        cloud_function=my_cloud_function.name,
        role=roles/cloudfunctions.invoker,
        member=serviceAccount:extensions@commercetools-platform.iam.gserviceaccount.com)
    # An API extension which runs after another extension, expands references in the
    # payload and receives the state of the resource before the update
    my_dependent_extension = commercetools.ApiExtension("my-dependent-extension",
        key="my-dependent-extension-key",
        destination={
            "type": "HTTP",
            "url": "https://example.com",
            "authorization_header": "Basic 12345",
        },
        triggers=[{
            "resource_type_id": "cart",
            "actions": [
                "Create",
                "Update",
            ],
        }],
        dependencies=[
            my_http_extension.key,
            "an-extension-managed-elsewhere",
        ],
        expansion_paths=[
            "lineItems[*].variant",
            "customerGroup",
        ],
        additional_context={
            "include_old_resource": True,
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-google/sdk/go/google"
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/commercetools/commercetools"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// HTTP api extension
    		my_http_extension, err := commercetools.NewApiExtension(ctx, "my-http-extension", &commercetools.ApiExtensionArgs{
    			Key: pulumi.String("my-http-extension-key"),
    			Destination: &commercetools.ApiExtensionDestinationArgs{
    				Type:                pulumi.String("HTTP"),
    				Url:                 pulumi.String("https://example.com"),
    				AuthorizationHeader: pulumi.String("Basic 12345"),
    			},
    			Triggers: commercetools.ApiExtensionTriggerArray{
    				&commercetools.ApiExtensionTriggerArgs{
    					ResourceTypeId: pulumi.String("customer"),
    					Actions: pulumi.StringArray{
    						pulumi.String("Create"),
    						pulumi.String("Update"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// AWS Lambda api extension
    		_, err = commercetools.NewApiExtension(ctx, "my-awslambda-extension", &commercetools.ApiExtensionArgs{
    			Key: pulumi.String("my-awslambda-extension-key"),
    			Destination: &commercetools.ApiExtensionDestinationArgs{
    				Type:         pulumi.String("awslambda"),
    				Arn:          pulumi.String("us-east-1:123456789012:mylambda"),
    				AccessKey:    pulumi.String("mykey"),
    				AccessSecret: pulumi.String("mysecret"),
    			},
    			Triggers: commercetools.ApiExtensionTriggerArray{
    				&commercetools.ApiExtensionTriggerArgs{
    					ResourceTypeId: pulumi.String("customer"),
    					Actions: pulumi.StringArray{
    						pulumi.String("Create"),
    						pulumi.String("Update"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Google Cloud Function api extension
    		_, err = commercetools.NewApiExtension(ctx, "my-googlecloudfunction-extension", &commercetools.ApiExtensionArgs{
    			Key: pulumi.String("my-googlecloudfunction-extension-key"),
    			Destination: &commercetools.ApiExtensionDestinationArgs{
    				Type: pulumi.String("googlecloudfunction"),
    				Url:  pulumi.String("https://example.com"),
    			},
    			Triggers: commercetools.ApiExtensionTriggerArray{
    				&commercetools.ApiExtensionTriggerArgs{
    					ResourceTypeId: pulumi.String("customer"),
    					Actions: pulumi.StringArray{
    						pulumi.String("Create"),
    						pulumi.String("Update"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		myCloudFunction, err := google.NewCloudfunctionsFunction(ctx, "my_cloud_function", &google.CloudfunctionsFunctionArgs{
    			Name:        "function-test",
    			Description: "My function",
    			Runtime:     "nodejs16",
    		})
    		if err != nil {
    			return err
    		}
    		_, err = google.NewCloudfunctionsFunctionIamMember(ctx, "invoker", &google.CloudfunctionsFunctionIamMemberArgs{
    			Project:       "my-project",
    			Region:        "europe-central2",
    			CloudFunction: myCloudFunction.Name,
    			Role:          "roles/cloudfunctions.invoker",
    			Member:        "serviceAccount:extensions@commercetools-platform.iam.gserviceaccount.com",
    		})
    		if err != nil {
    			return err
    		}
    		// An API extension which runs after another extension, expands references in the
    		// payload and receives the state of the resource before the update
    		_, err = commercetools.NewApiExtension(ctx, "my-dependent-extension", &commercetools.ApiExtensionArgs{
    			Key: pulumi.String("my-dependent-extension-key"),
    			Destination: &commercetools.ApiExtensionDestinationArgs{
    				Type:                pulumi.String("HTTP"),
    				Url:                 pulumi.String("https://example.com"),
    				AuthorizationHeader: pulumi.String("Basic 12345"),
    			},
    			Triggers: commercetools.ApiExtensionTriggerArray{
    				&commercetools.ApiExtensionTriggerArgs{
    					ResourceTypeId: pulumi.String("cart"),
    					Actions: pulumi.StringArray{
    						pulumi.String("Create"),
    						pulumi.String("Update"),
    					},
    				},
    			},
    			Dependencies: pulumi.StringArray{
    				my_http_extension.Key,
    				pulumi.String("an-extension-managed-elsewhere"),
    			},
    			ExpansionPaths: pulumi.StringArray{
    				pulumi.String("lineItems[*].variant"),
    				pulumi.String("customerGroup"),
    			},
    			AdditionalContext: &commercetools.ApiExtensionAdditionalContextArgs{
    				IncludeOldResource: pulumi.Bool(true),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Commercetools = Pulumi.Commercetools;
    using Google = Pulumi.Google;
    
    return await Deployment.RunAsync(() => 
    {
        // HTTP api extension
        var my_http_extension = new Commercetools.ApiExtension("my-http-extension", new()
        {
            Key = "my-http-extension-key",
            Destination = new Commercetools.Inputs.ApiExtensionDestinationArgs
            {
                Type = "HTTP",
                Url = "https://example.com",
                AuthorizationHeader = "Basic 12345",
            },
            Triggers = new[]
            {
                new Commercetools.Inputs.ApiExtensionTriggerArgs
                {
                    ResourceTypeId = "customer",
                    Actions = new[]
                    {
                        "Create",
                        "Update",
                    },
                },
            },
        });
    
        // AWS Lambda api extension
        var my_awslambda_extension = new Commercetools.ApiExtension("my-awslambda-extension", new()
        {
            Key = "my-awslambda-extension-key",
            Destination = new Commercetools.Inputs.ApiExtensionDestinationArgs
            {
                Type = "awslambda",
                Arn = "us-east-1:123456789012:mylambda",
                AccessKey = "mykey",
                AccessSecret = "mysecret",
            },
            Triggers = new[]
            {
                new Commercetools.Inputs.ApiExtensionTriggerArgs
                {
                    ResourceTypeId = "customer",
                    Actions = new[]
                    {
                        "Create",
                        "Update",
                    },
                },
            },
        });
    
        // Google Cloud Function api extension
        var my_googlecloudfunction_extension = new Commercetools.ApiExtension("my-googlecloudfunction-extension", new()
        {
            Key = "my-googlecloudfunction-extension-key",
            Destination = new Commercetools.Inputs.ApiExtensionDestinationArgs
            {
                Type = "googlecloudfunction",
                Url = "https://example.com",
            },
            Triggers = new[]
            {
                new Commercetools.Inputs.ApiExtensionTriggerArgs
                {
                    ResourceTypeId = "customer",
                    Actions = new[]
                    {
                        "Create",
                        "Update",
                    },
                },
            },
        });
    
        var myCloudFunction = new Google.Index.CloudfunctionsFunction("my_cloud_function", new()
        {
            Name = "function-test",
            Description = "My function",
            Runtime = "nodejs16",
        });
    
        var invoker = new Google.Index.CloudfunctionsFunctionIamMember("invoker", new()
        {
            Project = "my-project",
            Region = "europe-central2",
            CloudFunction = myCloudFunction.Name,
            Role = "roles/cloudfunctions.invoker",
            Member = "serviceAccount:extensions@commercetools-platform.iam.gserviceaccount.com",
        });
    
        // An API extension which runs after another extension, expands references in the
        // payload and receives the state of the resource before the update
        var my_dependent_extension = new Commercetools.ApiExtension("my-dependent-extension", new()
        {
            Key = "my-dependent-extension-key",
            Destination = new Commercetools.Inputs.ApiExtensionDestinationArgs
            {
                Type = "HTTP",
                Url = "https://example.com",
                AuthorizationHeader = "Basic 12345",
            },
            Triggers = new[]
            {
                new Commercetools.Inputs.ApiExtensionTriggerArgs
                {
                    ResourceTypeId = "cart",
                    Actions = new[]
                    {
                        "Create",
                        "Update",
                    },
                },
            },
            Dependencies = new[]
            {
                my_http_extension.Key,
                "an-extension-managed-elsewhere",
            },
            ExpansionPaths = new[]
            {
                "lineItems[*].variant",
                "customerGroup",
            },
            AdditionalContext = new Commercetools.Inputs.ApiExtensionAdditionalContextArgs
            {
                IncludeOldResource = true,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.commercetools.ApiExtension;
    import com.pulumi.commercetools.ApiExtensionArgs;
    import com.pulumi.commercetools.inputs.ApiExtensionDestinationArgs;
    import com.pulumi.commercetools.inputs.ApiExtensionTriggerArgs;
    import com.pulumi.google.CloudfunctionsFunction;
    import com.pulumi.google.CloudfunctionsFunctionArgs;
    import com.pulumi.google.CloudfunctionsFunctionIamMember;
    import com.pulumi.google.CloudfunctionsFunctionIamMemberArgs;
    import com.pulumi.commercetools.inputs.ApiExtensionAdditionalContextArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            // HTTP api extension
            var my_http_extension = new ApiExtension("my-http-extension", ApiExtensionArgs.builder()
                .key("my-http-extension-key")
                .destination(ApiExtensionDestinationArgs.builder()
                    .type("HTTP")
                    .url("https://example.com")
                    .authorizationHeader("Basic 12345")
                    .build())
                .triggers(ApiExtensionTriggerArgs.builder()
                    .resourceTypeId("customer")
                    .actions(                
                        "Create",
                        "Update")
                    .build())
                .build());
    
            // AWS Lambda api extension
            var my_awslambda_extension = new ApiExtension("my-awslambda-extension", ApiExtensionArgs.builder()
                .key("my-awslambda-extension-key")
                .destination(ApiExtensionDestinationArgs.builder()
                    .type("awslambda")
                    .arn("us-east-1:123456789012:mylambda")
                    .accessKey("mykey")
                    .accessSecret("mysecret")
                    .build())
                .triggers(ApiExtensionTriggerArgs.builder()
                    .resourceTypeId("customer")
                    .actions(                
                        "Create",
                        "Update")
                    .build())
                .build());
    
            // Google Cloud Function api extension
            var my_googlecloudfunction_extension = new ApiExtension("my-googlecloudfunction-extension", ApiExtensionArgs.builder()
                .key("my-googlecloudfunction-extension-key")
                .destination(ApiExtensionDestinationArgs.builder()
                    .type("googlecloudfunction")
                    .url("https://example.com")
                    .build())
                .triggers(ApiExtensionTriggerArgs.builder()
                    .resourceTypeId("customer")
                    .actions(                
                        "Create",
                        "Update")
                    .build())
                .build());
    
            var myCloudFunction = new CloudfunctionsFunction("myCloudFunction", CloudfunctionsFunctionArgs.builder()
                .name("function-test")
                .description("My function")
                .runtime("nodejs16")
                .build());
    
            var invoker = new CloudfunctionsFunctionIamMember("invoker", CloudfunctionsFunctionIamMemberArgs.builder()
                .project("my-project")
                .region("europe-central2")
                .cloudFunction(myCloudFunction.name())
                .role("roles/cloudfunctions.invoker")
                .member("serviceAccount:extensions@commercetools-platform.iam.gserviceaccount.com")
                .build());
    
            // An API extension which runs after another extension, expands references in the
            // payload and receives the state of the resource before the update
            var my_dependent_extension = new ApiExtension("my-dependent-extension", ApiExtensionArgs.builder()
                .key("my-dependent-extension-key")
                .destination(ApiExtensionDestinationArgs.builder()
                    .type("HTTP")
                    .url("https://example.com")
                    .authorizationHeader("Basic 12345")
                    .build())
                .triggers(ApiExtensionTriggerArgs.builder()
                    .resourceTypeId("cart")
                    .actions(                
                        "Create",
                        "Update")
                    .build())
                .dependencies(            
                    my_http_extension.key(),
                    "an-extension-managed-elsewhere")
                .expansionPaths(            
                    "lineItems[*].variant",
                    "customerGroup")
                .additionalContext(ApiExtensionAdditionalContextArgs.builder()
                    .includeOldResource(true)
                    .build())
                .build());
    
        }
    }
    
    resources:
      # HTTP api extension
      my-http-extension:
        type: commercetools:ApiExtension
        properties:
          key: my-http-extension-key
          destination:
            type: HTTP
            url: https://example.com
            authorizationHeader: Basic 12345
          triggers:
            - resourceTypeId: customer
              actions:
                - Create
                - Update
      # AWS Lambda api extension
      my-awslambda-extension:
        type: commercetools:ApiExtension
        properties:
          key: my-awslambda-extension-key
          destination:
            type: awslambda
            arn: us-east-1:123456789012:mylambda
            accessKey: mykey
            accessSecret: mysecret
          triggers:
            - resourceTypeId: customer
              actions:
                - Create
                - Update
      # Google Cloud Function api extension
      my-googlecloudfunction-extension:
        type: commercetools:ApiExtension
        properties:
          key: my-googlecloudfunction-extension-key
          destination:
            type: googlecloudfunction
            url: https://example.com
          triggers:
            - resourceTypeId: customer
              actions:
                - Create
                - Update
      myCloudFunction:
        type: google:CloudfunctionsFunction
        name: my_cloud_function
        properties:
          name: function-test
          description: My function
          runtime: nodejs16
      invoker:
        type: google:CloudfunctionsFunctionIamMember
        properties:
          project: my-project
          region: europe-central2
          cloudFunction: ${myCloudFunction.name}
          role: roles/cloudfunctions.invoker
          member: serviceAccount:extensions@commercetools-platform.iam.gserviceaccount.com
      # An API extension which runs after another extension, expands references in the
      # payload and receives the state of the resource before the update
      my-dependent-extension:
        type: commercetools:ApiExtension
        properties:
          key: my-dependent-extension-key
          destination:
            type: HTTP
            url: https://example.com
            authorizationHeader: Basic 12345
          triggers:
            - resourceTypeId: cart
              actions:
                - Create
                - Update
          dependencies:
            - ${["my-http-extension"].key}
            - an-extension-managed-elsewhere
          expansionPaths:
            - lineItems[*].variant
            - customerGroup
          additionalContext:
            includeOldResource: true
    
    Example coming soon!
    

    Create ApiExtension Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ApiExtension(name: string, args: ApiExtensionArgs, opts?: CustomResourceOptions);
    @overload
    def ApiExtension(resource_name: str,
                     args: ApiExtensionArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApiExtension(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     destination: Optional[ApiExtensionDestinationArgs] = None,
                     triggers: Optional[Sequence[ApiExtensionTriggerArgs]] = None,
                     additional_context: Optional[ApiExtensionAdditionalContextArgs] = None,
                     api_extension_id: Optional[str] = None,
                     dependencies: Optional[Sequence[str]] = None,
                     expansion_paths: Optional[Sequence[str]] = None,
                     key: Optional[str] = None,
                     timeout_in_ms: Optional[float] = None)
    func NewApiExtension(ctx *Context, name string, args ApiExtensionArgs, opts ...ResourceOption) (*ApiExtension, error)
    public ApiExtension(string name, ApiExtensionArgs args, CustomResourceOptions? opts = null)
    public ApiExtension(String name, ApiExtensionArgs args)
    public ApiExtension(String name, ApiExtensionArgs args, CustomResourceOptions options)
    
    type: commercetools:ApiExtension
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "commercetools_api_extension" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ApiExtensionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ApiExtensionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ApiExtensionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApiExtensionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApiExtensionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var apiExtensionResource = new Commercetools.ApiExtension("apiExtensionResource", new()
    {
        Destination = new Commercetools.Inputs.ApiExtensionDestinationArgs
        {
            Type = "string",
            AccessKey = "string",
            AccessSecret = "string",
            Arn = "string",
            AuthorizationHeader = "string",
            AzureAuthentication = "string",
            Url = "string",
        },
        Triggers = new[]
        {
            new Commercetools.Inputs.ApiExtensionTriggerArgs
            {
                Actions = new[]
                {
                    "string",
                },
                ResourceTypeId = "string",
                Condition = "string",
            },
        },
        AdditionalContext = new Commercetools.Inputs.ApiExtensionAdditionalContextArgs
        {
            IncludeOldResource = false,
        },
        ApiExtensionId = "string",
        Dependencies = new[]
        {
            "string",
        },
        ExpansionPaths = new[]
        {
            "string",
        },
        Key = "string",
        TimeoutInMs = 0.0,
    });
    
    example, err := commercetools.NewApiExtension(ctx, "apiExtensionResource", &commercetools.ApiExtensionArgs{
    	Destination: &commercetools.ApiExtensionDestinationArgs{
    		Type:                pulumi.String("string"),
    		AccessKey:           pulumi.String("string"),
    		AccessSecret:        pulumi.String("string"),
    		Arn:                 pulumi.String("string"),
    		AuthorizationHeader: pulumi.String("string"),
    		AzureAuthentication: pulumi.String("string"),
    		Url:                 pulumi.String("string"),
    	},
    	Triggers: commercetools.ApiExtensionTriggerArray{
    		&commercetools.ApiExtensionTriggerArgs{
    			Actions: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			ResourceTypeId: pulumi.String("string"),
    			Condition:      pulumi.String("string"),
    		},
    	},
    	AdditionalContext: &commercetools.ApiExtensionAdditionalContextArgs{
    		IncludeOldResource: pulumi.Bool(false),
    	},
    	ApiExtensionId: pulumi.String("string"),
    	Dependencies: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ExpansionPaths: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Key:         pulumi.String("string"),
    	TimeoutInMs: pulumi.Float64(0),
    })
    
    resource "commercetools_api_extension" "apiExtensionResource" {
      lifecycle {
        create_before_destroy = true
      }
      destination = {
        type                 = "string"
        access_key           = "string"
        access_secret        = "string"
        arn                  = "string"
        authorization_header = "string"
        azure_authentication = "string"
        url                  = "string"
      }
      triggers {
        actions          = ["string"]
        resource_type_id = "string"
        condition        = "string"
      }
      additional_context = {
        include_old_resource = false
      }
      api_extension_id = "string"
      dependencies     = ["string"]
      expansion_paths  = ["string"]
      key              = "string"
      timeout_in_ms    = 0
    }
    
    var apiExtensionResource = new ApiExtension("apiExtensionResource", ApiExtensionArgs.builder()
        .destination(ApiExtensionDestinationArgs.builder()
            .type("string")
            .accessKey("string")
            .accessSecret("string")
            .arn("string")
            .authorizationHeader("string")
            .azureAuthentication("string")
            .url("string")
            .build())
        .triggers(ApiExtensionTriggerArgs.builder()
            .actions("string")
            .resourceTypeId("string")
            .condition("string")
            .build())
        .additionalContext(ApiExtensionAdditionalContextArgs.builder()
            .includeOldResource(false)
            .build())
        .apiExtensionId("string")
        .dependencies("string")
        .expansionPaths("string")
        .key("string")
        .timeoutInMs(0.0)
        .build());
    
    api_extension_resource = commercetools.ApiExtension("apiExtensionResource",
        destination={
            "type": "string",
            "access_key": "string",
            "access_secret": "string",
            "arn": "string",
            "authorization_header": "string",
            "azure_authentication": "string",
            "url": "string",
        },
        triggers=[{
            "actions": ["string"],
            "resource_type_id": "string",
            "condition": "string",
        }],
        additional_context={
            "include_old_resource": False,
        },
        api_extension_id="string",
        dependencies=["string"],
        expansion_paths=["string"],
        key="string",
        timeout_in_ms=float(0))
    
    const apiExtensionResource = new commercetools.ApiExtension("apiExtensionResource", {
        destination: {
            type: "string",
            accessKey: "string",
            accessSecret: "string",
            arn: "string",
            authorizationHeader: "string",
            azureAuthentication: "string",
            url: "string",
        },
        triggers: [{
            actions: ["string"],
            resourceTypeId: "string",
            condition: "string",
        }],
        additionalContext: {
            includeOldResource: false,
        },
        apiExtensionId: "string",
        dependencies: ["string"],
        expansionPaths: ["string"],
        key: "string",
        timeoutInMs: 0,
    });
    
    type: commercetools:ApiExtension
    properties:
        additionalContext:
            includeOldResource: false
        apiExtensionId: string
        dependencies:
            - string
        destination:
            accessKey: string
            accessSecret: string
            arn: string
            authorizationHeader: string
            azureAuthentication: string
            type: string
            url: string
        expansionPaths:
            - string
        key: string
        timeoutInMs: 0
        triggers:
            - actions:
                - string
              condition: string
              resourceTypeId: string
    

    ApiExtension Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ApiExtension resource accepts the following input properties:

    Destination ApiExtensionDestination
    Destination Details where the extension can be reached
    Triggers List<ApiExtensionTrigger>
    Array of Trigger Describes what triggers the extension
    AdditionalContext ApiExtensionAdditionalContext
    Configures additional information included in the payload sent to the API Extension
    ApiExtensionId string
    The ID of this resource.
    Dependencies List<string>
    ExpansionPaths List<string>
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    Key string
    User-specific unique identifier for the extension
    TimeoutInMs double
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    Destination ApiExtensionDestinationArgs
    Destination Details where the extension can be reached
    Triggers []ApiExtensionTriggerArgs
    Array of Trigger Describes what triggers the extension
    AdditionalContext ApiExtensionAdditionalContextArgs
    Configures additional information included in the payload sent to the API Extension
    ApiExtensionId string
    The ID of this resource.
    Dependencies []string
    ExpansionPaths []string
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    Key string
    User-specific unique identifier for the extension
    TimeoutInMs float64
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    destination object
    Destination Details where the extension can be reached
    triggers list(object)
    Array of Trigger Describes what triggers the extension
    additional_context object
    Configures additional information included in the payload sent to the API Extension
    api_extension_id string
    The ID of this resource.
    dependencies list(string)
    expansion_paths list(string)
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    key string
    User-specific unique identifier for the extension
    timeout_in_ms number
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    destination ApiExtensionDestination
    Destination Details where the extension can be reached
    triggers List<ApiExtensionTrigger>
    Array of Trigger Describes what triggers the extension
    additionalContext ApiExtensionAdditionalContext
    Configures additional information included in the payload sent to the API Extension
    apiExtensionId String
    The ID of this resource.
    dependencies List<String>
    expansionPaths List<String>
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    key String
    User-specific unique identifier for the extension
    timeoutInMs Double
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    destination ApiExtensionDestination
    Destination Details where the extension can be reached
    triggers ApiExtensionTrigger[]
    Array of Trigger Describes what triggers the extension
    additionalContext ApiExtensionAdditionalContext
    Configures additional information included in the payload sent to the API Extension
    apiExtensionId string
    The ID of this resource.
    dependencies string[]
    expansionPaths string[]
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    key string
    User-specific unique identifier for the extension
    timeoutInMs number
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    destination ApiExtensionDestinationArgs
    Destination Details where the extension can be reached
    triggers Sequence[ApiExtensionTriggerArgs]
    Array of Trigger Describes what triggers the extension
    additional_context ApiExtensionAdditionalContextArgs
    Configures additional information included in the payload sent to the API Extension
    api_extension_id str
    The ID of this resource.
    dependencies Sequence[str]
    expansion_paths Sequence[str]
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    key str
    User-specific unique identifier for the extension
    timeout_in_ms float
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    destination Property Map
    Destination Details where the extension can be reached
    triggers List<Property Map>
    Array of Trigger Describes what triggers the extension
    additionalContext Property Map
    Configures additional information included in the payload sent to the API Extension
    apiExtensionId String
    The ID of this resource.
    dependencies List<String>
    expansionPaths List<String>
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    key String
    User-specific unique identifier for the extension
    timeoutInMs Number
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ApiExtension resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Version double
    Id string
    The provider-assigned unique ID for this managed resource.
    Version float64
    id string
    The provider-assigned unique ID for this managed resource.
    version number
    id String
    The provider-assigned unique ID for this managed resource.
    version Double
    id string
    The provider-assigned unique ID for this managed resource.
    version number
    id str
    The provider-assigned unique ID for this managed resource.
    version float
    id String
    The provider-assigned unique ID for this managed resource.
    version Number

    Look up Existing ApiExtension Resource

    Get an existing ApiExtension resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ApiExtensionState, opts?: CustomResourceOptions): ApiExtension
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            additional_context: Optional[ApiExtensionAdditionalContextArgs] = None,
            api_extension_id: Optional[str] = None,
            dependencies: Optional[Sequence[str]] = None,
            destination: Optional[ApiExtensionDestinationArgs] = None,
            expansion_paths: Optional[Sequence[str]] = None,
            key: Optional[str] = None,
            timeout_in_ms: Optional[float] = None,
            triggers: Optional[Sequence[ApiExtensionTriggerArgs]] = None,
            version: Optional[float] = None) -> ApiExtension
    func GetApiExtension(ctx *Context, name string, id IDInput, state *ApiExtensionState, opts ...ResourceOption) (*ApiExtension, error)
    public static ApiExtension Get(string name, Input<string> id, ApiExtensionState? state, CustomResourceOptions? opts = null)
    public static ApiExtension get(String name, Output<String> id, ApiExtensionState state, CustomResourceOptions options)
    resources:  existingApiExtension:    type: commercetools:ApiExtension    get:      id: ${id}
    import {
      to = commercetools_api_extension.example
      id = "${id}"
    }
    
    name string
    The unique name of the resulting resource.
    id Input<ID>
    The unique provider ID of the resource to look up.
    state ApiExtensionState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resulting resource.
    id str
    The unique provider ID of the resource to look up.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resulting resource.
    id IDInput
    The unique provider ID of the resource to look up.
    state ApiExtensionState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resulting resource.
    id Input<string>
    The unique provider ID of the resource to look up.
    state ApiExtensionState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resulting resource.
    id Output<String>
    The unique provider ID of the resource to look up.
    state ApiExtensionState
    Known property values the provider needs, along with the ID, to find the resource. Usually not required.
    options CustomResourceOptions
    Bag of options to control resource's behavior.
    The following state arguments are supported:
    AdditionalContext ApiExtensionAdditionalContext
    Configures additional information included in the payload sent to the API Extension
    ApiExtensionId string
    The ID of this resource.
    Dependencies List<string>
    Destination ApiExtensionDestination
    Destination Details where the extension can be reached
    ExpansionPaths List<string>
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    Key string
    User-specific unique identifier for the extension
    TimeoutInMs double
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    Triggers List<ApiExtensionTrigger>
    Array of Trigger Describes what triggers the extension
    Version double
    AdditionalContext ApiExtensionAdditionalContextArgs
    Configures additional information included in the payload sent to the API Extension
    ApiExtensionId string
    The ID of this resource.
    Dependencies []string
    Destination ApiExtensionDestinationArgs
    Destination Details where the extension can be reached
    ExpansionPaths []string
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    Key string
    User-specific unique identifier for the extension
    TimeoutInMs float64
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    Triggers []ApiExtensionTriggerArgs
    Array of Trigger Describes what triggers the extension
    Version float64
    additional_context object
    Configures additional information included in the payload sent to the API Extension
    api_extension_id string
    The ID of this resource.
    dependencies list(string)
    destination object
    Destination Details where the extension can be reached
    expansion_paths list(string)
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    key string
    User-specific unique identifier for the extension
    timeout_in_ms number
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    triggers list(object)
    Array of Trigger Describes what triggers the extension
    version number
    additionalContext ApiExtensionAdditionalContext
    Configures additional information included in the payload sent to the API Extension
    apiExtensionId String
    The ID of this resource.
    dependencies List<String>
    destination ApiExtensionDestination
    Destination Details where the extension can be reached
    expansionPaths List<String>
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    key String
    User-specific unique identifier for the extension
    timeoutInMs Double
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    triggers List<ApiExtensionTrigger>
    Array of Trigger Describes what triggers the extension
    version Double
    additionalContext ApiExtensionAdditionalContext
    Configures additional information included in the payload sent to the API Extension
    apiExtensionId string
    The ID of this resource.
    dependencies string[]
    destination ApiExtensionDestination
    Destination Details where the extension can be reached
    expansionPaths string[]
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    key string
    User-specific unique identifier for the extension
    timeoutInMs number
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    triggers ApiExtensionTrigger[]
    Array of Trigger Describes what triggers the extension
    version number
    additional_context ApiExtensionAdditionalContextArgs
    Configures additional information included in the payload sent to the API Extension
    api_extension_id str
    The ID of this resource.
    dependencies Sequence[str]
    destination ApiExtensionDestinationArgs
    Destination Details where the extension can be reached
    expansion_paths Sequence[str]
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    key str
    User-specific unique identifier for the extension
    timeout_in_ms float
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    triggers Sequence[ApiExtensionTriggerArgs]
    Array of Trigger Describes what triggers the extension
    version float
    additionalContext Property Map
    Configures additional information included in the payload sent to the API Extension
    apiExtensionId String
    The ID of this resource.
    dependencies List<String>
    destination Property Map
    Destination Details where the extension can be reached
    expansionPaths List<String>
    Expansion paths used for reference expansion of the payload. Be aware of the limits of this feature and its performance impact.
    key String
    User-specific unique identifier for the extension
    timeoutInMs Number
    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, including payment Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.
    triggers List<Property Map>
    Array of Trigger Describes what triggers the extension
    version Number

    Supporting Types

    ApiExtensionAdditionalContext, ApiExtensionAdditionalContextArgs

    IncludeOldResource bool
    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 never included.
    IncludeOldResource bool
    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 never included.
    include_old_resource bool
    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 never included.
    includeOldResource Boolean
    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 never included.
    includeOldResource boolean
    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 never included.
    include_old_resource bool
    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 never included.
    includeOldResource Boolean
    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 never included.

    ApiExtensionDestination, ApiExtensionDestinationArgs

    Type string
    AccessKey string
    AccessSecret string
    Arn string
    AuthorizationHeader string
    AzureAuthentication string
    Url string
    Type string
    AccessKey string
    AccessSecret string
    Arn string
    AuthorizationHeader string
    AzureAuthentication string
    Url string
    type string
    access_key string
    access_secret string
    arn string
    authorization_header string
    azure_authentication string
    url string
    type String
    accessKey String
    accessSecret String
    arn String
    authorizationHeader String
    azureAuthentication String
    url String
    type string
    accessKey string
    accessSecret string
    arn string
    authorizationHeader string
    azureAuthentication string
    url string
    type String
    accessKey String
    accessSecret String
    arn String
    authorizationHeader String
    azureAuthentication String
    url String

    ApiExtensionTrigger, ApiExtensionTriggerArgs

    Actions List<string>
    Currently, Create and Update are supported
    ResourceTypeId string
    The resource type that triggers the extension, for example cart, order, payment or recurring-order. See the ExtensionResourceTypeId documentation for all supported values
    Condition string
    Valid predicate that controls the conditions under which the API Extension is called.
    Actions []string
    Currently, Create and Update are supported
    ResourceTypeId string
    The resource type that triggers the extension, for example cart, order, payment or recurring-order. See the ExtensionResourceTypeId documentation for all supported values
    Condition string
    Valid predicate that controls the conditions under which the API Extension is called.
    actions list(string)
    Currently, Create and Update are supported
    resource_type_id string
    The resource type that triggers the extension, for example cart, order, payment or recurring-order. See the ExtensionResourceTypeId documentation for all supported values
    condition string
    Valid predicate that controls the conditions under which the API Extension is called.
    actions List<String>
    Currently, Create and Update are supported
    resourceTypeId String
    The resource type that triggers the extension, for example cart, order, payment or recurring-order. See the ExtensionResourceTypeId documentation for all supported values
    condition String
    Valid predicate that controls the conditions under which the API Extension is called.
    actions string[]
    Currently, Create and Update are supported
    resourceTypeId string
    The resource type that triggers the extension, for example cart, order, payment or recurring-order. See the ExtensionResourceTypeId documentation for all supported values
    condition string
    Valid predicate that controls the conditions under which the API Extension is called.
    actions Sequence[str]
    Currently, Create and Update are supported
    resource_type_id str
    The resource type that triggers the extension, for example cart, order, payment or recurring-order. See the ExtensionResourceTypeId documentation for all supported values
    condition str
    Valid predicate that controls the conditions under which the API Extension is called.
    actions List<String>
    Currently, Create and Update are supported
    resourceTypeId String
    The resource type that triggers the extension, for example cart, order, payment or recurring-order. See the ExtensionResourceTypeId documentation for all supported values
    condition String
    Valid predicate that controls the conditions under which the API Extension is called.

    Package Details

    Repository
    commercetools labd/terraform-provider-commercetools
    License
    Notes
    This Pulumi package is based on the commercetools Terraform Provider.
    commercetools
    Viewing docs for commercetools 1.23.2
    published on Tuesday, Oct 27, 2026 by labd

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial