> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.shopify.discounts.GetDiscountCode

- Component: `appmixer.shopify.discounts.GetDiscountCode`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.shopify 4.1.0](https://connectors.appmixer.com/connector/appmixer.shopify/4.1.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.shopify/4.1.0/component/appmixer.shopify.discounts.GetDiscountCode>

Get the discount a discount code belongs to: its terms, status and codes.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Discount Code (`code`) | text | The discount code to look up, e.g. **SUMMER15**. Codes are not case-sensitive. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Discount ID (`id`) | string | - |
| Discount Type (`discountType`) | string | - |
| Title (`title`) | string | - |
| Status (`status`) | string | - |
| Starts At (`startsAt`) | string | - |
| Ends At (`endsAt`) | string | - |
| Usage Limit (`usageLimit`) | integer | - |
| Once Per Customer (`appliesOncePerCustomer`) | boolean | - |
| Usage Count (`asyncUsageCount`) | integer | - |
| Created At (`createdAt`) | string | - |
| Updated At (`updatedAt`) | string | - |
| Combines With (`combinesWith`) | object | - |
| Codes (`codes`) | array | - |
| Summary (`summary`) | string | - |
| Customer Gets (`customerGets`) | object | - |
| Minimum Requirement (`minimumRequirement`) | object | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.shopify.discounts.GetDiscountCode",
  "description": "Get the discount a discount code belongs to: its terms, status and codes.",
  "author": "Appmixer <info@appmixer.com>",
  "private": false,
  "auth": {
    "service": "appmixer:shopify",
    "scope": [
      "read_discounts"
    ]
  },
  "quota": {
    "manager": "appmixer:shopify",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          }
        },
        "required": [
          "code"
        ]
      },
      "inspector": {
        "inputs": {
          "code": {
            "type": "text",
            "label": "Discount Code",
            "index": 0,
            "tooltip": "The discount code to look up, e.g. <b>SUMMER15</b>. Codes are not case-sensitive."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "required": [
          "id",
          "discountType",
          "title",
          "status",
          "startsAt",
          "appliesOncePerCustomer",
          "asyncUsageCount",
          "createdAt",
          "updatedAt",
          "combinesWith",
          "codes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "title": "Discount ID",
            "example": "gid://shopify/DiscountCodeNode/2382143062097"
          },
          "discountType": {
            "type": "string",
            "title": "Discount Type",
            "example": "DiscountCodeBasic"
          },
          "title": {
            "type": "string",
            "title": "Title",
            "example": "Autumn sale"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "example": "ACTIVE"
          },
          "startsAt": {
            "type": "string",
            "title": "Starts At",
            "example": "2026-10-05T08:23:12Z",
            "format": "date-time"
          },
          "endsAt": {
            "type": "string",
            "title": "Ends At",
            "example": "2026-11-04T08:23:12Z",
            "format": "date-time"
          },
          "usageLimit": {
            "type": "integer",
            "title": "Usage Limit",
            "example": 10
          },
          "appliesOncePerCustomer": {
            "type": "boolean",
            "title": "Once Per Customer",
            "example": false
          },
          "asyncUsageCount": {
            "type": "integer",
            "title": "Usage Count",
            "example": 0
          },
          "createdAt": {
            "type": "string",
            "title": "Created At",
            "example": "2026-10-05T08:23:13Z",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "title": "Updated At",
            "example": "2026-10-05T08:23:13Z",
            "format": "date-time"
          },
          "combinesWith": {
            "type": "object",
            "title": "Combines With",
            "required": [
              "orderDiscounts",
              "productDiscounts",
              "shippingDiscounts"
            ],
            "properties": {
              "orderDiscounts": {
                "type": "boolean",
                "title": "Combines With.Order Discounts",
                "example": false
              },
              "productDiscounts": {
                "type": "boolean",
                "title": "Combines With.Product Discounts",
                "example": false
              },
              "shippingDiscounts": {
                "type": "boolean",
                "title": "Combines With.Shipping Discounts",
                "example": false
              }
            }
          },
          "codes": {
            "type": "array",
            "title": "Codes",
            "items": {
              "type": "object",
              "required": [
                "id",
                "code",
                "asyncUsageCount",
                "createdAt"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "title": "ID",
                  "example": "gid://shopify/DiscountRedeemCode/34881968013393"
                },
                "code": {
                  "type": "string",
                  "title": "Code",
                  "example": "AUTUMN15"
                },
                "asyncUsageCount": {
                  "type": "integer",
                  "title": "Usage Count",
                  "example": 0
                },
                "createdAt": {
                  "type": "string",
                  "title": "Created At",
                  "example": "2026-10-05T08:23:13Z",
                  "format": "date-time"
                }
              }
            },
            "example": [
              {
                "id": "gid://shopify/DiscountRedeemCode/34881968013393",
                "code": "AUTUMN15",
                "asyncUsageCount": 0,
                "createdAt": "2026-10-05T08:23:13Z"
              }
            ]
          },
          "summary": {
            "type": "string",
            "title": "Summary",
            "example": "15% off one-time purchase products • Minimum purchase of $50.00"
          },
          "customerGets": {
            "type": "object",
            "title": "Customer Gets",
            "required": [
              "value"
            ],
            "properties": {
              "value": {
                "type": "object",
                "title": "Customer Gets.Value",
                "properties": {
                  "percentage": {
                    "type": "number",
                    "title": "Customer Gets.Value.Percentage",
                    "example": 0.15
                  },
                  "amount": {
                    "type": "object",
                    "title": "Customer Gets.Value.Amount",
                    "required": [
                      "amount",
                      "currencyCode"
                    ],
                    "properties": {
                      "amount": {
                        "type": "string",
                        "title": "Customer Gets.Value.Amount.Amount",
                        "example": "5.0"
                      },
                      "currencyCode": {
                        "type": "string",
                        "title": "Customer Gets.Value.Amount.Currency Code",
                        "example": "USD"
                      }
                    }
                  },
                  "appliesOnEachItem": {
                    "type": "boolean",
                    "title": "Customer Gets.Value.Applies on Each Item",
                    "example": false
                  }
                }
              }
            }
          },
          "minimumRequirement": {
            "type": "object",
            "title": "Minimum Requirement",
            "properties": {
              "greaterThanOrEqualToSubtotal": {
                "type": "object",
                "title": "Minimum Requirement.Minimum Subtotal",
                "required": [
                  "amount",
                  "currencyCode"
                ],
                "properties": {
                  "amount": {
                    "type": "string",
                    "title": "Minimum Requirement.Minimum Subtotal.Amount",
                    "example": "50.0"
                  },
                  "currencyCode": {
                    "type": "string",
                    "title": "Minimum Requirement.Minimum Subtotal.Currency Code",
                    "example": "USD"
                  }
                }
              },
              "greaterThanOrEqualToQuantity": {
                "type": "string",
                "title": "Minimum Requirement.Minimum Quantity",
                "example": "2"
              }
            }
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
