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

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",
    },
});
Copy
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",
    })
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 {
		// 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
	})
}
Copy
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",
        },
    });

});
Copy
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());

    }
}
Copy
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
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. CartDiscountArgs
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 This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. CartDiscountArgs
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 This property is required. CartDiscountArgs
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. 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" },
        },
    },
});
Copy
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"),
},
},
})
Copy
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());
Copy
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",
        },
    })
Copy
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",
        },
    },
});
Copy
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
Copy

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 This property is required. Dictionary<string, string>
LocalizedString
Predicate This property is required. string
A valid Cart Predicate
SortOrder This property is required. 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 This property is required. CartDiscountValue
Defines the effect the discount will have. CartDiscountValue
CartDiscountId string
The ID of this resource.
Custom CartDiscountCustom
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
RequiresDiscountCode bool
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 CartDiscountTarget
Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
ValidFrom string
ValidUntil string
Name This property is required. map[string]string
LocalizedString
Predicate This property is required. string
A valid Cart Predicate
SortOrder This property is required. 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 This property is required. CartDiscountValueArgs
Defines the effect the discount will have. CartDiscountValue
CartDiscountId string
The ID of this resource.
Custom CartDiscountCustomArgs
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
RequiresDiscountCode bool
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 CartDiscountTargetArgs
Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
ValidFrom string
ValidUntil string
name This property is required. Map<String,String>
LocalizedString
predicate This property is required. String
A valid Cart Predicate
sortOrder This property is required. 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 This property is required. CartDiscountValue
Defines the effect the discount will have. CartDiscountValue
cartDiscountId String
The ID of this resource.
custom CartDiscountCustom
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
requiresDiscountCode Boolean
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 CartDiscountTarget
Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
validFrom String
validUntil String
name This property is required. {[key: string]: string}
LocalizedString
predicate This property is required. string
A valid Cart Predicate
sortOrder This property is required. 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 This property is required. CartDiscountValue
Defines the effect the discount will have. CartDiscountValue
cartDiscountId string
The ID of this resource.
custom CartDiscountCustom
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
requiresDiscountCode boolean
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 CartDiscountTarget
Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
validFrom string
validUntil string
name This property is required. Mapping[str, str]
LocalizedString
predicate This property is required. str
A valid Cart Predicate
sort_order This property is required. 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 This property is required. CartDiscountValueArgs
Defines the effect the discount will have. CartDiscountValue
cart_discount_id str
The ID of this resource.
custom CartDiscountCustomArgs
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_code bool
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 CartDiscountTargetArgs
Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
valid_from str
valid_until str
name This property is required. Map<String>
LocalizedString
predicate This property is required. String
A valid Cart Predicate
sortOrder This property is required. 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 This property is required. Property Map
Defines the effect the discount will have. CartDiscountValue
cartDiscountId String
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
requiresDiscountCode Boolean
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:

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 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) -> CartDiscount
func 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 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:
CartDiscountId string
The ID of this resource.
Custom CartDiscountCustom
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
RequiresDiscountCode bool
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 CartDiscountTarget
Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
ValidFrom string
ValidUntil string
Value CartDiscountValue
Defines the effect the discount will have. CartDiscountValue
Version double
CartDiscountId string
The ID of this resource.
Custom CartDiscountCustomArgs
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
RequiresDiscountCode bool
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 CartDiscountTargetArgs
Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
ValidFrom string
ValidUntil string
Value CartDiscountValueArgs
Defines the effect the discount will have. CartDiscountValue
Version float64
cartDiscountId String
The ID of this resource.
custom CartDiscountCustom
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
requiresDiscountCode Boolean
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 CartDiscountTarget
Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
validFrom String
validUntil String
value CartDiscountValue
Defines the effect the discount will have. CartDiscountValue
version Double
cartDiscountId string
The ID of this resource.
custom CartDiscountCustom
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
requiresDiscountCode boolean
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 CartDiscountTarget
Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
validFrom string
validUntil string
value CartDiscountValue
Defines the effect the discount will have. CartDiscountValue
version number
cart_discount_id str
The ID of this resource.
custom CartDiscountCustomArgs
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_code bool
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 CartDiscountTargetArgs
Empty when the value has type giftLineItem, otherwise a CartDiscountTarget
valid_from str
valid_until str
value CartDiscountValueArgs
Defines the effect the discount will have. CartDiscountValue
version float
cartDiscountId String
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
requiresDiscountCode Boolean
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

