commercetools.CartDiscount
Explore with Pulumi AI
Cart discounts are used to change the prices of different elements within a cart.
See also the Cart Discount API Documentation
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as commercetools from "@pulumi/commercetools";
// With target multiBuyCustomLineItems and discount value relative
const my_cart_discount = new commercetools.CartDiscount("my-cart-discount", {
    key: "my-cart-discount-key",
    name: {
        en: "My Discount name",
    },
    predicate: "any-predicate",
    sortOrder: "0.8",
    target: {
        discountedQuantity: 1,
        maxOccurrence: 1,
        predicate: "1=1",
        selectionMode: "MostExpensive",
        triggerQuantity: 2,
        type: "multiBuyCustomLineItems",
    },
    value: {
        permyriad: 1000,
        type: "relative",
    },
});
import pulumi
import pulumi_commercetools as commercetools
# With target multiBuyCustomLineItems and discount value relative
my_cart_discount = commercetools.CartDiscount("my-cart-discount",
    key="my-cart-discount-key",
    name={
        "en": "My Discount name",
    },
    predicate="any-predicate",
    sort_order="0.8",
    target={
        "discounted_quantity": 1,
        "max_occurrence": 1,
        "predicate": "1=1",
        "selection_mode": "MostExpensive",
        "trigger_quantity": 2,
        "type": "multiBuyCustomLineItems",
    },
    value={
        "permyriad": 1000,
        "type": "relative",
    })
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 {
		// With target multiBuyCustomLineItems and discount value relative
		_, err := commercetools.NewCartDiscount(ctx, "my-cart-discount", &commercetools.CartDiscountArgs{
			Key: pulumi.String("my-cart-discount-key"),
			Name: pulumi.StringMap{
				"en": pulumi.String("My Discount name"),
			},
			Predicate: pulumi.String("any-predicate"),
			SortOrder: pulumi.String("0.8"),
			Target: &commercetools.CartDiscountTargetArgs{
				DiscountedQuantity: pulumi.Float64(1),
				MaxOccurrence:      pulumi.Float64(1),
				Predicate:          pulumi.String("1=1"),
				SelectionMode:      pulumi.String("MostExpensive"),
				TriggerQuantity:    pulumi.Float64(2),
				Type:               pulumi.String("multiBuyCustomLineItems"),
			},
			Value: &commercetools.CartDiscountValueArgs{
				Permyriad: pulumi.Float64(1000),
				Type:      pulumi.String("relative"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Commercetools = Pulumi.Commercetools;
return await Deployment.RunAsync(() => 
{
    // With target multiBuyCustomLineItems and discount value relative
    var my_cart_discount = new Commercetools.CartDiscount("my-cart-discount", new()
    {
        Key = "my-cart-discount-key",
        Name = 
        {
            { "en", "My Discount name" },
        },
        Predicate = "any-predicate",
        SortOrder = "0.8",
        Target = new Commercetools.Inputs.CartDiscountTargetArgs
        {
            DiscountedQuantity = 1,
            MaxOccurrence = 1,
            Predicate = "1=1",
            SelectionMode = "MostExpensive",
            TriggerQuantity = 2,
            Type = "multiBuyCustomLineItems",
        },
        Value = new Commercetools.Inputs.CartDiscountValueArgs
        {
            Permyriad = 1000,
            Type = "relative",
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.commercetools.CartDiscount;
import com.pulumi.commercetools.CartDiscountArgs;
import com.pulumi.commercetools.inputs.CartDiscountTargetArgs;
import com.pulumi.commercetools.inputs.CartDiscountValueArgs;
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) {
        // With target multiBuyCustomLineItems and discount value relative
        var my_cart_discount = new CartDiscount("my-cart-discount", CartDiscountArgs.builder()
            .key("my-cart-discount-key")
            .name(Map.of("en", "My Discount name"))
            .predicate("any-predicate")
            .sortOrder("0.8")
            .target(CartDiscountTargetArgs.builder()
                .discountedQuantity("1")
                .maxOccurrence("1")
                .predicate("1=1")
                .selectionMode("MostExpensive")
                .triggerQuantity("2")
                .type("multiBuyCustomLineItems")
                .build())
            .value(CartDiscountValueArgs.builder()
                .permyriad(1000)
                .type("relative")
                .build())
            .build());
    }
}
resources:
  # With target multiBuyCustomLineItems and discount value relative
  my-cart-discount:
    type: commercetools:CartDiscount
    properties:
      key: my-cart-discount-key
      name:
        en: My Discount name
      predicate: any-predicate
      sortOrder: '0.8'
      target:
        discountedQuantity: '1'
        maxOccurrence: '1'
        predicate: 1=1
        selectionMode: MostExpensive
        triggerQuantity: '2'
        type: multiBuyCustomLineItems
      value:
        permyriad: 1000
        type: relative
Create CartDiscount Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CartDiscount(name: string, args: CartDiscountArgs, opts?: CustomResourceOptions);@overload
def CartDiscount(resource_name: str,
                 args: CartDiscountArgs,
                 opts: Optional[ResourceOptions] = None)
@overload
def CartDiscount(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 name: Optional[Mapping[str, str]] = None,
                 value: Optional[CartDiscountValueArgs] = None,
                 sort_order: Optional[str] = None,
                 predicate: Optional[str] = None,
                 is_active: Optional[bool] = None,
                 key: Optional[str] = None,
                 cart_discount_id: Optional[str] = None,
                 requires_discount_code: Optional[bool] = None,
                 description: Optional[Mapping[str, str]] = None,
                 stacking_mode: Optional[str] = None,
                 stores: Optional[Sequence[str]] = None,
                 target: Optional[CartDiscountTargetArgs] = None,
                 valid_from: Optional[str] = None,
                 valid_until: Optional[str] = None,
                 custom: Optional[CartDiscountCustomArgs] = None)func NewCartDiscount(ctx *Context, name string, args CartDiscountArgs, opts ...ResourceOption) (*CartDiscount, error)public CartDiscount(string name, CartDiscountArgs args, CustomResourceOptions? opts = null)
public CartDiscount(String name, CartDiscountArgs args)
public CartDiscount(String name, CartDiscountArgs args, CustomResourceOptions options)
type: commercetools:CartDiscount
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args CartDiscountArgs
- 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 CartDiscountArgs
- 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 CartDiscountArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CartDiscountArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CartDiscountArgs
- 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 cartDiscountResource = new Commercetools.CartDiscount("cartDiscountResource", new()
{
    Name = 
    {
        { "string", "string" },
    },
    Value = new Commercetools.Inputs.CartDiscountValueArgs
    {
        Type = "string",
        DistributionChannelId = "string",
        Monies = new[]
        {
            new Commercetools.Inputs.CartDiscountValueMoneyArgs
            {
                CentAmount = 0,
                CurrencyCode = "string",
            },
        },
        Permyriad = 0,
        ProductId = "string",
        SupplyChannelId = "string",
        VariantId = 0,
    },
    SortOrder = "string",
    Predicate = "string",
    IsActive = false,
    Key = "string",
    CartDiscountId = "string",
    RequiresDiscountCode = false,
    Description = 
    {
        { "string", "string" },
    },
    StackingMode = "string",
    Stores = new[]
    {
        "string",
    },
    Target = new Commercetools.Inputs.CartDiscountTargetArgs
    {
        Type = "string",
        DiscountedQuantity = 0,
        MaxOccurrence = 0,
        Predicate = "string",
        SelectionMode = "string",
        TriggerQuantity = 0,
    },
    ValidFrom = "string",
    ValidUntil = "string",
    Custom = new Commercetools.Inputs.CartDiscountCustomArgs
    {
        TypeId = "string",
        Fields = 
        {
            { "string", "string" },
        },
    },
});
example, err := commercetools.NewCartDiscount(ctx, "cartDiscountResource", &commercetools.CartDiscountArgs{
Name: pulumi.StringMap{
"string": pulumi.String("string"),
},
Value: &.CartDiscountValueArgs{
Type: pulumi.String("string"),
DistributionChannelId: pulumi.String("string"),
Monies: .CartDiscountValueMoneyArray{
&.CartDiscountValueMoneyArgs{
CentAmount: pulumi.Float64(0),
CurrencyCode: pulumi.String("string"),
},
},
Permyriad: pulumi.Float64(0),
ProductId: pulumi.String("string"),
SupplyChannelId: pulumi.String("string"),
VariantId: pulumi.Float64(0),
},
SortOrder: pulumi.String("string"),
Predicate: pulumi.String("string"),
IsActive: pulumi.Bool(false),
Key: pulumi.String("string"),
CartDiscountId: pulumi.String("string"),
RequiresDiscountCode: pulumi.Bool(false),
Description: pulumi.StringMap{
"string": pulumi.String("string"),
},
StackingMode: pulumi.String("string"),
Stores: pulumi.StringArray{
pulumi.String("string"),
},
Target: &.CartDiscountTargetArgs{
Type: pulumi.String("string"),
DiscountedQuantity: pulumi.Float64(0),
MaxOccurrence: pulumi.Float64(0),
Predicate: pulumi.String("string"),
SelectionMode: pulumi.String("string"),
TriggerQuantity: pulumi.Float64(0),
},
ValidFrom: pulumi.String("string"),
ValidUntil: pulumi.String("string"),
Custom: &.CartDiscountCustomArgs{
TypeId: pulumi.String("string"),
Fields: pulumi.StringMap{
"string": pulumi.String("string"),
},
},
})
var cartDiscountResource = new CartDiscount("cartDiscountResource", CartDiscountArgs.builder()
    .name(Map.of("string", "string"))
    .value(CartDiscountValueArgs.builder()
        .type("string")
        .distributionChannelId("string")
        .monies(CartDiscountValueMoneyArgs.builder()
            .centAmount(0)
            .currencyCode("string")
            .build())
        .permyriad(0)
        .productId("string")
        .supplyChannelId("string")
        .variantId(0)
        .build())
    .sortOrder("string")
    .predicate("string")
    .isActive(false)
    .key("string")
    .cartDiscountId("string")
    .requiresDiscountCode(false)
    .description(Map.of("string", "string"))
    .stackingMode("string")
    .stores("string")
    .target(CartDiscountTargetArgs.builder()
        .type("string")
        .discountedQuantity(0)
        .maxOccurrence(0)
        .predicate("string")
        .selectionMode("string")
        .triggerQuantity(0)
        .build())
    .validFrom("string")
    .validUntil("string")
    .custom(CartDiscountCustomArgs.builder()
        .typeId("string")
        .fields(Map.of("string", "string"))
        .build())
    .build());
cart_discount_resource = commercetools.CartDiscount("cartDiscountResource",
    name={
        "string": "string",
    },
    value={
        "type": "string",
        "distribution_channel_id": "string",
        "monies": [{
            "cent_amount": 0,
            "currency_code": "string",
        }],
        "permyriad": 0,
        "product_id": "string",
        "supply_channel_id": "string",
        "variant_id": 0,
    },
    sort_order="string",
    predicate="string",
    is_active=False,
    key="string",
    cart_discount_id="string",
    requires_discount_code=False,
    description={
        "string": "string",
    },
    stacking_mode="string",
    stores=["string"],
    target={
        "type": "string",
        "discounted_quantity": 0,
        "max_occurrence": 0,
        "predicate": "string",
        "selection_mode": "string",
        "trigger_quantity": 0,
    },
    valid_from="string",
    valid_until="string",
    custom={
        "type_id": "string",
        "fields": {
            "string": "string",
        },
    })
const cartDiscountResource = new commercetools.CartDiscount("cartDiscountResource", {
    name: {
        string: "string",
    },
    value: {
        type: "string",
        distributionChannelId: "string",
        monies: [{
            centAmount: 0,
            currencyCode: "string",
        }],
        permyriad: 0,
        productId: "string",
        supplyChannelId: "string",
        variantId: 0,
    },
    sortOrder: "string",
    predicate: "string",
    isActive: false,
    key: "string",
    cartDiscountId: "string",
    requiresDiscountCode: false,
    description: {
        string: "string",
    },
    stackingMode: "string",
    stores: ["string"],
    target: {
        type: "string",
        discountedQuantity: 0,
        maxOccurrence: 0,
        predicate: "string",
        selectionMode: "string",
        triggerQuantity: 0,
    },
    validFrom: "string",
    validUntil: "string",
    custom: {
        typeId: "string",
        fields: {
            string: "string",
        },
    },
});
type: commercetools:CartDiscount
properties:
    cartDiscountId: string
    custom:
        fields:
            string: string
        typeId: string
    description:
        string: string
    isActive: false
    key: string
    name:
        string: string
    predicate: string
    requiresDiscountCode: false
    sortOrder: string
    stackingMode: string
    stores:
        - string
    target:
        discountedQuantity: 0
        maxOccurrence: 0
        predicate: string
        selectionMode: string
        triggerQuantity: 0
        type: string
    validFrom: string
    validUntil: string
    value:
        distributionChannelId: string
        monies:
            - centAmount: 0
              currencyCode: string
        permyriad: 0
        productId: string
        supplyChannelId: string
        type: string
        variantId: 0
CartDiscount 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 CartDiscount resource accepts the following input properties:
- Name Dictionary<string, string>
- LocalizedString
- Predicate string
- A valid Cart Predicate
- SortOrder string
- The string must contain a number between 0 and 1. All matching cart discounts are applied to a cart in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all cart discounts
- Value
CartDiscount Value 
- Defines the effect the discount will have. CartDiscountValue
- CartDiscount stringId 
- The ID of this resource.
- Custom
CartDiscount Custom 
- Description Dictionary<string, string>
- LocalizedString
- IsActive bool
- Only active discount can be applied to the cart
- Key string
- User-specific unique identifier for a cart discount. Must be unique across a project
- RequiresDiscount boolCode 
- States whether the discount can only be used in a connection with a DiscountCode
- StackingMode string
- Specifies whether the application of this discount causes the following discounts to be ignored. Can be either Stacking or StopAfterThisDiscount
- Stores List<string>
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store. Use store keys as references
- Target
CartDiscount Target 
- Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
- ValidFrom string
- ValidUntil string
- Name map[string]string
- LocalizedString
- Predicate string
- A valid Cart Predicate
- SortOrder string
- The string must contain a number between 0 and 1. All matching cart discounts are applied to a cart in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all cart discounts
- Value
CartDiscount Value Args 
- Defines the effect the discount will have. CartDiscountValue
- CartDiscount stringId 
- The ID of this resource.
- Custom
CartDiscount Custom Args 
- Description map[string]string
- LocalizedString
- IsActive bool
- Only active discount can be applied to the cart
- Key string
- User-specific unique identifier for a cart discount. Must be unique across a project
- RequiresDiscount boolCode 
- States whether the discount can only be used in a connection with a DiscountCode
- StackingMode string
- Specifies whether the application of this discount causes the following discounts to be ignored. Can be either Stacking or StopAfterThisDiscount
- Stores []string
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store. Use store keys as references
- Target
CartDiscount Target Args 
- Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
- ValidFrom string
- ValidUntil string
- name Map<String,String>
- LocalizedString
- predicate String
- A valid Cart Predicate
- sortOrder String
- The string must contain a number between 0 and 1. All matching cart discounts are applied to a cart in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all cart discounts
- value
CartDiscount Value 
- Defines the effect the discount will have. CartDiscountValue
- cartDiscount StringId 
- The ID of this resource.
- custom
CartDiscount Custom 
- description Map<String,String>
- LocalizedString
- isActive Boolean
- Only active discount can be applied to the cart
- key String
- User-specific unique identifier for a cart discount. Must be unique across a project
- requiresDiscount BooleanCode 
- States whether the discount can only be used in a connection with a DiscountCode
- stackingMode String
- Specifies whether the application of this discount causes the following discounts to be ignored. Can be either Stacking or StopAfterThisDiscount
- stores List<String>
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store. Use store keys as references
- target
CartDiscount Target 
- Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
- validFrom String
- validUntil String
- name {[key: string]: string}
- LocalizedString
- predicate string
- A valid Cart Predicate
- sortOrder string
- The string must contain a number between 0 and 1. All matching cart discounts are applied to a cart in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all cart discounts
- value
CartDiscount Value 
- Defines the effect the discount will have. CartDiscountValue
- cartDiscount stringId 
- The ID of this resource.
- custom
CartDiscount Custom 
- description {[key: string]: string}
- LocalizedString
- isActive boolean
- Only active discount can be applied to the cart
- key string
- User-specific unique identifier for a cart discount. Must be unique across a project
- requiresDiscount booleanCode 
- States whether the discount can only be used in a connection with a DiscountCode
- stackingMode string
- Specifies whether the application of this discount causes the following discounts to be ignored. Can be either Stacking or StopAfterThisDiscount
- stores string[]
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store. Use store keys as references
- target
CartDiscount Target 
- Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
- validFrom string
- validUntil string
- name Mapping[str, str]
- LocalizedString
- predicate str
- A valid Cart Predicate
- sort_order str
- The string must contain a number between 0 and 1. All matching cart discounts are applied to a cart in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all cart discounts
- value
CartDiscount Value Args 
- Defines the effect the discount will have. CartDiscountValue
- cart_discount_ strid 
- The ID of this resource.
- custom
CartDiscount Custom Args 
- description Mapping[str, str]
- LocalizedString
- is_active bool
- Only active discount can be applied to the cart
- key str
- User-specific unique identifier for a cart discount. Must be unique across a project
- requires_discount_ boolcode 
- States whether the discount can only be used in a connection with a DiscountCode
- stacking_mode str
- Specifies whether the application of this discount causes the following discounts to be ignored. Can be either Stacking or StopAfterThisDiscount
- stores Sequence[str]
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store. Use store keys as references
- target
CartDiscount Target Args 
- Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
- valid_from str
- valid_until str
- name Map<String>
- LocalizedString
- predicate String
- A valid Cart Predicate
- sortOrder String
- The string must contain a number between 0 and 1. All matching cart discounts are applied to a cart in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all cart discounts
- value Property Map
- Defines the effect the discount will have. CartDiscountValue
- cartDiscount StringId 
- The ID of this resource.
- custom Property Map
- description Map<String>
- LocalizedString
- isActive Boolean
- Only active discount can be applied to the cart
- key String
- User-specific unique identifier for a cart discount. Must be unique across a project
- requiresDiscount BooleanCode 
- States whether the discount can only be used in a connection with a DiscountCode
- stackingMode String
- Specifies whether the application of this discount causes the following discounts to be ignored. Can be either Stacking or StopAfterThisDiscount
- stores List<String>
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store. Use store keys as references
- target Property Map
- Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
- validFrom String
- validUntil String
Outputs
All input properties are implicitly available as output properties. Additionally, the CartDiscount resource produces the following output properties:
Look up Existing CartDiscount Resource
Get an existing CartDiscount 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?: CartDiscountState, opts?: CustomResourceOptions): CartDiscount@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cart_discount_id: Optional[str] = None,
        custom: Optional[CartDiscountCustomArgs] = None,
        description: Optional[Mapping[str, str]] = None,
        is_active: Optional[bool] = None,
        key: Optional[str] = None,
        name: Optional[Mapping[str, str]] = None,
        predicate: Optional[str] = None,
        requires_discount_code: Optional[bool] = None,
        sort_order: Optional[str] = None,
        stacking_mode: Optional[str] = None,
        stores: Optional[Sequence[str]] = None,
        target: Optional[CartDiscountTargetArgs] = None,
        valid_from: Optional[str] = None,
        valid_until: Optional[str] = None,
        value: Optional[CartDiscountValueArgs] = None,
        version: Optional[float] = None) -> CartDiscountfunc GetCartDiscount(ctx *Context, name string, id IDInput, state *CartDiscountState, opts ...ResourceOption) (*CartDiscount, error)public static CartDiscount Get(string name, Input<string> id, CartDiscountState? state, CustomResourceOptions? opts = null)public static CartDiscount get(String name, Output<String> id, CartDiscountState state, CustomResourceOptions options)resources:  _:    type: commercetools:CartDiscount    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- CartDiscount stringId 
- The ID of this resource.
- Custom
CartDiscount Custom 
- Description Dictionary<string, string>
- LocalizedString
- IsActive bool
- Only active discount can be applied to the cart
- Key string
- User-specific unique identifier for a cart discount. Must be unique across a project
- Name Dictionary<string, string>
- LocalizedString
- Predicate string
- A valid Cart Predicate
- RequiresDiscount boolCode 
- States whether the discount can only be used in a connection with a DiscountCode
- SortOrder string
- The string must contain a number between 0 and 1. All matching cart discounts are applied to a cart in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all cart discounts
- StackingMode string
- Specifies whether the application of this discount causes the following discounts to be ignored. Can be either Stacking or StopAfterThisDiscount
- Stores List<string>
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store. Use store keys as references
- Target
CartDiscount Target 
- Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
- ValidFrom string
- ValidUntil string
- Value
CartDiscount Value 
- Defines the effect the discount will have. CartDiscountValue
- Version double
- CartDiscount stringId 
- The ID of this resource.
- Custom
CartDiscount Custom Args 
- Description map[string]string
- LocalizedString
- IsActive bool
- Only active discount can be applied to the cart
- Key string
- User-specific unique identifier for a cart discount. Must be unique across a project
- Name map[string]string
- LocalizedString
- Predicate string
- A valid Cart Predicate
- RequiresDiscount boolCode 
- States whether the discount can only be used in a connection with a DiscountCode
- SortOrder string
- The string must contain a number between 0 and 1. All matching cart discounts are applied to a cart in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all cart discounts
- StackingMode string
- Specifies whether the application of this discount causes the following discounts to be ignored. Can be either Stacking or StopAfterThisDiscount
- Stores []string
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store. Use store keys as references
- Target
CartDiscount Target Args 
- Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
- ValidFrom string
- ValidUntil string
- Value
CartDiscount Value Args 
- Defines the effect the discount will have. CartDiscountValue
- Version float64
- cartDiscount StringId 
- The ID of this resource.
- custom
CartDiscount Custom 
- description Map<String,String>
- LocalizedString
- isActive Boolean
- Only active discount can be applied to the cart
- key String
- User-specific unique identifier for a cart discount. Must be unique across a project
- name Map<String,String>
- LocalizedString
- predicate String
- A valid Cart Predicate
- requiresDiscount BooleanCode 
- States whether the discount can only be used in a connection with a DiscountCode
- sortOrder String
- The string must contain a number between 0 and 1. All matching cart discounts are applied to a cart in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all cart discounts
- stackingMode String
- Specifies whether the application of this discount causes the following discounts to be ignored. Can be either Stacking or StopAfterThisDiscount
- stores List<String>
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store. Use store keys as references
- target
CartDiscount Target 
- Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
- validFrom String
- validUntil String
- value
CartDiscount Value 
- Defines the effect the discount will have. CartDiscountValue
- version Double
- cartDiscount stringId 
- The ID of this resource.
- custom
CartDiscount Custom 
- description {[key: string]: string}
- LocalizedString
- isActive boolean
- Only active discount can be applied to the cart
- key string
- User-specific unique identifier for a cart discount. Must be unique across a project
- name {[key: string]: string}
- LocalizedString
- predicate string
- A valid Cart Predicate
- requiresDiscount booleanCode 
- States whether the discount can only be used in a connection with a DiscountCode
- sortOrder string
- The string must contain a number between 0 and 1. All matching cart discounts are applied to a cart in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all cart discounts
- stackingMode string
- Specifies whether the application of this discount causes the following discounts to be ignored. Can be either Stacking or StopAfterThisDiscount
- stores string[]
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store. Use store keys as references
- target
CartDiscount Target 
- Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
- validFrom string
- validUntil string
- value
CartDiscount Value 
- Defines the effect the discount will have. CartDiscountValue
- version number
- cart_discount_ strid 
- The ID of this resource.
- custom
CartDiscount Custom Args 
- description Mapping[str, str]
- LocalizedString
- is_active bool
- Only active discount can be applied to the cart
- key str
- User-specific unique identifier for a cart discount. Must be unique across a project
- name Mapping[str, str]
- LocalizedString
- predicate str
- A valid Cart Predicate
- requires_discount_ boolcode 
- States whether the discount can only be used in a connection with a DiscountCode
- sort_order str
- The string must contain a number between 0 and 1. All matching cart discounts are applied to a cart in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all cart discounts
- stacking_mode str
- Specifies whether the application of this discount causes the following discounts to be ignored. Can be either Stacking or StopAfterThisDiscount
- stores Sequence[str]
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store. Use store keys as references
- target
CartDiscount Target Args 
- Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
- valid_from str
- valid_until str
- value
CartDiscount Value Args 
- Defines the effect the discount will have. CartDiscountValue
- version float
- cartDiscount StringId 
- The ID of this resource.
- custom Property Map
- description Map<String>
- LocalizedString
- isActive Boolean
- Only active discount can be applied to the cart
- key String
- User-specific unique identifier for a cart discount. Must be unique across a project
- name Map<String>
- LocalizedString
- predicate String
- A valid Cart Predicate
- requiresDiscount BooleanCode 
- States whether the discount can only be used in a connection with a DiscountCode
- sortOrder String
- The string must contain a number between 0 and 1. All matching cart discounts are applied to a cart in the order defined by this field. A discount with greater sort order is prioritized higher than a discount with lower sort order. The sort order is unambiguous among all cart discounts
- stackingMode String
- Specifies whether the application of this discount causes the following discounts to be ignored. Can be either Stacking or StopAfterThisDiscount
- stores List<String>
- If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field. If empty, the Cart Discount applies on all Carts, irrespective of a Store. Use store keys as references
- target Property Map
- Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
- validFrom String
- validUntil String
- value Property Map
- Defines the effect the discount will have. CartDiscountValue
- version Number
Supporting Types
CartDiscountCustom, CartDiscountCustomArgs      
CartDiscountTarget, CartDiscountTargetArgs      
- Type string
- Supports lineItems, customLineItems, multiBuyLineItems, multiBuyCustomLineItems, shipping or totalPrice
- DiscountedQuantity double
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- MaxOccurrence double
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- Predicate string
- LineItems, CustomLineItems, MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- SelectionMode string
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. Can be either Cheapest or MostExpensive. If set for another target the value will be ignored
- TriggerQuantity double
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- Type string
- Supports lineItems, customLineItems, multiBuyLineItems, multiBuyCustomLineItems, shipping or totalPrice
- DiscountedQuantity float64
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- MaxOccurrence float64
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- Predicate string
- LineItems, CustomLineItems, MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- SelectionMode string
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. Can be either Cheapest or MostExpensive. If set for another target the value will be ignored
- TriggerQuantity float64
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- type String
- Supports lineItems, customLineItems, multiBuyLineItems, multiBuyCustomLineItems, shipping or totalPrice
- discountedQuantity Double
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- maxOccurrence Double
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- predicate String
- LineItems, CustomLineItems, MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- selectionMode String
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. Can be either Cheapest or MostExpensive. If set for another target the value will be ignored
- triggerQuantity Double
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- type string
- Supports lineItems, customLineItems, multiBuyLineItems, multiBuyCustomLineItems, shipping or totalPrice
- discountedQuantity number
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- maxOccurrence number
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- predicate string
- LineItems, CustomLineItems, MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- selectionMode string
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. Can be either Cheapest or MostExpensive. If set for another target the value will be ignored
- triggerQuantity number
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- type str
- Supports lineItems, customLineItems, multiBuyLineItems, multiBuyCustomLineItems, shipping or totalPrice
- discounted_quantity float
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- max_occurrence float
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- predicate str
- LineItems, CustomLineItems, MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- selection_mode str
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. Can be either Cheapest or MostExpensive. If set for another target the value will be ignored
- trigger_quantity float
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- type String
- Supports lineItems, customLineItems, multiBuyLineItems, multiBuyCustomLineItems, shipping or totalPrice
- discountedQuantity Number
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- maxOccurrence Number
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- predicate String
- LineItems, CustomLineItems, MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
- selectionMode String
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. Can be either Cheapest or MostExpensive. If set for another target the value will be ignored
- triggerQuantity Number
- MultiBuyLineItems or MultiBuyCustomLineItems target specific fields. If set for another target the value will be ignored
CartDiscountValue, CartDiscountValueArgs      
- Type string
- Currently supports absolute/relative/giftLineItem
- DistributionChannel stringId 
- Channel must have the role ProductDistribution. Optional when value type is giftLineItem
- Monies
List<CartDiscount Value Money> 
- Absolute discount specific fields
- Permyriad double
- Relative discount specific fields
- ProductId string
- ResourceIdentifier of a Product. Required when value type is giftLineItem
- SupplyChannel stringId 
- Channel must have the role InventorySupply. Optional when value type is giftLineItem
- VariantId double
- ProductVariant of the Product. Required when value type is giftLineItem
- Type string
- Currently supports absolute/relative/giftLineItem
- DistributionChannel stringId 
- Channel must have the role ProductDistribution. Optional when value type is giftLineItem
- Monies
[]CartDiscount Value Money 
- Absolute discount specific fields
- Permyriad float64
- Relative discount specific fields
- ProductId string
- ResourceIdentifier of a Product. Required when value type is giftLineItem
- SupplyChannel stringId 
- Channel must have the role InventorySupply. Optional when value type is giftLineItem
- VariantId float64
- ProductVariant of the Product. Required when value type is giftLineItem
- type String
- Currently supports absolute/relative/giftLineItem
- distributionChannel StringId 
- Channel must have the role ProductDistribution. Optional when value type is giftLineItem
- monies
List<CartDiscount Value Money> 
- Absolute discount specific fields
- permyriad Double
- Relative discount specific fields
- productId String
- ResourceIdentifier of a Product. Required when value type is giftLineItem
- supplyChannel StringId 
- Channel must have the role InventorySupply. Optional when value type is giftLineItem
- variantId Double
- ProductVariant of the Product. Required when value type is giftLineItem
- type string
- Currently supports absolute/relative/giftLineItem
- distributionChannel stringId 
- Channel must have the role ProductDistribution. Optional when value type is giftLineItem
- monies
CartDiscount Value Money[] 
- Absolute discount specific fields
- permyriad number
- Relative discount specific fields
- productId string
- ResourceIdentifier of a Product. Required when value type is giftLineItem
- supplyChannel stringId 
- Channel must have the role InventorySupply. Optional when value type is giftLineItem
- variantId number
- ProductVariant of the Product. Required when value type is giftLineItem
- type str
- Currently supports absolute/relative/giftLineItem
- distribution_channel_ strid 
- Channel must have the role ProductDistribution. Optional when value type is giftLineItem
- monies
Sequence[CartDiscount Value Money] 
- Absolute discount specific fields
- permyriad float
- Relative discount specific fields
- product_id str
- ResourceIdentifier of a Product. Required when value type is giftLineItem
- supply_channel_ strid 
- Channel must have the role InventorySupply. Optional when value type is giftLineItem
- variant_id float
- ProductVariant of the Product. Required when value type is giftLineItem
- type String
- Currently supports absolute/relative/giftLineItem
- distributionChannel StringId 
- Channel must have the role ProductDistribution. Optional when value type is giftLineItem
- monies List<Property Map>
- Absolute discount specific fields
- permyriad Number
- Relative discount specific fields
- productId String
- ResourceIdentifier of a Product. Required when value type is giftLineItem
- supplyChannel StringId 
- Channel must have the role InventorySupply. Optional when value type is giftLineItem
- variantId Number
- ProductVariant of the Product. Required when value type is giftLineItem
CartDiscountValueMoney, CartDiscountValueMoneyArgs        
- CentAmount double
- The amount in cents (the smallest indivisible unit of the currency)
- CurrencyCode string
- The currency code compliant to ISO 4217
- CentAmount float64
- The amount in cents (the smallest indivisible unit of the currency)
- CurrencyCode string
- The currency code compliant to ISO 4217
- centAmount Double
- The amount in cents (the smallest indivisible unit of the currency)
- currencyCode String
- The currency code compliant to ISO 4217
- centAmount number
- The amount in cents (the smallest indivisible unit of the currency)
- currencyCode string
- The currency code compliant to ISO 4217
- cent_amount float
- The amount in cents (the smallest indivisible unit of the currency)
- currency_code str
- The currency code compliant to ISO 4217
- centAmount Number
- The amount in cents (the smallest indivisible unit of the currency)
- currencyCode String
- The currency code compliant to ISO 4217
Package Details
- Repository
- commercetools labd/terraform-provider-commercetools
- License
- Notes
- This Pulumi package is based on the commercetoolsTerraform Provider.