1. Packages
  2. Commercetools Provider
  3. API Docs
  4. TaxCategory
commercetools 1.19.3 published on Friday, Apr 4, 2025 by labd

commercetools.TaxCategory

Explore with Pulumi AI

Tax Categories define how products are to be taxed in different countries.

See also the Tax Category API Documentation

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as commercetools from "@pulumi/commercetools";

const my_tax_category = new commercetools.TaxCategory("my-tax-category", {
    description: "Example category",
    key: "my-tax-category-key",
});
Copy
import pulumi
import pulumi_commercetools as commercetools

my_tax_category = commercetools.TaxCategory("my-tax-category",
    description="Example category",
    key="my-tax-category-key")
Copy
package main

import (
	"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 {
		_, err := commercetools.NewTaxCategory(ctx, "my-tax-category", &commercetools.TaxCategoryArgs{
			Description: pulumi.String("Example category"),
			Key:         pulumi.String("my-tax-category-key"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Commercetools = Pulumi.Commercetools;

return await Deployment.RunAsync(() => 
{
    var my_tax_category = new Commercetools.TaxCategory("my-tax-category", new()
    {
        Description = "Example category",
        Key = "my-tax-category-key",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.commercetools.TaxCategory;
import com.pulumi.commercetools.TaxCategoryArgs;
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) {
        var my_tax_category = new TaxCategory("my-tax-category", TaxCategoryArgs.builder()
            .description("Example category")
            .key("my-tax-category-key")
            .build());

    }
}
Copy
resources:
  my-tax-category:
    type: commercetools:TaxCategory
    properties:
      description: Example category
      key: my-tax-category-key
Copy

Create TaxCategory Resource

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

Constructor syntax

new TaxCategory(name: string, args?: TaxCategoryArgs, opts?: CustomResourceOptions);
@overload
def TaxCategory(resource_name: str,
                args: Optional[TaxCategoryArgs] = None,
                opts: Optional[ResourceOptions] = None)

@overload
def TaxCategory(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                description: Optional[str] = None,
                key: Optional[str] = None,
                name: Optional[str] = None,
                tax_category_id: Optional[str] = None)
func NewTaxCategory(ctx *Context, name string, args *TaxCategoryArgs, opts ...ResourceOption) (*TaxCategory, error)
public TaxCategory(string name, TaxCategoryArgs? args = null, CustomResourceOptions? opts = null)
public TaxCategory(String name, TaxCategoryArgs args)
public TaxCategory(String name, TaxCategoryArgs args, CustomResourceOptions options)
type: commercetools:TaxCategory
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args TaxCategoryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args TaxCategoryArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args TaxCategoryArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args TaxCategoryArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TaxCategoryArgs
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 taxCategoryResource = new Commercetools.TaxCategory("taxCategoryResource", new()
{
    Description = "string",
    Key = "string",
    Name = "string",
    TaxCategoryId = "string",
});
Copy
example, err := commercetools.NewTaxCategory(ctx, "taxCategoryResource", &commercetools.TaxCategoryArgs{
Description: pulumi.String("string"),
Key: pulumi.String("string"),
Name: pulumi.String("string"),
TaxCategoryId: pulumi.String("string"),
})
Copy
var taxCategoryResource = new TaxCategory("taxCategoryResource", TaxCategoryArgs.builder()
    .description("string")
    .key("string")
    .name("string")
    .taxCategoryId("string")
    .build());
Copy
tax_category_resource = commercetools.TaxCategory("taxCategoryResource",
    description="string",
    key="string",
    name="string",
    tax_category_id="string")
Copy
const taxCategoryResource = new commercetools.TaxCategory("taxCategoryResource", {
    description: "string",
    key: "string",
    name: "string",
    taxCategoryId: "string",
});
Copy
type: commercetools:TaxCategory
properties:
    description: string
    key: string
    name: string
    taxCategoryId: string
Copy

TaxCategory 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 TaxCategory resource accepts the following input properties:

Description string
Key string
User-specific unique identifier for the tax category
Name string
TaxCategoryId string
The ID of this resource.
Description string
Key string
User-specific unique identifier for the tax category
Name string
TaxCategoryId string
The ID of this resource.
description String
key String
User-specific unique identifier for the tax category
name String
taxCategoryId String
The ID of this resource.
description string
key string
User-specific unique identifier for the tax category
name string
taxCategoryId string
The ID of this resource.
description str
key str
User-specific unique identifier for the tax category
name str
tax_category_id str
The ID of this resource.
description String
key String
User-specific unique identifier for the tax category
name String
taxCategoryId String
The ID of this resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the TaxCategory 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 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 TaxCategory Resource

Get an existing TaxCategory 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?: TaxCategoryState, opts?: CustomResourceOptions): TaxCategory
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        key: Optional[str] = None,
        name: Optional[str] = None,
        tax_category_id: Optional[str] = None,
        version: Optional[float] = None) -> TaxCategory
func GetTaxCategory(ctx *Context, name string, id IDInput, state *TaxCategoryState, opts ...ResourceOption) (*TaxCategory, error)
public static TaxCategory Get(string name, Input<string> id, TaxCategoryState? state, CustomResourceOptions? opts = null)
public static TaxCategory get(String name, Output<String> id, TaxCategoryState state, CustomResourceOptions options)
resources:  _:    type: commercetools:TaxCategory    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Description string
Key string
User-specific unique identifier for the tax category
Name string
TaxCategoryId string
The ID of this resource.
Version double
Description string
Key string
User-specific unique identifier for the tax category
Name string
TaxCategoryId string
The ID of this resource.
Version float64
description String
key String
User-specific unique identifier for the tax category
name String
taxCategoryId String
The ID of this resource.
version Double
description string
key string
User-specific unique identifier for the tax category
name string
taxCategoryId string
The ID of this resource.
version number
description str
key str
User-specific unique identifier for the tax category
name str
tax_category_id str
The ID of this resource.
version float
description String
key String
User-specific unique identifier for the tax category
name String
taxCategoryId String
The ID of this resource.
version Number

Package Details

Repository
commercetools labd/terraform-provider-commercetools
License
Notes
This Pulumi package is based on the commercetools Terraform Provider.