---
displayed_sidebar: homepage
---

import ParameterTypes from "@site/src/components/ParameterTypes"

# AdminDiscountsRes

 **AdminDiscountsRes**: `Object`

The discount's details.

## Type declaration

<ParameterTypes parameters={[
  {
    "name": "discount",
    "type": "[Discount](../../entities/classes/entities.Discount.mdx)",
    "description": "Discount details.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "code",
        "type": "`string`",
        "description": "A unique code for the discount - this will be used by the customer to apply the discount",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "created_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was created.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "deleted_at",
        "type": "`null` \\| `Date`",
        "description": "The date with timezone at which the resource was deleted.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "ends_at",
        "type": "`null` \\| `Date`",
        "description": "The time at which the discount can no longer be used.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The discount's ID",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "is_disabled",
        "type": "`boolean`",
        "description": "Whether the Discount has been disabled. Disabled discounts cannot be applied to carts",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "is_dynamic",
        "type": "`boolean`",
        "description": "A flag to indicate if multiple instances of the discount can be generated. I.e. for newsletter discounts",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "metadata",
        "type": "`Record<string, unknown>`",
        "description": "An optional key-value map with additional details",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "parent_discount",
        "type": "[Discount](../../entities/classes/entities.Discount.mdx)",
        "description": "The details of the parent discount that this discount was created from.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "parent_discount_id",
        "type": "`string`",
        "description": "The Discount that the discount was created from. This will always be a dynamic discount",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "regions",
        "type": "[Region](../../entities/classes/entities.Region.mdx)[]",
        "description": "The details of the regions in which the Discount can be used.",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "rule",
        "type": "[DiscountRule](../../entities/classes/entities.DiscountRule.mdx)",
        "description": "The details of the discount rule that defines how the discount will be applied to a cart..",
        "optional": false,
        "defaultValue": "",
        "expandable": true,
        "children": []
      },
      {
        "name": "rule_id",
        "type": "`string`",
        "description": "The ID of the discount rule that defines how the discount will be applied to a cart.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "starts_at",
        "type": "`Date`",
        "description": "The time at which the discount can be used.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "updated_at",
        "type": "`Date`",
        "description": "The date with timezone at which the resource was updated.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "usage_count",
        "type": "`number`",
        "description": "The number of times a discount has been used.",
        "optional": false,
        "defaultValue": "0",
        "expandable": false,
        "children": []
      },
      {
        "name": "usage_limit",
        "type": "`null` \\| `number`",
        "description": "The maximum number of times that a discount can be used.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "valid_duration",
        "type": "`null` \\| `string`",
        "description": "Duration the discount runs between",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} />
