---
title: "Get Coupon By Code"
method: GET
path: "/Sites/{siteId}/Coupons/ByCode"
tags: ["Coupons"]
---

# Get Coupon By Code

`GET /Sites/{siteId}/Coupons/ByCode`

## Path parameters

- `siteId` integer, required

## Query parameters

- `code` string

## Response `200`

Success

- QPilotCoreModelsDtoLegacyLegacyCouponDto
  - `id` integer
  - `siteId` integer
  - `code` string, nullable
  - `name` string, nullable
  - `country` string, nullable
  - `postcode` string, nullable
  - `state` string, nullable
  - `city` string, nullable
  - `minUnits` integer, nullable
  - `maxUnits` integer, nullable
  - `minWeight` number, double, nullable
  - `maxWeight` number, double, nullable
  - `weightUnitType` 'Pound' | 'Ounce' | 'Kilogram' | 'Gram'
  - `cycles` integer
  - `maxCyclesPerSite` integer, nullable
  - `minSubtotal` number, float, nullable
  - `maxSubtotal` number, float, nullable
  - `maxCyclesPerCustomer` integer, nullable
  - `assignments` integer, nullable
  - `maxAssignmentsPerCustomer` integer, nullable
  - `maxAssignmentsPerSite` integer, nullable
  - `minScheduledOrderCycles` integer, nullable
  - `maxScheduledOrderCycles` integer, nullable
  - `maxCyclesPerScheduledOrder` integer, nullable
  - `maxDiscountPerCustomer` number, double, nullable
  - `lifetimeValue` number, double
  - `amount` number, double
  - `discountType` 'None' | 'ReduceSubtotalByPercentage' | 'ReduceSubtotalByAmount' | 'ReduceShippingByPercentage' | 'ReduceShippingByAmount' | 'SetShippingToAmount' | 'ReduceProductPriceByPercentage' | 'ReduceProductPriceByAmount'
  - `maxPercentageDiscount` number, double, nullable
  - `expirationDate` string, date-time, nullable
  - `applyExpirationDateToExisting` boolean
  - `isStackable` boolean
  - `productId` integer, nullable
  - `product` QPilotCoreModelsDtoLegacyLegacyProductDto
    - `id` integer
    - `siteId` integer
    - `parentProductId` integer, nullable
    - `externalId` string, required
    - `type` string, required
    - `sku` string, nullable
    - `title` string, required
    - `description` string, nullable
    - `price` number, float
    - `salePrice` number, float, nullable
    - `length` string, nullable
    - `width` string, nullable
    - `height` string, nullable
    - `weight` string, nullable
    - `weightUnitType` 'Pound' | 'Ounce' | 'Kilogram' | 'Gram'
    - `lengthUnitType` 'Inch' | 'Foot' | 'Yard' | 'Milimeter' | 'Centimeter' | 'Meter'
    - `shippingClass` string, nullable
    - `taxClass` string, nullable
    - `imageUrl` string, nullable
    - `imageThumbUrl` string, nullable
    - `availability` 'None' | 'AddToScheduledOrder' | 'ProcessScheduledOrder'
    - `stockLevel` 'Undefined' | 'InStock' | 'OutOfStock' | 'Preorder'
    - `stock` integer, nullable
    - `createdUtc` string, date-time
    - `updatedUtc` string, date-time
    - `lifetimeValue` number, double
    - `active` boolean, nullable
    - `valid` boolean, nullable
    - `productGroupIds` integer[], nullable
    - `validationErrorCode` 1 | 2 | 3 | 4
    - `backordersAllowed` boolean, nullable
    - `metadata` object, nullable
    - `syncOnUpdate` boolean
    - `quantityLabel` string, nullable
  - `productDiscountNotAppliesWhenItHasSalePrice` boolean
  - `subtotalDiscountAppliesToRegularPrice` boolean
  - `createdUtc` string, date-time
  - `updatedUtc` string, date-time
  - `includeCustomerEmails` string, nullable
  - `excludeCustomerEmails` string, nullable
  - `active` boolean
  - `valid` boolean
  - `couponInvalidationCode` 'Expired' | 'SiteLimitExceeded' | 'ScheduledOrderLimitExceeded' | 'CustomerLimitExceeded' | 'GeographyNotMet' | 'TotalsNotMet' | 'UnitsNotMet' | 'MinWeightNotMet' | 'MaxWeightNotMet' | 'ScheduledOrderCyclesNotMet' | 'CustomerInclusionList' | 'CustomerExclusionList' | 'NonStackable' | 'ManuallyRemoved' | 'MaxAssignmentsReached' | 'MapRemoved' | 'ProductNotPresent' | 'SubtotalDiscountTypeMixed' | 'ItemHasSalePrice'
  - `productGroupId` integer, nullable
  - `productGroup` QPilotCoreModelsDtoEntitiesProductGroupDto
    - `productGroupId` integer, nullable
    - `name` string, required
    - `createdUtc` string, date-time, nullable
    - `updatedUtc` string, date-time, nullable
    - `siteId` integer
    - `products` QPilotCoreModelsDtoEntitiesProductGroupProductsDto[], nullable
      - `id` string, required
      - `title` string, nullable
  - `productsExternalIds` string[], nullable

---

[API](https://skmtc.net/qpilot/apis/qpilot-api.md) · [All operations](https://skmtc.net/qpilot/apis/qpilot-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/qpilot/qpilot-api/revisions/b2f13a808fdd/schema)
