Skip to content

Latest commit

 

History

History
177 lines (136 loc) · 4.76 KB

File metadata and controls

177 lines (136 loc) · 4.76 KB
page_title subcategory description
epilot-product_coupon Resource - terraform-provider-epilot-product
Coupon Resource

epilot-product_coupon (Resource)

Coupon Resource

Example Usage

resource "epilot-product_coupon" "my_coupon" {
  active = true
  additional = {
    key = jsonencode("value"),
  }
  cashback_period = "12"
  category        = "discount"
  description     = "...my_description..."
  files = {
    dollar_relation = [
      {
        entity_id = "123e4567-e89b-12d3-a456-426614174000"
        tags = [
          "..."
        ]
      }
    ]
  }
  fixed_value          = 3.79
  fixed_value_currency = "EUR"
  fixed_value_decimal  = "...my_fixed_value_decimal..."
  manifest = [
    "123e4567-e89b-12d3-a456-426614174000"
  ]
  name             = "...my_name..."
  percentage_value = "...my_percentage_value..."
  prices = {
    dollar_relation = [
      {
        entity_id = "123e4567-e89b-12d3-a456-426614174000"
        tags = [
          "..."
        ]
      }
    ]
  }
  promo_code_usage = "{ \"see\": \"documentation\" }"
  promo_codes = [
    {
      code            = "...my_code..."
      has_usage_limit = false
      id              = "...my_id..."
      usage_limit     = 8.12
    }
  ]
  requires_promo_code = false
  schema              = "coupon"
  tags = [
    "..."
  ]
  type = "fixed"
}

Schema

Required

  • active (Boolean)
  • category (String) must be one of ["discount", "cashback"]
  • name (String)
  • type (String) must be one of ["fixed", "percentage"]

Optional

  • additional (Map of String) Additional fields that are not part of the schema
  • cashback_period (String) The cashback period, for now it's limited to either 0 months or 12 months. must be one of ["0", "12"]
  • description (String)
  • files (Attributes) (see below for nested schema)
  • fixed_value (Number) Use if type is set to fixed. The fixed amount in cents to be discounted, represented as a whole integer.
  • fixed_value_currency (String) Use if type is set to fixed. Three-letter ISO currency code, in lowercase.
  • fixed_value_decimal (String) Use if type is set to fixed. The unit amount in cents to be discounted, represented as a decimal string with at most 12 decimal places.
  • manifest (List of String) Manifest ID used to create/update the entity
  • percentage_value (String) Use if type is set to percentage. The percentage to be discounted, represented as a whole integer.
  • prices (Attributes) (see below for nested schema)
  • promo_code_usage (String) Map of ids of promo codes with their usage count. Parsed as JSON.
  • promo_codes (Attributes List) (see below for nested schema)
  • requires_promo_code (Boolean) Whether the coupon requires a promo code to be applied
  • schema (String) must be "coupon"
  • tags (List of String)

Read-Only

  • acl (Attributes) Access control list (ACL) for an entity. Defines sharing access to external orgs or users. (see below for nested schema)
  • created_at (String)
  • id (String) The ID of this resource.
  • org (String) Organization Id the entity belongs to
  • owners (Attributes List) (see below for nested schema)
  • title (String)
  • updated_at (String)

Nested Schema for files

Optional:

Nested Schema for files.dollar_relation

Optional:

  • entity_id (String)
  • tags (List of String)

Nested Schema for prices

Optional:

Nested Schema for prices.dollar_relation

Optional:

  • entity_id (String)
  • tags (List of String)

Nested Schema for promo_codes

Optional:

  • code (String) The code of the promo code. Not Null
  • has_usage_limit (Boolean) Whether the promo code has a usage limit
  • id (String) The id of the promo code. Not Null
  • usage_limit (Number) The usage limit of the promo code

Nested Schema for acl

Read-Only:

  • delete (List of String)
  • edit (List of String)
  • view (List of String)

Nested Schema for owners

Read-Only:

  • org_id (String)
  • user_id (String)

Import

Import is supported using the following syntax:

terraform import epilot-product_coupon.my_epilot-product_coupon "123e4567-e89b-12d3-a456-426614174000"