TypeId This property is required. string
Fields Dictionary<string, string>
Custom fields for this resource. Note that the values need to be provided as JSON encoded strings: my-value = jsonencode({"key": "value"})
TypeId This property is required. string
Fields map[string]string
Custom fields for this resource. Note that the values need to be provided as JSON encoded strings: my-value = jsonencode({"key": "value"})
typeId This property is required. String
fields Map<String,String>
Custom fields for this resource. Note that the values need to be provided as JSON encoded strings: my-value = jsonencode({"key": "value"})
typeId This property is required. string
fields {[key: string]: string}
Custom fields for this resource. Note that the values need to be provided as JSON encoded strings: my-value = jsonencode({"key": "value"})
type_id This property is required. str
fields Mapping[str, str]
Custom fields for this resource. Note that the values need to be provided as JSON encoded strings: my-value = jsonencode({"key": "value"})
typeId This property is required. String
fields Map<String>
Custom fields for this resource. Note that the values need to be provided as JSON encoded strings: my-value = jsonencode({"key": "value"})

CartDiscountTarget
, CartDiscountTargetArgs

Type This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. string
Currently supports absolute/relative/giftLineItem
DistributionChannelId string
Channel must have the role ProductDistribution. Optional when value type is giftLineItem
Monies List<CartDiscountValueMoney>
Absolute discount specific fields
Permyriad double
Relative discount specific fields
ProductId string
ResourceIdentifier of a Product. Required when value type is giftLineItem
SupplyChannelId string
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 This property is required. string
Currently supports absolute/relative/giftLineItem
DistributionChannelId string
Channel must have the role ProductDistribution. Optional when value type is giftLineItem
Monies []CartDiscountValueMoney
Absolute discount specific fields
Permyriad float64
Relative discount specific fields
ProductId string
ResourceIdentifier of a Product. Required when value type is giftLineItem
SupplyChannelId string
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 This property is required. String
Currently supports absolute/relative/giftLineItem
distributionChannelId String
Channel must have the role ProductDistribution. Optional when value type is giftLineItem
monies List<CartDiscountValueMoney>
Absolute discount specific fields
permyriad Double
Relative discount specific fields
productId String
ResourceIdentifier of a Product. Required when value type is giftLineItem
supplyChannelId String
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 This property is required. string
Currently supports absolute/relative/giftLineItem
distributionChannelId string
Channel must have the role ProductDistribution. Optional when value type is giftLineItem
monies CartDiscountValueMoney[]
Absolute discount specific fields
permyriad number
Relative discount specific fields
productId string
ResourceIdentifier of a Product. Required when value type is giftLineItem
supplyChannelId string
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 This property is required. str
Currently supports absolute/relative/giftLineItem
distribution_channel_id str
Channel must have the role ProductDistribution. Optional when value type is giftLineItem
monies Sequence[CartDiscountValueMoney]
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_id str
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 This property is required. String
Currently supports absolute/relative/giftLineItem
distributionChannelId String
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
supplyChannelId String
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 This property is required. double
The amount in cents (the smallest indivisible unit of the currency)
CurrencyCode This property is required. string
The currency code compliant to ISO 4217
CentAmount This property is required. float64
The amount in cents (the smallest indivisible unit of the currency)
CurrencyCode This property is required. string
The currency code compliant to ISO 4217
centAmount This property is required. Double
The amount in cents (the smallest indivisible unit of the currency)
currencyCode This property is required. String
The currency code compliant to ISO 4217
centAmount This property is required. number
The amount in cents (the smallest indivisible unit of the currency)
currencyCode This property is required. string
The currency code compliant to ISO 4217
cent_amount This property is required. float
The amount in cents (the smallest indivisible unit of the currency)
currency_code This property is required. str
The currency code compliant to ISO 4217
centAmount This property is required. Number
The amount in cents (the smallest indivisible unit of the currency)
currencyCode This property is required. 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 commercetools Terraform Provider.